socsvn commit: r289992 - soc2015/btw/head/share/man/man9
btw at FreeBSD.org
btw at FreeBSD.org
Fri Aug 21 01:02:28 UTC 2015
Author: btw
Date: Fri Aug 21 01:02:27 2015
New Revision: 289992
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=289992
Log:
Extend ifnet(9) to describe the ifring structure and related stuffs.
Modified:
soc2015/btw/head/share/man/man9/ifnet.9
Modified: soc2015/btw/head/share/man/man9/ifnet.9
==============================================================================
--- soc2015/btw/head/share/man/man9/ifnet.9 Thu Aug 20 22:44:26 2015 (r289991)
+++ soc2015/btw/head/share/man/man9/ifnet.9 Fri Aug 21 01:02:27 2015 (r289992)
@@ -28,7 +28,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd July 29, 2014
+.Dd August 19, 2015
.Dt IFNET 9
.Os
.Sh NAME
@@ -133,7 +133,7 @@
.Sh DATA STRUCTURES
The kernel mechanisms for handling network interfaces reside primarily
in the
-.Vt ifnet , if_data , ifaddr ,
+.Vt ifnet , if_data , ifaddr , ifring ,
and
.Vt ifmultiaddr
structures in
@@ -155,7 +155,7 @@
The header file
.In net/if_var.h
defines the kernel-internal interfaces, including the
-.Vt ifnet , ifaddr ,
+.Vt ifnet , ifaddr , ifring ,
and
.Vt ifmultiaddr
structures and the functions which manipulate them.
@@ -181,7 +181,10 @@
Each interface structure
contains an
.Vt if_data
-structure used for statistics and information.
+structure used for statistics and information,
+and an array of
+.Vt ifring
+structures used for per-ring statistics.
Each interface also has a
.Li TAILQ
of interface addresses, described by
@@ -440,6 +443,15 @@
but unlike
.Va if_type ,
it would not be changed by drivers.
+.It Va if_rings
+.Pq Vt "struct ifring **"
+A pointer to the array of rings, which contains the per-ring statistics.
+(Initialized by
+.Fn if_attach . )
+.It Va if_nrings
+.Pq Vt int
+The number of elements in
+.Va if_rings .
.El
.Pp
References to
@@ -1111,6 +1123,72 @@
argument is the route in question; the
.Fa info
argument contains the specific destination being manipulated.
+.Ss The Vt ifring Ss Structure
+Every interface is associated with an array of rings pointed by the
+interface structure's
+.Va if_rings
+member.
+And the number of elements is indicated by the
+.Va if_nrings
+member.
+The elements of this array consist of
+.Vt ifring
+structures.
+The
+.Vt ifring
+structure contains the per-ring statistics, and which is exported to
+user programs by way of the
+.Xr ifmib 4
+branch of the
+.Xr sysctl 3
+MIB.
+.Pp
+The members of
+.Vt "struct ifring"
+are as follows:
+.Bl -tag -width ".Va ifr_stats" -offset indent
+.It Va "ifr_stats"
+.Pq Vt "struct ifrstat[MAXCPU]"
+The per-cpu statistics of the ring.
+.El
+.Pp
+The
+.Vt "ifrstat"
+structure is defined in
+.In net/if_var.h .
+The members of
+.Vt "struct ifrstat"
+are as follows:
+.Bl -tag -width ".Va ifrs_ifinput" -offset indent
+.It Va "ifrs_ifinput"
+.Pq Vt "uint64_t"
+The number of packets received on the corresponding ring and processed
+on the corresponding CPU in the driver.
+.It Va "ifrs_netisr"
+.Pq Vt "uint64_t"
+The number of packets received on the corresponding ring and processed
+on the corresponding CPU in the netisr layer.
+.It Va "ifrs_ether"
+.Pq Vt "uint64_t"
+The number of packets received on the corresponding ring and processed
+on the corresponding CPU in the ethernet layer.
+.It Va "ifrs_ip"
+.Pq Vt "uint64_t"
+The number of packets received on the corresponding ring and processed
+on the corresponding CPU in the IP (version 4) layer.
+.It Va "ifrs_ip6"
+.Pq Vt "uint64_t"
+The number of packets received on the corresponding ring and processed
+on the corresponding CPU in the IP (version 6) layer.
+.It Va "ifrs_tcp"
+.Pq Vt "uint64_t"
+The number of packets received on the corresponding ring and processed
+on the corresponding CPU in the TCP layer.
+.It Va "ifrs_udp"
+.Pq Vt "uint64_t"
+The number of packets received on the corresponding ring and processed
+on the corresponding CPU in the UDP layer.
+.El
.Sh FUNCTIONS
The functions provided by the generic interface code can be divided
into two groups: those which manipulate interfaces, and those which
@@ -1172,7 +1250,7 @@
(A pointer to
this address structure is saved in the
.Vt ifnet
-structure and shall be accessed by the
+structure and is accessed by the
.Fn ifaddr_byindex
function.)
The
More information about the svn-soc-all
mailing list