From nobody@FreeBSD.org  Fri Dec 23 19:17:55 2011
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 21FF7106564A
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 23 Dec 2011 19:17:55 +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 113808FC12
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 23 Dec 2011 19:17:55 +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 pBNJHs0R052268
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 23 Dec 2011 19:17:54 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id pBNJHsAJ052267;
	Fri, 23 Dec 2011 19:17:54 GMT
	(envelope-from nobody)
Message-Id: <201112231917.pBNJHsAJ052267@red.freebsd.org>
Date: Fri, 23 Dec 2011 19:17:54 GMT
From: Adrian Chadd <adrian@FreeBSD.org>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [ath] hostap mode TX buffer hang
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         163573
>Category:       kern
>Synopsis:       [ath] hostap mode TX buffer hang
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-wireless
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Dec 23 19:20:07 UTC 2011
>Closed-Date:    
>Last-Modified:  Fri Dec 23 19:22:57 UTC 2011
>Originator:     Adrian Chadd
>Release:        FreeBSD-10.0, on a TP-WR1043ND router.
>Organization:
FreeBSD
>Environment:
FreeBSD home-11bg-ap 10.0-CURRENT FreeBSD 10.0-CURRENT #39: Thu Jan  1 08:00:00 WST 1970     adrian@dummy:/home/adrian/work/freebsd/git/adrianchadd-freebsd-work/obj/mipseb/mips.mipseb/home/adrian/work/freebsd/git/adrianchadd-freebsd-work/adrianchadd-freebsd-work/sys/TP-WN1043ND  mips

. it's a recent -HEAD (to this date stamp), from my git tree. Ignore the actual datestamp there.
>Description:
When testing 802.11n hostap mode, the TX side still occasionally hangs.

This is again due to the "busy" buffer management code being slightly wrong, allowing a "busy" buffer to stay busy and eventually clogging up the free TX buffer ring.

This occurs with IEEE80211_SUPPORT_TDMA, as the busy buffer code isn't included otherwise. (It should be though, due to how the MAC behaves. But that's a different problem.)

The relevant output from "sysctl dev.ath.0.txagg=1" is:

HW TXQ 0: axq_depth=2, axq_aggr_depth=2
HW TXQ 1: axq_depth=0, axq_aggr_depth=0
HW TXQ 2: axq_depth=0, axq_aggr_depth=0
HW TXQ 3: axq_depth=0, axq_aggr_depth=0
HW TXQ 8: axq_depth=0, axq_aggr_depth=0
Busy: 0
Total TX buffers: 1; Total TX buffers busy: 1

. the fact that there's only 1 total buffer in the free list, and that one is busy, indicates that things were going pear shaped.

Also, athstats can be helpful:

# athstats | grep tx
..
294          tx stopped 'cuz no xmit buffer
..

>How-To-Repeat:
Just exchange a bunch of traffic whilst in a lossy 802.11 network. It should eventually get angry and stop transmitting. ifconfig wlan0 down / up will flush the TX buffer queue.

Enable both 802.11 and TDMA in the kernel configuration file (ATH_ENABLE_11N and IEEE80211_SUPPORT_TDMA.) Configure the unit as a hostap - in non-hostap mode, the interface resets will cause the TX buffer queue to be flushed.

Sit back and watch the fireworks.
>Fix:
Not yet.

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-wireless 
Responsible-Changed-By: adrian 
Responsible-Changed-When: Fri Dec 23 19:22:34 UTC 2011 
Responsible-Changed-Why:  
Over to -wireless. 


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