diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2012-02-28 03:58:17 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2012-02-28 03:58:17 +0000 |
commit | c5b982f6c806a037c84f0b43b0537211f41aba06 (patch) | |
tree | 9b7571ffd324b8e0aedb22672729ea5d09e0c538 /sys/dev/pci | |
parent | 4890b5c1594c7c7b253e144c69171365a885158a (diff) |
- Always try to reclaim transmitted frames instead of returning
from jme_start() if IFF_OACTIVE is set before that happens; as
the original driver did before it was ported to DragonFly
- Return from jme_start() if there is no link or an empty queue.
prevents watchdog timeouts when there is no link present. from brad
Diffstat (limited to 'sys/dev/pci')
-rw-r--r-- | sys/dev/pci/if_jme.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/sys/dev/pci/if_jme.c b/sys/dev/pci/if_jme.c index ab97b09fe17..6286e777c1f 100644 --- a/sys/dev/pci/if_jme.c +++ b/sys/dev/pci/if_jme.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_jme.c,v 1.26 2012/02/08 13:16:59 jsg Exp $ */ +/* $OpenBSD: if_jme.c,v 1.27 2012/02/28 03:58:16 jsg Exp $ */ /*- * Copyright (c) 2008, Pyun YongHyeon <yongari@FreeBSD.org> * All rights reserved. @@ -1173,12 +1173,17 @@ jme_start(struct ifnet *ifp) struct mbuf *m_head; int enq = 0; - if ((ifp->if_flags & (IFF_RUNNING | IFF_OACTIVE)) != IFF_RUNNING) - return; - + /* Reclaim transmitted frames. */ if (sc->jme_cdata.jme_tx_cnt >= JME_TX_DESC_HIWAT) jme_txeof(sc); + if ((ifp->if_flags & (IFF_RUNNING | IFF_OACTIVE)) != IFF_RUNNING) + return; + if ((sc->jme_flags & JME_FLAG_LINK) == 0) + return; + if (IFQ_IS_EMPTY(&ifp->if_snd)) + return; + for (;;) { /* * Check number of available TX descs, always @@ -1250,17 +1255,14 @@ jme_watchdog(struct ifnet *ifp) if (sc->jme_cdata.jme_tx_cnt == 0) { printf("%s: watchdog timeout (missed Tx interrupts) " "-- recovering\n", sc->sc_dev.dv_xname); - if (!IFQ_IS_EMPTY(&ifp->if_snd)) - jme_start(ifp); + jme_start(ifp); return; } printf("%s: watchdog timeout\n", sc->sc_dev.dv_xname); ifp->if_oerrors++; jme_init(ifp); - - if (!IFQ_IS_EMPTY(&ifp->if_snd)) - jme_start(ifp); + jme_start(ifp); } int @@ -1465,8 +1467,7 @@ jme_intr(void *xsc) if (status & (INTR_TXQ_COAL | INTR_TXQ_COAL_TO)) { jme_txeof(sc); - if (!IFQ_IS_EMPTY(&ifp->if_snd)) - jme_start(ifp); + jme_start(ifp); } } claimed = 1; |