summaryrefslogtreecommitdiffstats
path: root/sys/dev/e1000
diff options
context:
space:
mode:
authorjfv <jfv@FreeBSD.org>2009-04-27 17:36:41 +0000
committerjfv <jfv@FreeBSD.org>2009-04-27 17:36:41 +0000
commit02ba5a63875ab84f75dd14cf7d08da97abfc61ef (patch)
treeafb646960b7cb0a0a3070612e60250a01051d0d5 /sys/dev/e1000
parent3c49b58ce468aab699bcef9841ddfc8072bd5c12 (diff)
downloadFreeBSD-src-02ba5a63875ab84f75dd14cf7d08da97abfc61ef.zip
FreeBSD-src-02ba5a63875ab84f75dd14cf7d08da97abfc61ef.tar.gz
igb_txeof also has a case where the watchdog may not
get reset when it should be MFC after: 2 weeks
Diffstat (limited to 'sys/dev/e1000')
-rw-r--r--sys/dev/e1000/if_igb.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/sys/dev/e1000/if_igb.c b/sys/dev/e1000/if_igb.c
index 706dc5b..96314fa 100644
--- a/sys/dev/e1000/if_igb.c
+++ b/sys/dev/e1000/if_igb.c
@@ -3308,6 +3308,7 @@ igb_txeof(struct tx_ring *txr)
{
struct adapter *adapter = txr->adapter;
int first, last, done, num_avail;
+ u32 cleaned = 0;
struct igb_tx_buffer *tx_buffer;
struct e1000_tx_desc *tx_desc, *eop_desc;
struct ifnet *ifp = adapter->ifp;
@@ -3343,7 +3344,7 @@ igb_txeof(struct tx_ring *txr)
tx_desc->upper.data = 0;
tx_desc->lower.data = 0;
tx_desc->buffer_addr = 0;
- num_avail++;
+ ++num_avail; ++cleaned;
if (tx_buffer->m_head) {
ifp->if_opackets++;
@@ -3380,23 +3381,21 @@ igb_txeof(struct tx_ring *txr)
txr->next_to_clean = first;
/*
- * If we have enough room, clear IFF_DRV_OACTIVE to tell the stack
- * that it is OK to send packets.
- * If there are no pending descriptors, clear the timeout. Otherwise,
- * if some descriptors have been freed, restart the timeout.
+ * If we have enough room, clear IFF_DRV_OACTIVE to
+ * tell the stack that it is OK to send packets.
+ * If there are no pending descriptors, clear the timeout.
*/
if (num_avail > IGB_TX_CLEANUP_THRESHOLD) {
ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
- /* All clean, turn off the timer */
if (num_avail == adapter->num_tx_desc) {
txr->watchdog_timer = 0;
txr->tx_avail = num_avail;
return FALSE;
}
- /* Some cleaned, reset the timer */
- else if (num_avail != txr->tx_avail)
- txr->watchdog_timer = IGB_TX_TIMEOUT;
}
+ /* Some descriptors cleaned, reset the watchdog */
+ if (cleaned)
+ txr->watchdog_timer = IGB_TX_TIMEOUT;
txr->tx_avail = num_avail;
return TRUE;
}
OpenPOWER on IntegriCloud