socsvn commit: r286935 - soc2015/btw/head/sys/net

btw at FreeBSD.org btw at FreeBSD.org
Thu Jun 11 02:41:46 UTC 2015


Author: btw
Date: Thu Jun 11 02:41:45 2015
New Revision: 286935
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=286935

Log:
  Convert lo(4) to use the per-ring counters.

Modified:
  soc2015/btw/head/sys/net/if_loop.c

Modified: soc2015/btw/head/sys/net/if_loop.c
==============================================================================
--- soc2015/btw/head/sys/net/if_loop.c	Thu Jun 11 01:22:27 2015	(r286934)
+++ soc2015/btw/head/sys/net/if_loop.c	Thu Jun 11 02:41:45 2015	(r286935)
@@ -132,6 +132,7 @@
 		.ifat_drv = &lo_ifdrv,
 		.ifat_dunit = unit,
 		.ifat_mtu = LOMTU,
+		.ifat_nrings = 1,
 		.ifat_flags = IFF_LOOPBACK | IFF_MULTICAST,
 		.ifat_capabilities = IFCAP_HWCSUM | IFCAP_HWCSUM_IPV6,
 		.ifat_capenable = IFCAP_HWCSUM | IFCAP_HWCSUM_IPV6,
@@ -206,12 +207,16 @@
 {
 	u_int32_t af;
 	struct rtentry *rt = NULL;
+	ifring_t *ifrs;
 #ifdef MAC
 	int error;
 #endif
 
 	M_ASSERTPKTHDR(m); /* check if we have the packet header */
 
+	ifrs = if_getsoftc(ifp, IF_RING);
+	m->m_pkthdr.ifring = ifrs[0];
+
 	if (ro != NULL)
 		rt = ro->ro_rt;
 #ifdef MAC


More information about the svn-soc-all mailing list