svn commit: r192081 - head/sys/dev/e1000

Kip Macy kmacy at FreeBSD.org
Thu May 14 03:33:05 UTC 2009


Author: kmacy
Date: Thu May 14 03:33:04 2009
New Revision: 192081
URL: http://svn.freebsd.org/changeset/base/192081

Log:
  Call drbr_stats_update to update ifp stats directly when we bypass the buf_ring on transmit

Modified:
  head/sys/dev/e1000/if_em.c

Modified: head/sys/dev/e1000/if_em.c
==============================================================================
--- head/sys/dev/e1000/if_em.c	Thu May 14 03:24:22 2009	(r192080)
+++ head/sys/dev/e1000/if_em.c	Thu May 14 03:33:04 2009	(r192081)
@@ -1006,15 +1006,18 @@ em_transmit_locked(struct ifnet *ifp, st
 	    || (!adapter->link_active)) {
 		error = drbr_enqueue(ifp, adapter->br, m);
 		return (error);
-	}
-	
-	if (ADAPTER_RING_EMPTY(adapter) &&
+	} else if (ADAPTER_RING_EMPTY(adapter) &&
 	    (adapter->num_tx_desc_avail > EM_TX_OP_THRESHOLD)) {
 		if (em_xmit(adapter, &m)) {
 			if (m && (error = drbr_enqueue(ifp, adapter->br, m)) != 0)
 				return (error);
 		} else {
 			/*
+			 * We've bypassed the buf ring so we need to update
+			 * ifp directly
+			 */
+			drbr_stats_update(ifp, m->m_pkthdr.len, m->m_flags);
+			/*
 			** Send a copy of the frame to the BPF
 			** listener and set the watchdog on.
 			*/


More information about the svn-src-all mailing list