summaryrefslogtreecommitdiffstats
path: root/sys/dev/bge
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2004-10-30 22:59:30 +0000
committerdes <des@FreeBSD.org>2004-10-30 22:59:30 +0000
commitbfa67dd1480efe8289be522e9b8b035813a287df (patch)
tree42e707d3b579dd491586a1a2253444f89464c455 /sys/dev/bge
parent89f395d896ceccba3f8a9426540f97e195060e17 (diff)
downloadFreeBSD-src-bfa67dd1480efe8289be522e9b8b035813a287df.zip
FreeBSD-src-bfa67dd1480efe8289be522e9b8b035813a287df.tar.gz
With ALTQ, it is possible that although the queue was not empty when we
entered the interface start function, no packets were actually dequeued. Therefore, keep a count of how many packets we really added onto the tx chain, and initiate a transmit only if the count is non-zero.
Diffstat (limited to 'sys/dev/bge')
-rw-r--r--sys/dev/bge/if_bge.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/dev/bge/if_bge.c b/sys/dev/bge/if_bge.c
index f596bf8..46e477e 100644
--- a/sys/dev/bge/if_bge.c
+++ b/sys/dev/bge/if_bge.c
@@ -3201,6 +3201,7 @@ bge_start_locked(ifp)
struct bge_softc *sc;
struct mbuf *m_head = NULL;
u_int32_t prodidx = 0;
+ int count = 0;
sc = ifp->if_softc;
@@ -3247,6 +3248,7 @@ bge_start_locked(ifp)
ifp->if_flags |= IFF_OACTIVE;
break;
}
+ ++count;
/*
* If there's a BPF listener, bounce a copy of this frame
@@ -3255,6 +3257,11 @@ bge_start_locked(ifp)
BPF_MTAP(ifp, m_head);
}
+ if (count == 0) {
+ /* no packets were dequeued */
+ return;
+ }
+
/* Transmit */
CSR_WRITE_4(sc, BGE_MBX_TX_HOST_PROD0_LO, prodidx);
/* 5700 b2 errata */
OpenPOWER on IntegriCloud