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.
This commit is contained in:
des 2004-10-30 22:59:30 +00:00
parent 89f395d896
commit bfa67dd148

View File

@ -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 */