Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 8 Jan 2005 00:07:46 GMT
From:      Sam Leffler <sam@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 68508 for review
Message-ID:  <200501080007.j0807kuB077731@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=68508

Change 68508 by sam@sam_ebb on 2005/01/08 00:07:04

	check if a txq generated an interrupt before processing it

Affected files ...

.. //depot/projects/wifi/sys/dev/ath/if_ath.c#60 edit
.. //depot/projects/wifi/sys/dev/ath/if_athvar.h#24 edit

Differences ...

==== //depot/projects/wifi/sys/dev/ath/if_ath.c#60 (text+ko) ====

@@ -3464,6 +3464,14 @@
 	}
 }
 
+static __inline int
+txqactive(struct ath_hal *ah, int qnum)
+{
+	u_int32_t txqs = 1<<qnum;
+	ath_hal_gettxintrtxqs(ah, &txqs);
+	return (txqs & (1<<qnum));
+}
+
 /*
  * Deferred processing of transmit interrupt; special-cased
  * for a single hardware transmit queue (e.g. 5210 and 5211).
@@ -3474,8 +3482,10 @@
 	struct ath_softc *sc = arg;
 	struct ifnet *ifp = &sc->sc_if;
 
-	ath_tx_processq(sc, &sc->sc_txq[0]);
-	ath_tx_processq(sc, sc->sc_cabq);
+	if (txqactive(sc->sc_ah, 0))
+		ath_tx_processq(sc, &sc->sc_txq[0]);
+	if (txqactive(sc->sc_ah, sc->sc_cabq->axq_qnum))
+		ath_tx_processq(sc, sc->sc_cabq);
 	ifp->if_flags &= ~IFF_OACTIVE;
 	sc->sc_tx_timer = 0;
 
@@ -3498,11 +3508,16 @@
 	/*
 	 * Process each active queue.
 	 */
-	ath_tx_processq(sc, &sc->sc_txq[0]);
-	ath_tx_processq(sc, &sc->sc_txq[1]);
-	ath_tx_processq(sc, &sc->sc_txq[2]);
-	ath_tx_processq(sc, &sc->sc_txq[3]);
-	ath_tx_processq(sc, sc->sc_cabq);
+	if (txqactive(sc->sc_ah, 0))
+		ath_tx_processq(sc, &sc->sc_txq[0]);
+	if (txqactive(sc->sc_ah, 1))
+		ath_tx_processq(sc, &sc->sc_txq[1]);
+	if (txqactive(sc->sc_ah, 2))
+		ath_tx_processq(sc, &sc->sc_txq[2]);
+	if (txqactive(sc->sc_ah, 3))
+		ath_tx_processq(sc, &sc->sc_txq[3]);
+	if (txqactive(sc->sc_ah, sc->sc_cabq->axq_qnum))
+		ath_tx_processq(sc, sc->sc_cabq);
 
 	ifp->if_flags &= ~IFF_OACTIVE;
 	sc->sc_tx_timer = 0;
@@ -3526,9 +3541,8 @@
 	/*
 	 * Process each active queue.
 	 */
-	/* XXX faster to read ISR_S0_S and ISR_S1_S to determine q's? */
 	for (i = 0; i < HAL_NUM_TX_QUEUES; i++)
-		if (ATH_TXQ_SETUP(sc, i))
+		if (ATH_TXQ_SETUP(sc, i) && qactive(sc->sc_ah, i))
 			ath_tx_processq(sc, &sc->sc_txq[i]);
 
 	ifp->if_flags &= ~IFF_OACTIVE;

==== //depot/projects/wifi/sys/dev/ath/if_athvar.h#24 (text+ko) ====

@@ -481,6 +481,8 @@
 	((*(_ah)->ah_fillTxDesc)((_ah), (_ds), (_l), (_first), (_last), (_ds0)))
 #define	ath_hal_txprocdesc(_ah, _ds) \
 	((*(_ah)->ah_procTxDesc)((_ah), (_ds)))
+#define	ath_hal_gettxintrtxqs(_ah, _txqs) \
+	((*(_ah)->ah_getTxIntrQueue)((_ah), (_txqs)))
 #define	ath_hal_updateCTSForBursting(_ah, _ds, _prevds, _prevdsWithCTS, \
 		_gatingds,  _txOpLimit, _ctsDuration) \
 	((*(_ah)->ah_updateCTSForBursting)((_ah), (_ds), (_prevds), \



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200501080007.j0807kuB077731>