From owner-svn-src-all@FreeBSD.ORG Mon Mar 26 16:05:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9D58B106564A; Mon, 26 Mar 2012 16:05:20 +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 881268FC1B; Mon, 26 Mar 2012 16:05:20 +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 q2QG5KtL040063; Mon, 26 Mar 2012 16:05:20 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2QG5KQj040060; Mon, 26 Mar 2012 16:05:20 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201203261605.q2QG5KQj040060@svn.freebsd.org> From: Adrian Chadd Date: Mon, 26 Mar 2012 16:05:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233514 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Mar 2012 16:05:20 -0000 Author: adrian Date: Mon Mar 26 16:05:19 2012 New Revision: 233514 URL: http://svn.freebsd.org/changeset/base/233514 Log: Use the assigned sequence number when checking if a retried packet is within the BAW. This regression was introduced in ane earlier commit by me to fix the BAW seqno allocation-but-not-insertion-into-BAW race. Since it was only ever using the to-be allocated sequence number, any frame retries with the first frame in the BAW still in the software queue would have constantly failed, as ni_txseqs[tid] would always be outside the BAW. TODO: * Extract out the mostly common code here in the agg and non-agg ADDBA case and stuff it into a single function. PR: kern/166357 Modified: head/sys/dev/ath/if_ath_tx.c head/sys/dev/ath/if_ath_tx_ht.c Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Mon Mar 26 15:38:17 2012 (r233513) +++ head/sys/dev/ath/if_ath_tx.c Mon Mar 26 16:05:19 2012 (r233514) @@ -2348,7 +2348,6 @@ ath_tx_xmit_aggr(struct ath_softc *sc, s 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; - int seqno; ATH_TXQ_LOCK_ASSERT(txq); @@ -2384,13 +2383,31 @@ ath_tx_xmit_aggr(struct ath_softc *sc, s * the TIDs that map to it. Ugh. */ if (bf->bf_state.bfs_dobaw) { - if (! BAW_WITHIN(tap->txa_start, tap->txa_wnd, - ni->ni_txseqs[bf->bf_state.bfs_tid])) { + ieee80211_seq seqno; + + /* + * If the sequence number is allocated, use it. + * Otherwise, use the sequence number we WOULD + * allocate. + */ + if (bf->bf_state.bfs_seqno_assigned) + seqno = SEQNO(bf->bf_state.bfs_seqno); + else + seqno = ni->ni_txseqs[bf->bf_state.bfs_tid]; + + /* + * Check whether either the currently allocated + * sequence number _OR_ the to-be allocated + * sequence number is inside the BAW. + */ + if (! BAW_WITHIN(tap->txa_start, tap->txa_wnd, seqno)) { ATH_TXQ_INSERT_TAIL(tid, bf, bf_list); ath_tx_tid_sched(sc, tid); return; } if (! bf->bf_state.bfs_seqno_assigned) { + int seqno; + seqno = ath_tx_tid_seqno_assign(sc, ni, bf, bf->bf_m); if (seqno < 0) { device_printf(sc->sc_dev, Modified: head/sys/dev/ath/if_ath_tx_ht.c ============================================================================== --- head/sys/dev/ath/if_ath_tx_ht.c Mon Mar 26 15:38:17 2012 (r233513) +++ head/sys/dev/ath/if_ath_tx_ht.c Mon Mar 26 16:05:19 2012 (r233514) @@ -652,7 +652,6 @@ ath_tx_form_aggr(struct ath_softc *sc, s int status = ATH_AGGR_DONE; int prev_frames = 0; /* XXX for AR5416 burst, not done here */ int prev_al = 0; /* XXX also for AR5416 burst */ - int seqno; ATH_TXQ_LOCK_ASSERT(sc->sc_ac2q[tid->ac]); @@ -747,13 +746,32 @@ ath_tx_form_aggr(struct ath_softc *sc, s * see ath_tx_xmit_aggr() for more info. */ if (bf->bf_state.bfs_dobaw) { + ieee80211_seq seqno; + + /* + * If the sequence number is allocated, use it. + * Otherwise, use the sequence number we WOULD + * allocate. + */ + if (bf->bf_state.bfs_seqno_assigned) + seqno = SEQNO(bf->bf_state.bfs_seqno); + else + seqno = ni->ni_txseqs[bf->bf_state.bfs_tid]; + + /* + * Check whether either the currently allocated + * sequence number _OR_ the to-be allocated + * sequence number is inside the BAW. + */ if (! BAW_WITHIN(tap->txa_start, tap->txa_wnd, - ni->ni_txseqs[bf->bf_state.bfs_tid])) { + seqno)) { status = ATH_AGGR_BAW_CLOSED; break; } + /* XXX check for bfs_need_seqno? */ if (! bf->bf_state.bfs_seqno_assigned) { + int seqno; seqno = ath_tx_tid_seqno_assign(sc, ni, bf, bf->bf_m); if (seqno < 0) { device_printf(sc->sc_dev,