From nobody@FreeBSD.org  Tue Jun 26 07:27:21 2012
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2E623106566B
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 26 Jun 2012 07:27:21 +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 19F2D8FC08
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 26 Jun 2012 07:27:21 +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 q5Q7RKQJ044028
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 26 Jun 2012 07:27:20 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id q5Q7RKZm044027;
	Tue, 26 Jun 2012 07:27:20 GMT
	(envelope-from nobody)
Message-Id: <201206260727.q5Q7RKZm044027@red.freebsd.org>
Date: Tue, 26 Jun 2012 07:27:20 GMT
From: Adrian Chadd <adrian@FreeBSD.org>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [ath] BAR TX hang when aggregation session is reset during a reassociation
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         169432
>Category:       kern
>Synopsis:       [ath] BAR TX hang when aggregation session is reset during a reassociation
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-wireless
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jun 26 07:30:13 UTC 2012
>Closed-Date:    
>Last-Modified:  Tue Jun 26 08:00:25 UTC 2012
>Originator:     Adrian Chadd
>Release:        9.0-STABLE with -HEAD net80211/ath
>Organization:
>Environment:
>Description:
When doing some iperf testing from a FreeBSD 802.11n station -> FreeBSD 802.11n AP, I noticed the AP would get wedged. When I flushed the interface, the STA node was showing as 'BAR wait' - ie, it was paused due to a pending BAR TX.

Enabling "wlandebug +11n" showed that the AP would start sending BAR frames and would get about 20 or 30 of them in (with failed retries), then stop sending them. The hardware was reporting a TX failure, but something was disabling it.

After much printf debugging on the AP, I finally figured it out.

Here's what was going on.

* The STA was going deaf, so all TX to it was failing;
* The AP would start sending BAR TX frames;
* The STA would hit a beacon miss and rescan, and reassociate to the AP;
* The reassociation request was going via ieee80211_ht_node_init();
* .. and that called ieee80211_ht_node_cleanup() to reset the existing state;
* .. which reset the TX/RX aggregation state, stopped the timer.

. and unfortunately, my ath_addba_stop() routine wasn't undoing a BAR suspended pause.

>How-To-Repeat:

>Fix:
The fix is to check if the node is currently undergoing bar_wait and if so, unpause it.

The trick however is handling the tiny race condition where this occurs between the bar TX being in flight and having completed TX.

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-wireless 
Responsible-Changed-By: adrian 
Responsible-Changed-When: Tue Jun 26 07:30:54 UTC 2012 
Responsible-Changed-Why:  
Refile 


http://www.freebsd.org/cgi/query-pr.cgi?pr=169432 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/169432: commit references a PR
Date: Tue, 26 Jun 2012 07:56:32 +0000 (UTC)

 Author: adrian
 Date: Tue Jun 26 07:56:15 2012
 New Revision: 237593
 URL: http://svn.freebsd.org/changeset/base/237593
 
 Log:
   Make sure the BAR TX session pause is correctly unpaused when a node
   is reassociating.
   
   PR:		kern/169432
 
 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 Jun 26 06:02:43 2012	(r237592)
 +++ head/sys/dev/ath/if_ath_tx.c	Tue Jun 26 07:56:15 2012	(r237593)
 @@ -4330,6 +4330,9 @@ ath_addba_response(struct ieee80211_node
  
  /*
   * Stop ADDBA on a queue.
 + *
 + * This can be called whilst BAR TX is currently active on the queue,
 + * so make sure this is unblocked before continuing.
   */
  void
  ath_addba_stop(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap)
 @@ -4341,9 +4344,21 @@ ath_addba_stop(struct ieee80211_node *ni
  
  	DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL, "%s: called\n", __func__);
  
 -	/* Pause TID traffic early, so there aren't any races */
 +	/*
 +	 * Pause TID traffic early, so there aren't any races
 +	 * Unblock the pending BAR held traffic, if it's currently paused.
 +	 */
  	ATH_TXQ_LOCK(sc->sc_ac2q[atid->ac]);
  	ath_tx_tid_pause(sc, atid);
 +	if (atid->bar_wait) {
 +		/*
 +		 * bar_unsuspend() expects bar_tx == 1, as it should be
 +		 * called from the TX completion path.  This quietens
 +		 * the warning.  It's cleared for us anyway.
 +		 */
 +		atid->bar_tx = 1;
 +		ath_tx_tid_bar_unsuspend(sc, atid);
 +	}
  	ATH_TXQ_UNLOCK(sc->sc_ac2q[atid->ac]);
  
  	/* There's no need to hold the TXQ lock here */
 _______________________________________________
 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"
 
>Unformatted:
