From owner-svn-src-user@FreeBSD.ORG Mon Sep 19 11:49:06 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5816B1065672; Mon, 19 Sep 2011 11:49:06 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3CFD18FC08; Mon, 19 Sep 2011 11:49:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8JBn6jl078575; Mon, 19 Sep 2011 11:49:06 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8JBn6iY078573; Mon, 19 Sep 2011 11:49:06 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201109191149.p8JBn6iY078573@svn.freebsd.org> From: Adrian Chadd Date: Mon, 19 Sep 2011 11:49:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225664 - user/adrian/if_ath_tx/sys/dev/ath X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Sep 2011 11:49:06 -0000 Author: adrian Date: Mon Sep 19 11:49:05 2011 New Revision: 225664 URL: http://svn.freebsd.org/changeset/base/225664 Log: Add some further debugging to BAW add/remove. The current TX hangs I've seen with BAR TX are because I'm completely doing the wrong thing in choosing a new left-edge BAW. I'll look at fixing that in subsequent commits. 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 Mon Sep 19 11:08:31 2011 (r225663) +++ user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c Mon Sep 19 11:49:05 2011 (r225664) @@ -1858,6 +1858,14 @@ ath_tx_addto_baw(struct ath_softc *sc, s "%s: ba packet dup (index=%d, cindex=%d, " "head=%d, tail=%d)\n", __func__, index, cindex, tid->baw_head, tid->baw_tail); + device_printf(sc->sc_dev, + "%s: BA bf: %p; seqno=%d ; new bf: %p; seqno=%d\n", + __func__, + tid->tx_buf[cindex], + SEQNO(tid->tx_buf[cindex]->bf_state.bfs_seqno), + bf, + SEQNO(bf->bf_state.bfs_seqno) + ); } tid->tx_buf[cindex] = bf; @@ -1876,10 +1884,11 @@ ath_tx_addto_baw(struct ath_softc *sc, s */ static void ath_tx_update_baw(struct ath_softc *sc, struct ath_node *an, - struct ath_tid *tid, int seqno) + struct ath_tid *tid, const struct ath_buf *bf) { int index, cindex; struct ieee80211_tx_ampdu *tap; + int seqno = SEQNO(bf->bf_state.bfs_seqno); ATH_TXQ_LOCK_ASSERT(sc->sc_ac2q[tid->ac]); @@ -1891,6 +1900,11 @@ ath_tx_update_baw(struct ath_softc *sc, "%s: tid=%d, baw=%d:%d, seqno=%d, index=%d, cindex=%d, baw head=%d, tail=%d\n", __func__, tid->tid, tap->txa_start, tap->txa_wnd, seqno, index, cindex, tid->baw_head, tid->baw_tail); + if (tid->tx_buf[cindex] != bf) { + device_printf(sc->sc_dev, "%s: seqno %d: tx_buf bf=%p; comp bf=%p!\n", + __func__, seqno, tid->tx_buf[cindex], bf); + } + tid->tx_buf[cindex] = NULL; while (tid->baw_head != tid->baw_tail && !tid->tx_buf[tid->baw_head]) { @@ -2277,8 +2291,7 @@ ath_tx_tid_drain(struct ath_softc *sc, s * the frame was in the BAW to begin with. */ if (bf->bf_state.bfs_retries > 0) { - ath_tx_update_baw(sc, an, tid, - SEQNO(bf->bf_state.bfs_seqno)); + ath_tx_update_baw(sc, an, tid, bf); bf->bf_state.bfs_dobaw = 0; } /* @@ -2516,8 +2529,7 @@ ath_tx_cleanup(struct ath_softc *sc, str TAILQ_REMOVE(&atid->axq_q, bf, bf_list); atid->axq_depth--; if (bf->bf_state.bfs_dobaw) { - ath_tx_update_baw(sc, an, atid, - SEQNO(bf->bf_state.bfs_seqno)); + ath_tx_update_baw(sc, an, atid, bf); if (! bf->bf_state.bfs_addedbaw) device_printf(sc->sc_dev, "%s: wasn't added: seqno %d\n", @@ -2689,8 +2701,7 @@ ath_tx_aggr_retry_unaggr(struct ath_soft /* Update BAW anyway */ if (bf->bf_state.bfs_dobaw) { - ath_tx_update_baw(sc, an, atid, - SEQNO(bf->bf_state.bfs_seqno)); + ath_tx_update_baw(sc, an, atid, bf); if (! bf->bf_state.bfs_addedbaw) device_printf(sc->sc_dev, "%s: wasn't added: seqno %d\n", @@ -2796,7 +2807,7 @@ ath_tx_retry_subframe(struct ath_softc * DPRINTF(sc, ATH_DEBUG_SW_TX_RETRIES, "%s: max retries: seqno %d\n", __func__, SEQNO(bf->bf_state.bfs_seqno)); - ath_tx_update_baw(sc, an, atid, SEQNO(bf->bf_state.bfs_seqno)); + ath_tx_update_baw(sc, an, atid, bf); if (! bf->bf_state.bfs_addedbaw) device_printf(sc->sc_dev, "%s: wasn't added: seqno %d\n", @@ -3100,8 +3111,7 @@ ath_tx_aggr_comp_aggr(struct ath_softc * ATH_BA_ISSET(ba, ba_index)); if (tx_ok && ATH_BA_ISSET(ba, ba_index)) { - ath_tx_update_baw(sc, an, atid, - SEQNO(bf->bf_state.bfs_seqno)); + ath_tx_update_baw(sc, an, atid, bf); bf->bf_state.bfs_dobaw = 0; if (! bf->bf_state.bfs_addedbaw) device_printf(sc->sc_dev, @@ -3255,7 +3265,7 @@ ath_tx_aggr_comp_unaggr(struct ath_softc DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: TID=%d, seqno %d\n", __func__, tid, SEQNO(bf->bf_state.bfs_seqno)); if (bf->bf_state.bfs_dobaw) { - ath_tx_update_baw(sc, an, atid, SEQNO(bf->bf_state.bfs_seqno)); + ath_tx_update_baw(sc, an, atid, bf); bf->bf_state.bfs_dobaw = 0; if (! bf->bf_state.bfs_addedbaw) device_printf(sc->sc_dev,