Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 11 Dec 2012 04:19:51 +0000 (UTC)
From:      Adrian Chadd <adrian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r244109 - head/sys/dev/ath
Message-ID:  <201212110419.qBB4JpfZ094171@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: adrian
Date: Tue Dec 11 04:19:51 2012
New Revision: 244109
URL: http://svnweb.freebsd.org/changeset/base/244109

Log:
  There's no need to use a TXQ pointer here; we specifically need the
  hardware queue ID when queuing to EDMA descriptors.
  
  This is a small part of trying to reduce the size of ath_buf entries.

Modified:
  head/sys/dev/ath/if_ath_tx.c
  head/sys/dev/ath/if_athvar.h

Modified: head/sys/dev/ath/if_ath_tx.c
==============================================================================
--- head/sys/dev/ath/if_ath_tx.c	Tue Dec 11 02:40:01 2012	(r244108)
+++ head/sys/dev/ath/if_ath_tx.c	Tue Dec 11 04:19:51 2012	(r244109)
@@ -372,7 +372,6 @@ ath_tx_chaindesclist(struct ath_softc *s
 	uint32_t segLenList[4];
 	int numTxMaps = 1;
 	int isFirstDesc = 1;
-	int qnum;
 
 	/*
 	 * XXX There's txdma and txdma_mgmt; the descriptor
@@ -426,18 +425,16 @@ ath_tx_chaindesclist(struct ath_softc *s
 			    bf->bf_daddr + dd->dd_descsize * (dsp + 1));
 
 		/*
-		 * XXX this assumes that bfs_txq is the actual destination
-		 * hardware queue at this point.  It may not have been assigned,
-		 * it may actually be pointing to the multicast software
-		 * TXQ id.  These must be fixed!
+		 * XXX This assumes that bfs_txq is the actual destination
+		 * hardware queue at this point.  It may not have been
+		 * assigned, it may actually be pointing to the multicast
+		 * software TXQ id.  These must be fixed!
 		 */
-		qnum = bf->bf_state.bfs_txq->axq_qnum;
-
 		ath_hal_filltxdesc(ah, (struct ath_desc *) ds
 			, bufAddrList
 			, segLenList
 			, bf->bf_descid		/* XXX desc id */
-			, qnum
+			, bf->bf_state.bfs_tx_queue
 			, isFirstDesc		/* first segment */
 			, i == bf->bf_nseg - 1	/* last segment */
 			, (struct ath_desc *) ds0	/* first descriptor */
@@ -478,7 +475,8 @@ ath_tx_chaindesclist(struct ath_softc *s
 		isFirstDesc = 0;
 #ifdef	ATH_DEBUG
 		if (sc->sc_debug & ATH_DEBUG_XMIT)
-			ath_printtxbuf(sc, bf, qnum, 0, 0);
+			ath_printtxbuf(sc, bf, bf->bf_state.bfs_tx_queue,
+			    0, 0);
 #endif
 		bf->bf_lastds = (struct ath_desc *) ds;
 
@@ -697,11 +695,11 @@ ath_tx_setds_11n(struct ath_softc *sc, s
  * during the beacon setup code.
  *
  * XXX TODO: since the AR9300 EDMA TX queue support wants the QCU ID
- * as part of the TX descriptor, bf_state.bfs_txq must be updated
+ * as part of the TX descriptor, bf_state.bfs_tx_queue must be updated
  * with the actual hardware txq, or all of this will fall apart.
  *
  * XXX It may not be a bad idea to just stuff the QCU ID into bf_state
- * and retire bfs_txq; then make sure the CABQ QCU ID is populated
+ * and retire bfs_tx_queue; then make sure the CABQ QCU ID is populated
  * correctly.
  */
 static void
@@ -1840,7 +1838,7 @@ ath_tx_start(struct ath_softc *sc, struc
 
 	/* Set local packet state, used to queue packets to hardware */
 	bf->bf_state.bfs_tid = tid;
-	bf->bf_state.bfs_txq = txq;
+	bf->bf_state.bfs_tx_queue = txq->axq_qnum;
 	bf->bf_state.bfs_pri = pri;
 
 	/*
@@ -1858,7 +1856,7 @@ ath_tx_start(struct ath_softc *sc, struc
 		 * queue, so the descriptor setup functions will
 		 * correctly initialise the descriptor 'qcuId' field.
 		 */
-		bf->bf_state.bfs_txq = sc->sc_cabq;
+		bf->bf_state.bfs_tx_queue = sc->sc_cabq->axq_qnum;
 	}
 
 	/* Do the generic frame setup */
@@ -2114,7 +2112,7 @@ ath_tx_raw_start(struct ath_softc *sc, s
 
 	/* Set local packet state, used to queue packets to hardware */
 	bf->bf_state.bfs_tid = WME_AC_TO_TID(pri);
-	bf->bf_state.bfs_txq = sc->sc_ac2q[pri];
+	bf->bf_state.bfs_tx_queue = sc->sc_ac2q[pri]->axq_qnum;
 	bf->bf_state.bfs_pri = pri;
 
 	/* XXX this should be done in ath_tx_setrate() */
@@ -2713,16 +2711,8 @@ ath_tx_xmit_aggr(struct ath_softc *sc, s
     struct ath_txq *txq, struct ath_buf *bf)
 {
 	struct ath_tid *tid = &an->an_tid[bf->bf_state.bfs_tid];
-//	struct ath_txq *txq = bf->bf_state.bfs_txq;
 	struct ieee80211_tx_ampdu *tap;
 
-	if (txq != bf->bf_state.bfs_txq) {
-		device_printf(sc->sc_dev, "%s: txq %d != bfs_txq %d!\n",
-		    __func__,
-		    txq->axq_qnum,
-		    bf->bf_state.bfs_txq->axq_qnum);
-	}
-
 	ATH_TX_LOCK_ASSERT(sc);
 
 	tap = ath_tx_get_tx_tid(an, tid->tid);
@@ -2821,9 +2811,8 @@ ath_tx_swq(struct ath_softc *sc, struct 
 
 	/* Set local packet state, used to queue packets to hardware */
 	/* XXX potentially duplicate info, re-check */
-	/* XXX remember, txq must be the hardware queue, not the av_mcastq */
 	bf->bf_state.bfs_tid = tid;
-	bf->bf_state.bfs_txq = txq;
+	bf->bf_state.bfs_tx_queue = txq->axq_qnum;
 	bf->bf_state.bfs_pri = pri;
 
 	/*
@@ -4869,8 +4858,6 @@ ath_tx_tid_hw_queue_aggr(struct ath_soft
 
 		}
 	queuepkt:
-		//txq = bf->bf_state.bfs_txq;
-
 		/* Set completion handler, multi-frame aggregate or not */
 		bf->bf_comp = ath_tx_aggr_comp;
 
@@ -4936,8 +4923,6 @@ ath_tx_tid_hw_queue_norm(struct ath_soft
 
 		ATH_TID_REMOVE(tid, bf, bf_list);
 
-		KASSERT(txq == bf->bf_state.bfs_txq, ("txqs not equal!\n"));
-
 		/* Sanity check! */
 		if (tid->tid != bf->bf_state.bfs_tid) {
 			device_printf(sc->sc_dev, "%s: bfs_tid %d !="

Modified: head/sys/dev/ath/if_athvar.h
==============================================================================
--- head/sys/dev/ath/if_athvar.h	Tue Dec 11 02:40:01 2012	(r244108)
+++ head/sys/dev/ath/if_athvar.h	Tue Dec 11 04:19:51 2012	(r244109)
@@ -241,8 +241,7 @@ struct ath_buf {
 		uint8_t bfs_tid;	/* packet TID (or TID_MAX for no QoS) */
 		uint8_t bfs_nframes;	/* number of frames in aggregate */
 		uint8_t bfs_pri;	/* packet AC priority */
-
-		struct ath_txq *bfs_txq;	/* eventual dest hardware TXQ */
+		uint8_t bfs_tx_queue;	/* destination hardware TX queue */
 
 		u_int32_t bfs_aggr:1,		/* part of aggregate? */
 		    bfs_aggrburst:1,	/* part of aggregate burst? */



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