From: dlg Date: Tue, 19 Aug 2014 11:13:16 +0000 (+0000) Subject: in myx_start, replace X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=8aa24c3ba2e77c27de725e550b7b6362c8677b51;p=openbsd in myx_start, replace while (space) { IFQ_POLL; myx_dequeue(free descr); IFQ_DEQUEUE; etc; } with while (space && myx_dequeue(free descr)) { IFQ_DEQUEUE; etc; } --- diff --git a/sys/dev/pci/if_myx.c b/sys/dev/pci/if_myx.c index b326c41c4f8..8d1ce665256 100644 --- a/sys/dev/pci/if_myx.c +++ b/sys/dev/pci/if_myx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_myx.c,v 1.62 2014/08/18 05:11:03 dlg Exp $ */ +/* $OpenBSD: if_myx.c,v 1.63 2014/08/19 11:13:16 dlg Exp $ */ /* * Copyright (c) 2007 Reyk Floeter @@ -1511,27 +1511,23 @@ myx_start(struct ifnet *ifp) return; for (;;) { - if (sc->sc_tx_free <= sc->sc_tx_nsegs) { + if (sc->sc_tx_free <= sc->sc_tx_nsegs || + (mb = myx_buf_get(&sc->sc_tx_buf_free)) == NULL) { SET(ifp->if_flags, IFF_OACTIVE); break; } - IFQ_POLL(&ifp->if_snd, m); - if (m == NULL) - break; - - mb = myx_buf_get(&sc->sc_tx_buf_free); - if (mb == NULL) { - SET(ifp->if_flags, IFF_OACTIVE); + IFQ_DEQUEUE(&ifp->if_snd, m); + if (m == NULL) { + myx_buf_put(&sc->sc_tx_buf_free, mb); break; } - IFQ_DEQUEUE(&ifp->if_snd, m); if (myx_load_buf(sc, mb, m) != 0) { m_freem(m); myx_buf_put(&sc->sc_tx_buf_free, mb); ifp->if_oerrors++; - break; + continue; } #if NBPFILTER > 0