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

Adrian Chadd adrian at FreeBSD.org
Fri Aug 19 06:33:41 UTC 2011


Author: adrian
Date: Fri Aug 19 06:33:40 2011
New Revision: 224995
URL: http://svn.freebsd.org/changeset/base/224995

Log:
  * Disable BAR sending for now, I'm still not entirely convinced that
    it's all setup correctly and the right BAW left edge value is being
    sent (ie, I think I need to add some locking to ensure that new values
    aren't allocated by the TX send context, as completion and TX occur
    in different thread/processes.)
  
    I'll revisit correct BAR TX'ing later on.
  
  * Add/change some debugging around to make tracking down strange sequence
    number issues easier.
  
  And the actual bugfix:
  
  * re-schedule the TID for more TX scheduling after the aggregate
    completion handler is run - either the error handler (which retries
    all subframes if possible) or after the completion handler itself.
    In both instances, since packets may be requeued on the software
    queue, the TID needs rescheduling.
  
  Without this, I noticed the throughput would drop immediately when
  any retries occured, and lots of frames were being scheduled later
  on when I was issuing a single ICMP ping. That ping was causing the
  software queue to be scheduled, and lots of frames were thus being
  re-scheduled to the hardware (and updating the BAW in the process.)
  
  With this, things are stable. Slow (same as non-aggregate speed)
  and the software retry rate is too high for my liking, but packets
  now seem to zip along.

Modified:
  user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c

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	Fri Aug 19 02:37:13 2011	(r224994)
+++ user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c	Fri Aug 19 06:33:40 2011	(r224995)
@@ -395,8 +395,9 @@ ath_tx_setds_11n(struct ath_softc *sc, s
 	bf = bf_first;
 	while (bf != NULL) {
 		DPRINTF(sc, ATH_DEBUG_SW_TX_AGGR,
-		    "%s: bf=%p, nseg=%d, pktlen=%d\n",
-		    __func__, bf, bf->bf_nseg, bf->bf_state.bfs_pktlen);
+		    "%s: bf=%p, nseg=%d, pktlen=%d, seqno=%d\n",
+		    __func__, bf, bf->bf_nseg, bf->bf_state.bfs_pktlen,
+		    SEQNO(bf->bf_state.bfs_seqno));
 
 		/* Sub-frame setup */
 		ath_tx_chaindesclist_subframe(sc, bf);
@@ -2322,6 +2323,7 @@ ath_tx_aggr_retry_unaggr(struct ath_soft
 		 * This'll end up going into net80211 and back out
 		 * again, via ic->ic_raw_xmit().
 		 */
+#if 0
 		DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL, "%s: TID %d: send BAR\n",
 		    __func__, tid);
 		if (ieee80211_send_bar(ni, tap, ni->ni_txseqs[tid]) == 0) {
@@ -2337,6 +2339,7 @@ ath_tx_aggr_retry_unaggr(struct ath_soft
 			    "%s: TID %d: BAR TX failed\n",
 			    __func__, tid);
 		}
+#endif
 
 		/* Free buffer, bf is free after this call */
 		ath_tx_default_comp(sc, bf, 0);
@@ -2438,6 +2441,7 @@ ath_tx_comp_aggr_error(struct ath_softc 
 	ath_bufhead bf_q;
 	int drops = 0;
 	struct ieee80211_tx_ampdu *tap;
+	struct ath_txq *txq = sc->sc_ac2q[tid->ac];
 
 	tap = ath_tx_get_tx_tid(an, tid->tid);
 
@@ -2482,6 +2486,13 @@ ath_tx_comp_aggr_error(struct ath_softc 
 		ATH_TXQ_INSERT_HEAD(tid, bf, bf_list);
 	}
 	ATH_TXQ_UNLOCK(tid);
+
+	/*
+	 * Kick the queue
+	 */
+	ATH_TXQ_LOCK(txq);
+	ath_tx_tid_sched(sc, an, tid->tid);
+	ATH_TXQ_UNLOCK(txq);
 }
 
 /*
@@ -2541,6 +2552,7 @@ ath_tx_aggr_comp_aggr(struct ath_softc *
 	struct ath_buf *bf, *bf_next;
 	int ba_index;
 	int drops = 0;
+	struct ath_txq *txq = sc->sc_ac2q[atid->ac];
 
 	DPRINTF(sc, ATH_DEBUG_SW_TX_AGGR, "%s: called\n", __func__);
 
@@ -2596,12 +2608,14 @@ ath_tx_aggr_comp_aggr(struct ath_softc *
 	bf = bf_first;
 
 	while (bf) {
-		DPRINTF(sc, ATH_DEBUG_SW_TX_AGGR, "%s: checking bf=%p seqno=%d\n",
-		    __func__, bf, SEQNO(bf->bf_state.bfs_seqno));
-
 		ba_index = ATH_BA_INDEX(seq_st, SEQNO(bf->bf_state.bfs_seqno));
 		bf_next = bf->bf_next;
 
+		DPRINTF(sc, ATH_DEBUG_SW_TX_AGGR,
+		    "%s: checking bf=%p seqno=%d; ack=%d\n",
+		    __func__, bf, SEQNO(bf->bf_state.bfs_seqno),
+		    ATH_BA_ISSET(ba, ba_index));
+
 		/*
 		 * For now, ACK all packets
 		 */
@@ -2648,6 +2662,14 @@ ath_tx_aggr_comp_aggr(struct ath_softc *
 	}
 	ATH_TXQ_UNLOCK(atid);
 
+	/*
+	 * Kick the queue if it needs it
+	 * XXX too aggressive?
+	 */
+	ATH_TXQ_LOCK(txq);
+	ath_tx_tid_sched(sc, an, atid->tid);
+	ATH_TXQ_UNLOCK(txq);
+
 	DPRINTF(sc, ATH_DEBUG_SW_TX_AGGR,
 	    "%s: finished; txa_start now %d\n", __func__, tap->txa_start);
 }


More information about the svn-src-user mailing list