From owner-freebsd-bugs@FreeBSD.ORG Fri Dec 23 19:20:07 2011 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8411C1065672 for ; Fri, 23 Dec 2011 19:20:07 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 579E18FC0C for ; Fri, 23 Dec 2011 19:20:07 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id pBNJK768080562 for ; Fri, 23 Dec 2011 19:20:07 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id pBNJK7VO080561; Fri, 23 Dec 2011 19:20:07 GMT (envelope-from gnats) Resent-Date: Fri, 23 Dec 2011 19:20:07 GMT Resent-Message-Id: <201112231920.pBNJK7VO080561@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Adrian Chadd Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 21FF7106564A for ; 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 ; 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 ; 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 To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: kern/163573: [ath] hostap mode TX buffer hang X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Dec 2011 19:20:07 -0000 >Number: 163573 >Category: kern >Synopsis: [ath] hostap mode TX buffer hang >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >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: >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: >Unformatted: