Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 6 Aug 2011 11:43:00 +0000 (UTC)
From:      Adrian Chadd <adrian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r224677 - user/adrian/if_ath_tx/sys/dev/ath
Message-ID:  <201108061143.p76Bh08h050294@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: adrian
Date: Sat Aug  6 11:43:00 2011
New Revision: 224677
URL: http://svn.freebsd.org/changeset/base/224677

Log:
  Try to figure out why an A-MPDU session hangs shortly after the
  session is established.
  
  * Add ATH_DEBUG_SW_TX_BAW, specifically for doing BAW debugging
  * Enforce that the relevant TXQ lock is held in the BAW update
    functions.

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

Modified: user/adrian/if_ath_tx/sys/dev/ath/if_ath_debug.h
==============================================================================
--- user/adrian/if_ath_tx/sys/dev/ath/if_ath_debug.h	Sat Aug  6 11:33:17 2011	(r224676)
+++ user/adrian/if_ath_tx/sys/dev/ath/if_ath_debug.h	Sat Aug  6 11:43:00 2011	(r224677)
@@ -58,6 +58,7 @@ enum { 
 	ATH_DEBUG_TDMA_TIMER	= 0x01000000,	/* TDMA timer processing */
 	ATH_DEBUG_REGDOMAIN	= 0x02000000,	/* regulatory processing */
 	ATH_DEBUG_SW_TX		= 0x04000000,
+	ATH_DEBUG_SW_TX_BAW	= 0x08000000,
 	ATH_DEBUG_FATAL		= 0x80000000,	/* fatal errors */
 	ATH_DEBUG_ANY		= 0xffffffff
 };

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	Sat Aug  6 11:33:17 2011	(r224676)
+++ user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c	Sat Aug  6 11:43:00 2011	(r224677)
@@ -1507,8 +1507,10 @@ ath_tx_addto_baw(struct ath_softc *sc, s
 	if (bf->bf_state.bfs_isretried)
 		return;
 
+	ATH_TXQ_LOCK_ASSERT(sc->sc_ac2q[tid->ac]);
+
 	tap = ath_tx_get_tx_tid(an, tid->tid);
-	DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: tid=%d, seqno %d; window %d:%d\n",
+	DPRINTF(sc, ATH_DEBUG_SW_TX_BAW, "%s: tid=%d, seqno %d; window %d:%d\n",
 		    __func__, tid->tid, SEQNO(bf->bf_state.bfs_seqno),
 		    tap->txa_start, tap->txa_wnd);
 
@@ -1516,16 +1518,13 @@ ath_tx_addto_baw(struct ath_softc *sc, s
 	 * ni->ni_txseqs[] is the currently allocated seqno.
 	 * the txa state contains the current baw start.
 	 */
-#if 0
-	DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: tap->txa_start: %d, seqno: %d\n",
+	DPRINTF(sc, ATH_DEBUG_SW_TX_BAW, "%s: tap->txa_start: %d, seqno: %d\n",
 	    __func__, tap->txa_start, SEQNO(bf->bf_state.bfs_seqno));
-#endif
 	index  = ATH_BA_INDEX(tap->txa_start, SEQNO(bf->bf_state.bfs_seqno));
 	cindex = (tid->baw_head + index) & (ATH_TID_MAX_BUFS - 1);
-#if 0
-	DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: index=%d, cindex=%d, baw head=%d, tail=%d\n",
+	DPRINTF(sc, ATH_DEBUG_SW_TX_BAW,
+	    "%s: index=%d, cindex=%d, baw head=%d, tail=%d\n",
 	    __func__, index, cindex, tid->baw_head, tid->baw_tail);
-#endif
 
 #if 0
 	assert(tid->tx_buf[cindex] == NULL);
@@ -1555,16 +1554,18 @@ ath_tx_update_baw(struct ath_softc *sc, 
 	int index, cindex;
 	struct ieee80211_tx_ampdu *tap;
 
+	ATH_TXQ_LOCK_ASSERT(sc->sc_ac2q[tid->ac]);
+
 	tap = ath_tx_get_tx_tid(an, tid->tid);
 	DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: tid=%d, baw=%d:%d, seqno=%d\n",
 	    __func__, tid->tid, tap->txa_start, tap->txa_wnd, seqno);
 
 	index  = ATH_BA_INDEX(tap->txa_start, seqno);
 	cindex = (tid->baw_head + index) & (ATH_TID_MAX_BUFS - 1);
-#if 0
-	DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: index=%d, cindex=%d, baw head=%d, tail=%d\n",
+
+	DPRINTF(sc, ATH_DEBUG_SW_TX_BAW,
+	    "%s: index=%d, cindex=%d, baw head=%d, tail=%d\n",
 	    __func__, index, cindex, tid->baw_head, tid->baw_tail);
-#endif
 
 	tid->tx_buf[cindex] = NULL;
 
@@ -1927,7 +1928,7 @@ ath_tx_tid_hw_queue_aggr(struct ath_soft
 		/* XXX check if seqno is outside of BAW, if so don't queue it */
 		if (! BAW_WITHIN(tap->txa_start, tap->txa_wnd,
 		    SEQNO(bf->bf_state.bfs_seqno))) {
-			DPRINTF(sc, ATH_DEBUG_SW_TX,
+			DPRINTF(sc, ATH_DEBUG_SW_TX_BAW,
 			    "%s: seq %d outside of %d/%d; waiting\n",
 			    __func__, SEQNO(bf->bf_state.bfs_seqno),
 			    tap->txa_start, tap->txa_wnd);



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