PERFORCE change 197533 for review

Takuya ASADA syuu at FreeBSD.org
Fri Aug 12 05:18:02 UTC 2011


http://p4web.freebsd.org/@@197533?ac=10

Change 197533 by syuu at kikurage on 2011/08/12 05:17:00

	mq_bpf document added on bpf(4) netintro(4)

Affected files ...

.. //depot/projects/soc2011/mq_bpf/src/share/man/man4/bpf.4#2 edit
.. //depot/projects/soc2011/mq_bpf/src/share/man/man4/netintro.4#2 edit

Differences ...

==== //depot/projects/soc2011/mq_bpf/src/share/man/man4/bpf.4#2 (text+ko) ====

@@ -47,7 +47,7 @@
 .\" This document is derived in part from the enet man page (enet.4)
 .\" distributed with 4.3BSD Unix.
 .\"
-.\" $FreeBSD: src/share/man/man4/bpf.4,v 1.56 2010/10/08 12:40:16 uqs Exp $
+.\" $FreeBSD$
 .\"
 .Dd June 15, 2010
 .Dt BPF 4
@@ -631,6 +631,46 @@
 .Vt bzh_kernel_gen
 against
 .Vt bzh_user_gen .
+.It Dv BIOCENAQMASK
+Enables multiqueue filter on the descriptor.
+
+.It Dv BIOCDISQMASK
+Disables multiqueue filter on the descriptor.
+
+.It Dv BIOCSTRXQMASK
+.Pq Li uint32_t
+Set mask bit on specified RX queue.
+
+.It Dv BIOCCRRXQMASK
+.Pq Li uint32_t
+Clear mask bit on specified RX queue.
+
+.It Dv BIOCGTRXQMASK
+.Pq Li uint32_t
+Get mask bit on specified RX queue.
+
+.It Dv BIOCSTTXQMASK
+.Pq Li uint32_t
+Set mask bit on specified TX queue.
+
+.It Dv BIOCCRTXQMASK
+.Pq Li uint32_t
+Clear mask bit on specified TX queue.
+
+.It Dv BIOCGTTXQMASK
+.Pq Li uint32_t
+Get mask bit on specified TX queue.
+
+.It Dv BIOCSTOTHERMASK
+Set mask bit for the packets which not tied with any queues.
+
+.It Dv BIOCCROTHERMASK
+Clear mask bit for the packets which not tied with any queues.
+
+.It Dv BIOCGTOTHERMASK
+.Pq Li uint32_t
+Get mask bit for the packets which not tied with any queues.
+
 .El
 .Sh BPF HEADER
 One of the following structures is prepended to each packet returned by
@@ -1014,6 +1054,24 @@
 	BPF_STMT(BPF_RET+BPF_K, 0),
 };
 .Ed
+.Sh MULTIQUEUE SUPPORT
+Multiqueue network interface support function provides interfaces for 
+multithreaded packet processing using bpf.
+
+Normal bpf can receive packets from specified interface, multiqueue support 
+function can receive packets from specified hardware queue.
+
+This distributes bpf workload on multiple threads, also reduces lock 
+contention on bpf.
+
+To make your program multithreaded, you'll need to open bpf descriptor on each 
+thread, enable multiqueue support by BIOCENAQMASK ioctl, and set queue mask by 
+BIOCSTRXQMASK / BIOCSTTXQMASK / BIOCSTOTHERMASK ioctls.
+
+Queue length and queue affinity information may useful to optimize setting 
+queue mask on bpf descriptor, see
+.Xr netintro 4 .
+
 .Sh SEE ALSO
 .Xr tcpdump 1 ,
 .Xr ioctl 2 ,

==== //depot/projects/soc2011/mq_bpf/src/share/man/man4/netintro.4#2 (text+ko) ====

@@ -30,7 +30,7 @@
 .\" SUCH DAMAGE.
 .\"
 .\"     @(#)netintro.4	8.2 (Berkeley) 11/30/93
-.\" $FreeBSD: src/share/man/man4/netintro.4,v 1.30 2010/10/08 12:40:16 uqs Exp $
+.\" $FreeBSD$
 .\"
 .Dd April 14, 2010
 .Dt NETINTRO 4
@@ -213,6 +213,9 @@
         int       ifru_media;
         caddr_t   ifru_data;
         int       ifru_cap[2];
+        u_int     ifru_fib;
+        int       ifru_queue_len[2];
+        int       ifru_queue_affinity[2];
     } ifr_ifru;
 #define ifr_addr      ifr_ifru.ifru_addr      /* address */
 #define ifr_dstaddr   ifr_ifru.ifru_dstaddr   /* other end of p-to-p link */
@@ -228,6 +231,11 @@
 #define ifr_reqcap    ifr_ifru.ifru_cap[0]    /* requested capabilities */
 #define ifr_curcap    ifr_ifru.ifru_cap[1]    /* current capabilities */
 #define ifr_index     ifr_ifru.ifru_index     /* interface index */
+#define	ifr_fib       ifr_ifru.ifru_fib       /* interface fib */
+#define ifr_rxqueue_len	ifr_ifru.ifru_queue_len[0] /* rxqueue len */
+#define ifr_txqueue_len	ifr_ifru.ifru_queue_len[1] /* txqueue len */
+#define ifr_queue_affinity_index ifr_ifru.ifru_queue_affinity[0] /* queue id */
+#define ifr_queue_affinity_cpu ifr_ifru.ifru_queue_affinity[1] /* cpu id */
 };
 .Ed
 .Pp
@@ -332,6 +340,12 @@
 field will contain the new interface name.
 .It Dv SIOCIFDESTROY
 Attempt to destroy the specified interface.
+.It Dv SIOCGIFQLEN
+Get interface RX/TX queue length.
+.It Dv SIOCGIFRXQAFFINITY
+Get interface RX queue affinity.
+.It Dv SIOCGIFTXQAFFINITY
+Get interface TX queue affinity.
 .El
 .Pp
 There are two requests that make use of a new structure:


More information about the p4-projects mailing list