svn commit: r225056 - user/adrian/if_ath_tx/sys/dev/ath

Adrian Chadd adrian at FreeBSD.org
Sun Aug 21 10:05:40 UTC 2011


Author: adrian
Date: Sun Aug 21 10:05:39 2011
New Revision: 225056
URL: http://svn.freebsd.org/changeset/base/225056

Log:
  * Fix a duplicate call to the TX scheduling task queue function;
    this doesn't improve network throughput but it decreases CPU
    usage.
  
  * Add a reference to the softc from the hardware txq; this was
    intended to be used by a per-txq task scheduler function;
    I may end up removing this later on.
  
  * add a txq field to ath_tx_sched_proc_sched(), but as
    taskqueue_enable doesn't take an argument, we can't
    use it just yet. Again, the current way of kicking the
    TXQ scheduler code may not be the best way to do it -
    ie, calling taskqueue_enable() on every single TX'ed packet
    is likely not helping ;-)

Modified:
  user/adrian/if_ath_tx/sys/dev/ath/if_ath.c
  user/adrian/if_ath_tx/sys/dev/ath/if_ath_misc.h
  user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c
  user/adrian/if_ath_tx/sys/dev/ath/if_athvar.h

Modified: user/adrian/if_ath_tx/sys/dev/ath/if_ath.c
==============================================================================
--- user/adrian/if_ath_tx/sys/dev/ath/if_ath.c	Sun Aug 21 03:48:07 2011	(r225055)
+++ user/adrian/if_ath_tx/sys/dev/ath/if_ath.c	Sun Aug 21 10:05:39 2011	(r225056)
@@ -3899,6 +3899,7 @@ ath_txq_init(struct ath_softc *sc, struc
 	txq->axq_depth = 0;
 	txq->axq_intrcnt = 0;
 	txq->axq_link = NULL;
+	txq->axq_softc = sc;
 	TAILQ_INIT(&txq->axq_q);
 	TAILQ_INIT(&txq->axq_tidq);
 	ATH_TXQ_LOCK_INIT(sc, txq);
@@ -4428,7 +4429,7 @@ ath_tx_sched_proc(void *arg, int npendin
  * Schedule a TXQ scheduling task to occur.
  */
 void
-ath_tx_sched_proc_sched(struct ath_softc *sc)
+ath_tx_sched_proc_sched(struct ath_softc *sc, struct ath_txq *txq)
 {
 	taskqueue_enqueue(sc->sc_tq, &sc->sc_txschedtask);
 }

Modified: user/adrian/if_ath_tx/sys/dev/ath/if_ath_misc.h
==============================================================================
--- user/adrian/if_ath_tx/sys/dev/ath/if_ath_misc.h	Sun Aug 21 03:48:07 2011	(r225055)
+++ user/adrian/if_ath_tx/sys/dev/ath/if_ath_misc.h	Sun Aug 21 10:05:39 2011	(r225056)
@@ -59,6 +59,6 @@ extern void ath_tx_default_comp(struct a
 	    int fail);
 extern void ath_tx_freebuf(struct ath_softc *sc, struct ath_buf *bf,
     int status);
-extern void ath_tx_sched_proc_sched(struct ath_softc *sc);
+extern void ath_tx_sched_proc_sched(struct ath_softc *sc, struct ath_txq *txq);
 
 #endif

Modified: user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c
==============================================================================
--- user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c	Sun Aug 21 03:48:07 2011	(r225055)
+++ user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c	Sun Aug 21 10:05:39 2011	(r225056)
@@ -1329,7 +1329,7 @@ ath_tx_start(struct ath_softc *sc, struc
 		ath_tx_swq(sc, ni, txq, bf);
 
 		/* Schedule a TX scheduler task call to occur */
-		ath_tx_sched_proc_sched(sc);
+		ath_tx_sched_proc_sched(sc, txq);
 	}
 #else
 	/*
@@ -1554,6 +1554,9 @@ ath_tx_raw_start(struct ath_softc *sc, s
 	else {
 		/* Queue to software queue */
 		ath_tx_swq(sc, ni, sc->sc_ac2q[pri], bf);
+
+		/* Schedule a TX scheduler task call to occur */
+		ath_tx_sched_proc_sched(sc, sc->sc_ac2q[pri]);
 	}
 
 	return 0;
@@ -1616,14 +1619,6 @@ ath_raw_xmit(struct ieee80211_node *ni, 
 	ifp->if_opackets++;
 	sc->sc_stats.ast_tx_raw++;
 
-	/*
-	 * This kicks off a TX packet scheduler task,
-	 * pushing packet scheduling out of this thread
-	 * and into a separate context. This will (hopefully)
-	 * simplify locking/contention in the long run.
-	 */
-	ath_tx_sched_proc_sched(sc);
-
 	return 0;
 bad2:
 	ATH_TXBUF_LOCK(sc);
@@ -2062,7 +2057,7 @@ ath_tx_tid_resume(struct ath_softc *sc, 
 	ath_tx_tid_sched(sc, tid->an, tid->tid);
 	ATH_TXQ_UNLOCK(txq);
 
-	ath_tx_sched_proc_sched(sc);
+	ath_tx_sched_proc_sched(sc, txq);
 }
 
 /*

Modified: user/adrian/if_ath_tx/sys/dev/ath/if_athvar.h
==============================================================================
--- user/adrian/if_ath_tx/sys/dev/ath/if_athvar.h	Sun Aug 21 03:48:07 2011	(r225055)
+++ user/adrian/if_ath_tx/sys/dev/ath/if_athvar.h	Sun Aug 21 10:05:39 2011	(r225056)
@@ -263,6 +263,7 @@ struct ath_descdma {
  * hardware queue).
  */
 struct ath_txq {
+	struct ath_softc	*axq_softc;	/* Needed for scheduling */
 	u_int			axq_qnum;	/* hardware q number */
 #define	ATH_TXQ_SWQ	(HAL_NUM_TX_QUEUES+1)	/* qnum for s/w only queue */
 	u_int			axq_ac;		/* WME AC */


More information about the svn-src-user mailing list