[rtems-libbsd commit] if_dwc: Fix transmit starvation

Sebastian Huber sebh at rtems.org
Wed Apr 1 07:16:38 UTC 2015


Module:    rtems-libbsd
Branch:    master
Commit:    dd1feda161ce70881cb9c1f90f4ef694d7f41a9f
Changeset: http://git.rtems.org/rtems-libbsd/commit/?id=dd1feda161ce70881cb9c1f90f4ef694d7f41a9f

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Mon Mar 30 09:51:18 2015 +0200

if_dwc: Fix transmit starvation

---

 freebsd/sys/dev/dwc/if_dwc.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/freebsd/sys/dev/dwc/if_dwc.c b/freebsd/sys/dev/dwc/if_dwc.c
index 33240ea..863816d 100644
--- a/freebsd/sys/dev/dwc/if_dwc.c
+++ b/freebsd/sys/dev/dwc/if_dwc.c
@@ -321,10 +321,6 @@ dwc_txstart_locked(struct dwc_softc *sc)
 
 	ifp = sc->ifp;
 
-	if (ifp->if_drv_flags & IFF_DRV_OACTIVE) {
-		return;
-	}
-
 	enqueued = 0;
 
 	for (;;) {
@@ -357,7 +353,8 @@ dwc_txstart(struct ifnet *ifp)
 	struct dwc_softc *sc = ifp->if_softc;
 
 	DWC_LOCK(sc);
-	dwc_txstart_locked(sc);
+	if ((ifp->if_drv_flags & IFF_DRV_OACTIVE) == 0)
+		dwc_txstart_locked(sc);
 	DWC_UNLOCK(sc);
 }
 
@@ -824,6 +821,9 @@ dwc_txfinish_locked(struct dwc_softc *sc)
 		sc->tx_idx_tail = next_txidx(sc, sc->tx_idx_tail);
 	}
 
+	sc->ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
+	dwc_txstart_locked(sc);
+
 	/* If there are no buffers outstanding, muzzle the watchdog. */
 	if (sc->tx_idx_tail == sc->tx_idx_head) {
 		sc->tx_watchdog_count = 0;



More information about the vc mailing list