From nobody@FreeBSD.org  Tue May 15 04:43:47 2012
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id A2B7F106566C
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 15 May 2012 04:43:47 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id 74D7A8FC08
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 15 May 2012 04:43:47 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id q4F4hl2q039509
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 15 May 2012 04:43:47 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id q4F4hlEU039488;
	Tue, 15 May 2012 04:43:47 GMT
	(envelope-from nobody)
Message-Id: <201205150443.q4F4hlEU039488@red.freebsd.org>
Date: Tue, 15 May 2012 04:43:47 GMT
From: Adrian Chadd <adrian@FreeBSD.org>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [ath] TX block-ack window holes
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         167902
>Category:       kern
>Synopsis:       [ath] TX block-ack window holes
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    adrian
>State:          patched
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue May 15 04:50:02 UTC 2012
>Closed-Date:    
>Last-Modified:  Wed May 16 03:41:25 UTC 2012
>Originator:     Adrian Chadd
>Release:        9.0-STABLE i386, with -HEAD net80211/ath
>Organization:
>Environment:
FreeBSD marilyn 9.0-STABLE FreeBSD 9.0-STABLE #0 r235422M: Sun May 13 20:57:56 PDT 2012     adrian@marilyn:/home/adrian/work/freebsd/stable/9/sys/i386/compile/MARILYN-9-STABLE  i386

>Description:
When doing traffic tests w/ 11n debugging on, I've noticed that the RX side is reporting holes in the TX BA space.

Some example logging is:

wlan1: [00:03:7f:0b:62:88] discard MPDU frame, BA win <310:373> (0 frames) rxseq 309 tid 0 (retransmit)
wlan1: [00:03:7f:0b:62:88] discard MPDU frame, BA win <542:605> (0 frames) rxseq 541 tid 0 (retransmit)
wlan1: [00:03:7f:0b:62:88] discard MPDU frame, BA win <831:894> (0 frames) rxseq 830 tid 0 (retransmit)
wlan1: [00:03:7f:0b:62:88] discard MPDU frame, BA win <886:949> (0 frames) rxseq 885 tid 0 (retransmit)
wlan1: [00:03:7f:0b:62:88] discard MPDU frame, BA win <909:972> (0 frames) rxseq 908 tid 0 (retransmit)
--- these
wlan1: [00:03:7f:0b:62:88] move BA win <1372:1435> (62 frames) rxseq 1436 tid 0
wlan1: [00:03:7f:0b:62:88] move BA win <1373:1436> (63 frames) rxseq 1437 tid 0
--- these
wlan1: [00:03:7f:0b:62:88] discard MPDU frame, BA win <1447:1510> (0 frames) rxseq 1446 tid 0 (retransmit)
wlan1: [00:03:7f:0b:62:88] discard MPDU frame, BA win <1561:1624> (0 frames) rxseq 1560 tid 0 (retransmit)
wlan1: [00:03:7f:0b:62:88] discard MPDU frame, BA win <1660:1723> (0 frames) rxseq 1659 tid 0 (retransmit)
wlan1: [00:03:7f:0b:62:88] discard MPDU frame, BA win <2054:2117> (0 frames) rxseq 2053 tid 0 (retransmit)
wlan1: [00:03:7f:0b:62:88] discard MPDU frame, BA win <2107:2170> (0 frames) rxseq 2106 tid 0 (retransmit)
wlan1: [00:03:7f:0b:62:88] discard MPDU frame, BA win <2122:2185> (0 frames) rxseq 2121 tid 0 (retransmit)
wlan1: [00:03:7f:0b:62:88] discard MPDU frame, BA win <2890:2953> (0 frames) rxseq 2889 tid 0 (retransmit)

A pcap of the live traffic showed that some frames inside the BA weren't ever ACKed. I figured that the send side was thus not being properly notified that the transmission failed.

I then added some code to ath_tx_processq() to print out ts_status if it's 0 but not HAL_TXERR_XRETRY. It turns out that I was seeing HAL_TXERR_FILT errors. The filtered frames were just being treated as incorrect completions, hence the above BA window slide.

>How-To-Repeat:
* enable 11n
* on the receiving side - wlandebug -i wlanX +11n
* .. do some traffic.

>Fix:
The TX completion routines need to handle non-XRETRY errors.

>Release-Note:
>Audit-Trail:

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/167902: commit references a PR
Date: Tue, 15 May 2012 04:55:25 +0000 (UTC)

 Author: adrian
 Date: Tue May 15 04:55:15 2012
 New Revision: 235461
 URL: http://svn.freebsd.org/changeset/base/235461
 
 Log:
   Handle non-xretry errors the same as xretry errors for now.
   
   Although I _should_ handle the other errors in various ways (specifically
   errors like FILT), treating them as having transmitted successfully
   is completely wrong.  Here, they'd be counted as successful and the BAW
   would be advanced.. but the RX side wouldn't have received them.
   
   The specific errors I've been seeing here are HAL_TXERR_FILT.
   
   This patch does fix the issue - I've tested it using -i 0.001 pings
   (enough to start aggregation) and now the behaviour is correct:
   
   * The RX side never sees a "moved window" error, and
   * The TX side sends BARs as needed, with the RX side correctly handling
     them.
   
   PR:		kern/167902
 
 Modified:
   head/sys/dev/ath/if_ath_tx.c
 
 Modified: head/sys/dev/ath/if_ath_tx.c
 ==============================================================================
 --- head/sys/dev/ath/if_ath_tx.c	Tue May 15 03:21:36 2012	(r235460)
 +++ head/sys/dev/ath/if_ath_tx.c	Tue May 15 04:55:15 2012	(r235461)
 @@ -3597,9 +3597,16 @@ ath_tx_aggr_comp_aggr(struct ath_softc *
  	pktlen = bf_first->bf_state.bfs_pktlen;
  
  	/*
 -	 * handle errors first
 +	 * Handle errors first!
 +	 *
 +	 * Here, handle _any_ error as a "exceeded retries" error.
 +	 * Later on (when filtered frames are to be specially handled)
 +	 * it'll have to be expanded.
  	 */
 +#if 0
  	if (ts.ts_status & HAL_TXERR_XRETRY) {
 +#endif
 +	if (ts.ts_status != 0) {
  		ATH_TXQ_UNLOCK(sc->sc_ac2q[atid->ac]);
  		ath_tx_comp_aggr_error(sc, bf_first, atid);
  		return;
 @@ -3839,7 +3846,10 @@ ath_tx_aggr_comp_unaggr(struct ath_softc
  	 * Don't bother with the retry check if all frames
  	 * are being failed (eg during queue deletion.)
  	 */
 +#if 0
  	if (fail == 0 && ts->ts_status & HAL_TXERR_XRETRY) {
 +#endif
 +	if (fail == 0 && ts->ts_status != 0) {
  		ATH_TXQ_UNLOCK(sc->sc_ac2q[atid->ac]);
  		DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: retry_unaggr\n",
  		    __func__);
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: open->patched 
State-Changed-By: linimon 
State-Changed-When: Wed May 16 02:22:45 UTC 2012 
State-Changed-Why:  
Over to committer as possible MFC reminder. 


Responsible-Changed-From-To: freebsd-bugs->adri 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Wed May 16 02:22:45 UTC 2012 
Responsible-Changed-Why:  

http://www.freebsd.org/cgi/query-pr.cgi?pr=167902 
Responsible-Changed-From-To: adri->adrian 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Wed May 16 03:40:47 UTC 2012 
Responsible-Changed-Why:  
Fix assignment. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=167902 
>Unformatted:
