socsvn commit: r286764 - soc2015/btw/head/sys/dev/re

btw at FreeBSD.org btw at FreeBSD.org
Sun Jun 7 03:25:28 UTC 2015


Author: btw
Date: Sun Jun  7 03:25:26 2015
New Revision: 286764
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=286764

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

Modified:
  soc2015/btw/head/sys/dev/re/if_re.c

Modified: soc2015/btw/head/sys/dev/re/if_re.c
==============================================================================
--- soc2015/btw/head/sys/dev/re/if_re.c	Sat Jun  6 22:03:24 2015	(r286763)
+++ soc2015/btw/head/sys/dev/re/if_re.c	Sun Jun  7 03:25:26 2015	(r286764)
@@ -1230,6 +1230,7 @@
 		.ifat_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST,
 		.ifat_capabilities = IFCAP_LINKSTATE,
 		.ifat_mediamask = MII_MEDIA_MASK,
+		.ifat_nrings = 1,
 	};
 	u_char			eaddr[ETHER_ADDR_LEN];
 	u_int16_t		as[ETHER_ADDR_LEN / 2];
@@ -2152,6 +2153,7 @@
 {
 	struct mbuf		*m;
 	if_t			ifp;
+	ifring_t		*ifrs, ifr;
 	int			i, rxerr, total_len;
 	struct rl_desc		*cur_rx;
 	u_int32_t		rxstat, rxvlan;
@@ -2160,6 +2162,8 @@
 	RL_LOCK_ASSERT(sc);
 
 	ifp = sc->rl_ifp;
+	ifrs = if_getsoftc(ifp, IF_RING);
+	ifr = ifrs[0];
 #ifdef DEV_NETMAP
 	if (netmap_rx_irq(ifp, 0, &rx_npkts))
 		return 0;
@@ -2321,6 +2325,7 @@
 		if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1);
 		if_inc_counter(ifp, IFCOUNTER_IBYTES, m->m_pkthdr.len);
 		m->m_pkthdr.rcvif = ifp;
+		m->m_pkthdr.ifring = ifr;
 
 		/* Do RX checksumming if enabled */
 


More information about the svn-soc-all mailing list