Bug 181657 - [bpf] [patch] BPF_COP/BPF_COPX instruction reservation (sync with NetBSD)
Summary: [bpf] [patch] BPF_COP/BPF_COPX instruction reservation (sync with NetBSD)
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: Unspecified
Hardware: Any Any
: Normal Affects Only Me
Assignee: Xin LI
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2013-08-29 19:10 UTC by Mindaugas Rasiukevicius
Modified: 2022-11-23 00:14 UTC (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mindaugas Rasiukevicius 2013-08-29 19:10:00 UTC
Support for BPF coprocessor has been added to NetBSD (all details were also
presented on freebsd-net@).  This functionality adds two new instructions:

 #define BPF_MISCOP(code) ((code) & 0xf8)
 #define		BPF_TAX		0x00
+#define		BPF_COP		0x20
+#define		BPF_COPX	0x40
 #define		BPF_TXA		0x80

It would be great if FreeBSD would reserve the opcodes.  If you would like
to backport the BPF coprocessor interface, the change is here:

http://mail-index.netbsd.org/source-changes/2013/08/29/msg047090.html
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2013-08-30 04:11:33 UTC
Responsible Changed
From-To: freebsd-bugs->freebsd-net

Over to maintainer(s).
Comment 2 Christian Brueffer freebsd_committer freebsd_triage 2014-06-24 16:46:15 UTC
Adrian volunteered to handle this.
Comment 3 Eitan Adler freebsd_committer freebsd_triage 2018-05-28 19:46:49 UTC
batch change:

For bugs that match the following
-  Status Is In progress 
AND
- Untouched since 2018-01-01.
AND
- Affects Base System OR Documentation

DO:

Reset to open status.


Note:
I did a quick pass but if you are getting this email it might be worthwhile to double check to see if this bug ought to be closed.
Comment 4 Warner Losh freebsd_committer freebsd_triage 2019-04-28 23:26:17 UTC
This has been semi-committed:

#define         BPF_TAX         0x00
/*                              0x08    reserved */
/*                              0x10    reserved */
/*                              0x18    reserved */
/* #define      BPF_COP         0x20    NetBSD "coprocessor" extensions */
/*                              0x28    reserved */
/*                              0x30    reserved */
/*                              0x38    reserved */
/* #define      BPF_COPX        0x40    NetBSD "coprocessor" extensions */
/*                                      also used on BSD/OS */
/*                              0x48    reserved */

They are marked as reserved in bpf.h

Do they need to be uncommented out? I believe they are commented because FreeBSD doesn't use those values at all and so code compiled with the extension can either ifdef it, or fail to build.
Comment 5 Graham Perrin freebsd_committer freebsd_triage 2022-10-17 12:38:39 UTC
Keyword: 

    patch
or  patch-ready

– in lieu of summary line prefix: 

    [patch]

* bulk change for the keyword
* summary lines may be edited manually (not in bulk). 

Keyword descriptions and search interface: 

    <https://bugs.freebsd.org/bugzilla/describekeywords.cgi>
Comment 6 Xin LI freebsd_committer freebsd_triage 2022-11-23 00:14:38 UTC
The values are currently reserved (as part of a previous libpcap import by me) and will not be used for other purposes, so closing as fixed.

I think we should leave these commented: the only consumer as of today was NetBSD's npf, so we can bring it to live should we incorporate npf in the future.