diff options
author | yongari <yongari@FreeBSD.org> | 2009-04-21 00:34:31 +0000 |
---|---|---|
committer | yongari <yongari@FreeBSD.org> | 2009-04-21 00:34:31 +0000 |
commit | 7364df80c217f924e7ee7caaaf2afe9fcfd18f82 (patch) | |
tree | f5d6474df9dd621aa05e8dfc6ebf58f1ccfbfc19 /sys/dev/xl/if_xl.c | |
parent | 32db8063b46cde8b3522330d56e6237da695fabf (diff) | |
download | FreeBSD-src-7364df80c217f924e7ee7caaaf2afe9fcfd18f82.zip FreeBSD-src-7364df80c217f924e7ee7caaaf2afe9fcfd18f82.tar.gz |
Clear IFF_DRV_OACTIVE flag if one of queued packets was transmitted.
Previously it used to clear the flag only when the transmit queue
is empty which may slow down Tx performance.
While I'm here check whether driver is running and whether we can
queue more packets in if_start handler. This fixes occasional
watchdog timeouts.
Reported by: xer < xernet <> hotmail dot it >
Tested by: xer < xernet <> hotmail dot it >
Diffstat (limited to 'sys/dev/xl/if_xl.c')
-rw-r--r-- | sys/dev/xl/if_xl.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/dev/xl/if_xl.c b/sys/dev/xl/if_xl.c index 239c22d..7938044 100644 --- a/sys/dev/xl/if_xl.c +++ b/sys/dev/xl/if_xl.c @@ -2097,13 +2097,13 @@ xl_txeof(struct xl_softc *sc) m_freem(cur_tx->xl_mbuf); cur_tx->xl_mbuf = NULL; ifp->if_opackets++; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; cur_tx->xl_next = sc->xl_cdata.xl_tx_free; sc->xl_cdata.xl_tx_free = cur_tx; } if (sc->xl_cdata.xl_tx_head == NULL) { - ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; sc->xl_wdog_timer = 0; sc->xl_cdata.xl_tx_tail = NULL; } else { @@ -2540,6 +2540,9 @@ xl_start_locked(struct ifnet *ifp) XL_LOCK_ASSERT(sc); + if ((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != + IFF_DRV_RUNNING) + return; /* * Check for an available queue slot. If there are none, * punt. @@ -2668,7 +2671,8 @@ xl_start_90xB_locked(struct ifnet *ifp) XL_LOCK_ASSERT(sc); - if (ifp->if_drv_flags & IFF_DRV_OACTIVE) + if ((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != + IFF_DRV_RUNNING) return; idx = sc->xl_cdata.xl_tx_prod; |