From 8222d237cba35e6c64d4e5016202e4b54d5fb93b Mon Sep 17 00:00:00 2001 From: Kip Macy Date: Thu, 14 May 2009 03:33:04 +0000 Subject: [PATCH] Call drbr_stats_update to update ifp stats directly when we bypass the buf_ring on transmit --- sys/dev/e1000/if_em.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index cf13fbbc465a..0883018c84d2 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -1006,14 +1006,17 @@ em_transmit_locked(struct ifnet *ifp, struct mbuf *m) || (!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.