svn commit: r325981 - head/sys/arm/allwinner

Emmanuel Vadot manu at FreeBSD.org
Sat Nov 18 20:55:39 UTC 2017


Author: manu
Date: Sat Nov 18 20:55:37 2017
New Revision: 325981
URL: https://svnweb.freebsd.org/changeset/base/325981

Log:
  if_awg: replace multiple calls to if_setdrvflagbits with one call in awg_txintr
  
  Small optimization
  
  Submitted by:	Guy Yur <guyyur at gmail.com>
  Differential Revision:	https://reviews.freebsd.org/D13033

Modified:
  head/sys/arm/allwinner/if_awg.c

Modified: head/sys/arm/allwinner/if_awg.c
==============================================================================
--- head/sys/arm/allwinner/if_awg.c	Sat Nov 18 20:50:31 2017	(r325980)
+++ head/sys/arm/allwinner/if_awg.c	Sat Nov 18 20:55:37 2017	(r325981)
@@ -916,7 +916,7 @@ awg_txintr(struct awg_softc *sc)
 	struct emac_desc *desc;
 	uint32_t status, size;
 	if_t ifp;
-	int i;
+	int i, prog;
 
 	AWG_ASSERT_LOCKED(sc);
 
@@ -924,6 +924,8 @@ awg_txintr(struct awg_softc *sc)
 	    BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE);
 
 	ifp = sc->ifp;
+
+	prog = 0;
 	for (i = sc->tx.next; sc->tx.queued > 0; i = TX_NEXT(i)) {
 		desc = &sc->tx.desc_ring[i];
 		status = le32toh(desc->status);
@@ -936,11 +938,14 @@ awg_txintr(struct awg_softc *sc)
 			else
 				if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1);
 		}
+		prog++;
 		awg_clean_txbuf(sc, i);
-		if_setdrvflagbits(ifp, 0, IFF_DRV_OACTIVE);
 	}
 
-	sc->tx.next = i;
+	if (prog > 0) {
+		sc->tx.next = i;
+		if_setdrvflagbits(ifp, 0, IFF_DRV_OACTIVE);
+	}
 }
 
 static void


More information about the svn-src-head mailing list