From owner-svn-src-user@FreeBSD.ORG Mon Aug 8 11:33:08 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 E25241065675; Mon, 8 Aug 2011 11:33:07 +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 C760A8FC15; Mon, 8 Aug 2011 11:33:07 +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 p78BX7io045577; Mon, 8 Aug 2011 11:33:07 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p78BX7uA045575; Mon, 8 Aug 2011 11:33:07 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201108081133.p78BX7uA045575@svn.freebsd.org> From: Adrian Chadd Date: Mon, 8 Aug 2011 11:33:07 +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: r224705 - 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, 08 Aug 2011 11:33:08 -0000 Author: adrian Date: Mon Aug 8 11:33:07 2011 New Revision: 224705 URL: http://svn.freebsd.org/changeset/base/224705 Log: Find another panic - this time, TID=16 traffic that occured with aggregation enabled * add some more debugging * absolutely, positively ensure that IEEE80211_NONQOS_TID TIDs never get assigned an aggregation session And to fix the actual issue: * recycling ath_buf's wasn't involving a bzero() to reset the state to blank; so a left-over completion handler from an aggregate packet. Blanking the handler fixes this behaviour. 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 Aug 8 08:22:15 2011 (r224704) +++ user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c Mon Aug 8 11:33:07 2011 (r224705) @@ -1677,8 +1677,8 @@ ath_tx_swq(struct ath_softc *sc, struct tid = ath_tx_gettid(sc, m0); atid = &an->an_tid[tid]; - DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: pri=%d, tid=%d, qos=%d\n", - __func__, pri, tid, IEEE80211_QOS_HAS_SEQ(wh)); + DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: bf=%p, pri=%d, tid=%d, qos=%d\n", + __func__, bf, pri, tid, IEEE80211_QOS_HAS_SEQ(wh)); /* Set local packet state, used to queue packets to hardware */ bf->bf_state.bfs_tid = tid; @@ -1925,6 +1925,10 @@ ath_tx_aggr_comp(struct ath_softc *sc, s * * Mark as retry, requeue at head of queue */ + if (tid == IEEE80211_NONQOS_TID) + device_printf(sc->sc_dev, "%s: TID=16!\n", __func__); + DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: bf=%p: tid=%d\n", + __func__, bf, bf->bf_state.bfs_tid); /* * Not success and out of retries? @@ -1936,8 +1940,8 @@ ath_tx_aggr_comp(struct ath_softc *sc, s */ /* Success? Complete */ - DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: seqno %d\n", - __func__, SEQNO(bf->bf_state.bfs_seqno)); + DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: TID=%d, seqno %d\n", + __func__, tid, SEQNO(bf->bf_state.bfs_seqno)); ath_tx_update_baw(sc, an, atid, SEQNO(bf->bf_state.bfs_seqno)); ath_tx_default_comp(sc, bf); @@ -1961,11 +1965,17 @@ ath_tx_tid_hw_queue_aggr(struct ath_soft tap = ath_tx_get_tx_tid(an, tid); + if (tid == IEEE80211_NONQOS_TID) + device_printf(sc->sc_dev, "%s: called for TID=NONQOS_TID?\n", + __func__); + for (;;) { bf = STAILQ_FIRST(&atid->axq_q); if (bf == NULL) { break; } + DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: bf=%p: tid=%d\n", + __func__, bf, bf->bf_state.bfs_tid); if (bf->bf_state.bfs_tid != tid) device_printf(sc->sc_dev, "%s: TID: tid=%d, ac=%d, bf tid=%d\n", __func__, tid, atid->ac, bf->bf_state.bfs_tid); @@ -2006,6 +2016,8 @@ ath_tx_tid_hw_queue_aggr(struct ath_soft /* Set completion handler */ bf->bf_comp = ath_tx_aggr_comp; + if (bf->bf_state.bfs_tid == IEEE80211_NONQOS_TID) + device_printf(sc->sc_dev, "%s: TID=16?\n", __func__); /* Punt to hardware or software txq */ ath_tx_handoff(sc, txq, bf); @@ -2045,6 +2057,7 @@ ath_tx_tid_hw_queue_norm(struct ath_soft " tid %d\n", __func__, bf->bf_state.bfs_tid, tid); } + bf->bf_comp = NULL; /* XXX default handler */ /* Punt to hardware or software txq */ ath_tx_handoff(sc, txq, bf); @@ -2076,6 +2089,8 @@ ath_txq_sched(struct ath_softc *sc, stru * Suspend paused queues here; they'll be resumed * once the addba completes or times out. */ + DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: tid=%d, paused=%d\n", + __func__, atid->tid, atid->paused); if (atid->paused) { ath_tx_tid_unsched(sc, atid->an, atid->tid); continue; @@ -2122,6 +2137,9 @@ ath_tx_ampdu_running(struct ath_softc *s { struct ieee80211_tx_ampdu *tap; + if (tid == IEEE80211_NONQOS_TID) + return 0; + tap = ath_tx_get_tx_tid(an, tid); if (tap == NULL) return 0; /* Not valid; default to not running */ @@ -2137,6 +2155,9 @@ ath_tx_ampdu_pending(struct ath_softc *s { struct ieee80211_tx_ampdu *tap; + if (tid == IEEE80211_NONQOS_TID) + return 0; + tap = ath_tx_get_tx_tid(an, tid); if (tap == NULL) return 0; /* Not valid; default to not pending */