From nobody@FreeBSD.org  Mon Mar 12 11:00:00 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 276ED106564A
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 12 Mar 2012 11:00:00 +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 15FE08FC12
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 12 Mar 2012 11:00:00 +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 q2CAxx6K095339
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 12 Mar 2012 10:59:59 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id q2CAxxWh095338;
	Mon, 12 Mar 2012 10:59:59 GMT
	(envelope-from nobody)
Message-Id: <201203121059.q2CAxxWh095338@red.freebsd.org>
Date: Mon, 12 Mar 2012 10:59:59 GMT
From: Johann <jhugo@meraka.csir.co.za>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Slower performance in adhoc mode vs Client/AP mode, same HW (atheros adapters)
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         165969
>Category:       kern
>Synopsis:       [ath] Slower performance in adhoc mode vs Client/AP mode, same HW
>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:   Mon Mar 12 11:00:26 UTC 2012
>Closed-Date:    
>Last-Modified:  Thu Apr 12 13:50:11 UTC 2012
>Originator:     Johann
>Release:        FreeBSD 9.0-STABLE
>Organization:
CSIR
>Environment:
FreeBSD jhugo-rtr 9.0-STABLE FreeBSD 9.0-STABLE #7: Tue Feb 14 13:50:42 SAST 2012     jhay@magrathea.meraka.csir.co.za:/var/scratch/9-stable/obj/arm.armeb/var/scratch/9-stable/src/sys/SMALL-AVILA  arm
>Description:
I get lower throughputs in adhoc mode, compared to AP/client mode for 
the same two devices.

AP -> client            iperf   27.2 MBytes  28.8 Mbits/sec
adhoc -> adhoc          iperf   12.1 MBytes  21.3 Mbits/sec

dev.ath.0.stats.ast_tx_longretry is more than double in adhoc mode.

The two devices are directly next to each other in the LAB
HW platform = Gateworks Avila GW2348-4
Wifi adapters = Compex WLM54AGP23
Atheros driver from +- 10 Jan 2012
OS = FreeBSD 9.0-STABLE

Adhoc mode for FreeBSD 9.0-STABLE (as well as FreeBSD 8.0-STABLE) are also slower than adhoc mode for FreeBSD 7.2-STABLE

9.0-STABLE  adhoc -> adhoc  iperf   21.3 Mbits/sec
8.0-STABLE  adhoc -> adhoc  iperf   21.3 Mbits/sec
7.2-STABLE  adhoc -> adhoc  iperf   25.1 Mbits/sec


>How-To-Repeat:
- Place two wifi nodes next to each other. 
- Configure one device into AP mode and the other onto client mode.
- Do an iperf between the two nodes.

iperf  28.8 Mbits/sec

- Now use the same two devices and configure them into adhoc mode.
- Do an iperf between the same two nodes.

iperf  21.3 Mbits/sec
>Fix:


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-wireless 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Mon Mar 12 11:36:12 UTC 2012 
Responsible-Changed-Why:  
Over to maintainer(s). 

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

From: Johann Hugo <jhugo@meraka.csir.co.za>
To: bug-followup@freebsd.org,
 jhugo@meraka.csir.co.za
Cc:  
Subject: Re: kern/165969: [ath] Slower performance in adhoc mode vs Client/AP mode, same HW
Date: Thu, 12 Apr 2012 15:42:31 +0200

 --Boundary-00=_HvthP91+WvoKOR8
 Content-Type: multipart/alternative;
   boundary="Boundary-01=_HvthPjLCbO6xmZd"
 Content-Transfer-Encoding: 7bit
 
 --Boundary-01=_HvthPjLCbO6xmZd
 Content-Type: text/plain;
   charset="us-ascii"
 Content-Transfer-Encoding: 7bit
 
 The problem originates from  the big 802.11/HAL code changes between FreeBSD-7 
 and FreeBSD-8. 
 
 Here is the output of athregs, athregs -d and athregs -q for both FreeBSD 7.4-
 STABLE and for FreeBSD 8.0-RELEASE.
 
 
 --Boundary-01=_HvthPjLCbO6xmZd
 Content-Type: text/html;
   charset="us-ascii"
 Content-Transfer-Encoding: 7bit
 
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
 <html><head><meta name="qrichtext" content="1" /><style type="text/css">
 p, li { white-space: pre-wrap; }
 </style></head><body style=" font-family:'Bitstream Vera Sans'; font-size:8pt; font-weight:400; font-style:normal;">
 <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">The problem originates from  the big 802.11/HAL code changes between FreeBSD-7 and FreeBSD-8. </p>
 <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; ">&nbsp;</p>
 <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Here is the output of athregs, athregs -d and athregs -q for both FreeBSD 7.4-STABLE and for FreeBSD 8.0-RELEASE.</p>
 <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; ">&nbsp;</p>
 <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; ">&nbsp;</p></body></html>
 --Boundary-01=_HvthPjLCbO6xmZd--
 
 --Boundary-00=_HvthP91+WvoKOR8
 Content-Type: text/plain;
   charset="UTF-8";
   name="athregs-FreeBSD-7.4-STABLE.txt"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: attachment;
 	filename="athregs-FreeBSD-7.4-STABLE.txt"
 
 FreeBSD 7.4-STABLE
 
 mesh-2893# iperf -c 192.168.1.1
 ------------------------------------------------------------
 Client connecting to 192.168.1.1, TCP port 5001
 TCP window size: 32.5 KByte (default)
 ------------------------------------------------------------
 [  3] local 192.168.1.2 port 53140 connected with 192.168.1.1 port 5001
 [ ID] Interval       Transfer     Bandwidth
 [  3]  0.0-10.0 sec  35.1 MBytes  29.4 Mbits/sec
 mesh-2893# athregs
 CR       00000004 RXDP     07c69120 CFG      00000120 IER      00000001
 TXCFG    00000015 RXCFG    00000005 MIBC     00000000 TOPS     00000008
 RXNPTO   00000008 TXNPTO   00000010 RPGTO    00000000 RPCNT    0000001f
 MACMISC  00000000 SPC_0    00d65af0 SPC_1    00000000 DMADBG0  88888888
 DMADBG1  00000000 DMADBG2  12249249 DMADBG3  00000000 DMADBG4  00000000
 DMADBG5  00000000 DMADBG6  001327f0 DMADBG7  00000000 DCM_A    00000004
 DCM_D    00000000 DCCFG    00000002 CCFG     00000000 CCUCFG   0010020a
 CPC0     00000000 CPC1     00000000 CPC2     00000000 CPC3     00000000
 CPCOVF   00000000 D_SIFS   00000230 D_SLOT   00000168 D_EIFS   00000e60
 D_MISC   0000a0e0 D_SEQ    0000085f D_FPCTL  000003e0 D_TXPSE  00010000
 RC       00000000 SCR      00000000 INTPEND  00000000 SFR      00000000
 PCICFG   00000054 GPIOCR   00000000 GPIODO   00000000 GPIODI   00000017
 SREV     000000a4 PCIEPMC  00000010 SERDES   00000000 SERDES2  00000000
 STA_ID0  4f488000 STA_ID1  1882ee2a BSS_ID0  4f488000 BSS_ID1  00009028
 SLOTTIME 00000000 TIME_OUT 03e803e8 RSSI_THR 00000781 USEC     128d93a7
 BEACON   00000064 CFP_PER  00000000 TIMER0   000016b4 TIMER1   0000b590
 TIMER2   0040b550 TIMER3   000016b5 CFP_DUR  00000000 RXFILTER 00000097
 MCAST_0  00000001 MCAST_1  00000040 DIAG_SW  00000000 TSF_L32  2059d6b4
 TSF_U32  00000000 TST_ADAC 00000000 DEF_ANT  00000001 QOS_MASK 000fc78f
 SEQ_MASK 0000000f OBSERV2  00000000 OBSERV1  00002888 LAST_TST 205880c7
 NAV      00000000 RTS_OK   00000000 RTS_FAIL 00000000 ACK_FAIL 00000000
 FCS_FAIL 00000000 BEAC_CNT 00000000 SLEEP1   0510b3ba SLEEP2   0200b3b5
 SLEEP3   00030002 BSSMSKL  ffffffff BSSMSKU  0000ffff TPC      002e2e2e
 TFCNT    07ed78e4 RFCNT    01a88586 RCCNT    09e3252a CCCNT    8e5afa1d
 QUIET1   00001676 QUIET2   00010002 TSF_PARM 00000001 NOACK    00000052
 PHY_ERR  00000000 QOS_CTRL 000100aa QOS_SEL  00003210 MISCMODE 00000004
 FILTOFDM 00000076 FILTCCK  00000000 PHYCNT1  00bffe0c PHYCMSK1 00020000
 PHYCNT2  00bfff38 PHYCMSK2 02000000
 mesh-2893# athregs -d
 D[0] MASK 00000001 IFS 007ffc0f RTRY 0008200a CHNT 00000000 MISC 000100
 D[1] MASK 00000002 IFS 002ffc0f RTRY 0008200a CHNT 00100800 MISC 000100
 D[2] MASK 00000004 IFS 00203c07 RTRY 0008200a CHNT 00100bc0 MISC 000100
 D[3] MASK 00000008 IFS 00201c03 RTRY 0008200a CHNT 001005e0 MISC 000100
 D[4] MASK 00000010 IFS 002ffc0f RTRY 00020804 CHNT 00000000 MISC 001002
 D[5] MASK 00000020 IFS 002ffc0f RTRY 00020804 CHNT 00000000 MISC 001002
 D[6] MASK 00000040 IFS 002ffc0f RTRY 00020804 CHNT 00000000 MISC 001002
 D[7] MASK 00000080 IFS 002ffc0f RTRY 00020804 CHNT 00000000 MISC 001002
 D[8] MASK 00000100 IFS 002ffc0f RTRY 0008200a CHNT 00000000 MISC 040100
 D[9] MASK 00000200 IFS 002ffc1f RTRY 0008200a CHNT 00000000 MISC 250100
 mesh-2893# athregs -q
 Q_TXE    00000200  Q_TXD    00000000  Q_RDYTIMSHD 00000000
 Q_ONESHOTARM_SC 00000000  Q_ONESHOTARM_CC 00000000
 Q[0] TXDP 00000000 CBR 00000000 RDYT 00000000 MISC 00000800 STS 00000000
 Q[1] TXDP 07c8ec40 CBR 00000000 RDYT 00000000 MISC 00000800 STS 00000000
 Q[2] TXDP 00000000 CBR 00000000 RDYT 00000000 MISC 00000800 STS 00000000
 Q[3] TXDP 00000000 CBR 00000000 RDYT 00000000 MISC 00000800 STS 00000000
 Q[4] TXDP 00000000 CBR 00000000 RDYT 00000000 MISC 00000000 STS 00000000
 Q[5] TXDP 00000000 CBR 00000000 RDYT 00000000 MISC 00000000 STS 00000000
 Q[6] TXDP 00000000 CBR 00000000 RDYT 00000000 MISC 00000000 STS 00000000
 Q[7] TXDP 00000000 CBR 00000000 RDYT 00000000 MISC 00000000 STS 00000000
 Q[8] TXDP 00000000 CBR 00000000 RDYT 01017000 MISC 00000862 STS 00000000
 Q[9] TXDP 07caf000 CBR 00000000 RDYT 00000000 MISC 000008a2 STS 00000000
 --Boundary-00=_HvthP91+WvoKOR8
 Content-Type: text/plain;
   charset="UTF-8";
   name="athregs-FreeBSD-8.0-RELEASE.txt"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: attachment;
 	filename="athregs-FreeBSD-8.0-RELEASE.txt"
 
 FreeBSD 8.0-RELEASE
 
 mesh-2893# iperf -c 192.168.1.1
 ------------------------------------------------------------
 Client connecting to 192.168.1.1, TCP port 5001
 TCP window size: 32.5 KByte (default)
 ------------------------------------------------------------
 [  3] local 192.168.1.2 port 29927 connected with 192.168.1.1 port 5001
 [ ID] Interval       Transfer     Bandwidth
 [  3]  0.0-10.0 sec  24.4 MBytes  20.4 Mbits/sec
 mesh-2893# athregs
 CR       00000004 RXDP     07d46c60 CFG      00000120 IER      00000001
 TXCFG    00000015 RXCFG    00000005 MIBC     00000000 TOPS     00000008
 RXNPTO   00000008 TXNPTO   00000010 RPGTO    00000000 RPCNT    0000001f
 MACMISC  00000000 SPC_0    00b84261 SPC_1    00000000 DMADBG0  88888888
 DMADBG1  00000000 DMADBG2  12249249 DMADBG3  00000000 DMADBG4  00000000
 DMADBG5  00000000 DMADBG6  001327f0 DMADBG7  00000000 DCM_A    00000000
 DCM_D    00000000 DCCFG    00000002 CCFG     00000000 CCUCFG   0010020a
 CPC0     00000000 CPC1     00000000 CPC2     00000000 CPC3     00000000
 CPCOVF   00000000 D_SIFS   00000230 D_SLOT   00000168 D_EIFS   00000e60
 D_MISC   0000a0e0 D_SEQ    00000170 D_FPCTL  000003e0 D_TXPSE  00010000
 RC       00000000 SCR      00000000 INTPEND  00000000 SFR      00000000
 PCICFG   00000054 GPIOCR   00000000 GPIODO   00000000 GPIODI   00000017
 SREV     000000a4 PCIEPMC  00000010 SERDES   00000000 SERDES2  00000000
 STA_ID0  4f488000 STA_ID1  1882ee2a BSS_ID0  4f488000 BSS_ID1  00009028
 SLOTTIME 00000000 TIME_OUT 03e803e8 RSSI_THR 00000781 USEC     128d93a7
 BEACON   00000064 CFP_PER  00000000 TIMER0   000067e0 TIMER1   00033ef0
 TIMER2   0001e0f0 TIMER3   000067e1 CFP_DUR  00000000 RXFILTER 00000097
 MCAST_0  00000001 MCAST_1  00000040 DIAG_SW  00000000 TSF_L32  e19f0162
 TSF_U32  00000073 TST_ADAC 00000000 DEF_ANT  00000001 QOS_MASK 000fc78f
 SEQ_MASK 0000000f OBSERV2  00000000 OBSERV1  00002898 LAST_TST e0431c1e
 NAV      00000000 RTS_OK   00000000 RTS_FAIL 00000000 ACK_FAIL 00000000
 FCS_FAIL 00000000 BEAC_CNT 00000000 SLEEP1   05133e0a SLEEP2   02033e05
 SLEEP3   00030002 BSSMSKL  ffffffff BSSMSKU  0000ffff TPC      002a2a2a
 TFCNT    0ad11813 RFCNT    0267b662 RCCNT    0dba3e01 CCCNT    98426b34
 QUIET1   000067c2 QUIET2   00010002 TSF_PARM 00000001 NOACK    00000052
 PHY_ERR  00000000 QOS_CTRL 000100aa QOS_SEL  00003210 MISCMODE 00000004
 FILTOFDM 000000b5 FILTCCK  00000000 PHYCNT1  00bffe0c PHYCMSK1 00020000
 PHYCNT2  00bfff38 PHYCMSK2 02000000
 mesh-2893# athregs -d
 D[0] MASK 00000001 IFS 007ffc0f RTRY 0008200a CHNT 00000000 MISC 000100
 D[1] MASK 00000002 IFS 003ffc0f RTRY 0008200a CHNT 00000000 MISC 000100
 D[2] MASK 00000004 IFS 00203c07 RTRY 0008200a CHNT 00100bc0 MISC 000100
 D[3] MASK 00000008 IFS 00201c03 RTRY 0008200a CHNT 001005e0 MISC 000100
 D[4] MASK 00000010 IFS 002ffc0f RTRY 00020804 CHNT 00000000 MISC 001002
 D[5] MASK 00000020 IFS 002ffc0f RTRY 00020804 CHNT 00000000 MISC 001002
 D[6] MASK 00000040 IFS 002ffc0f RTRY 00020804 CHNT 00000000 MISC 001002
 D[7] MASK 00000080 IFS 002ffc0f RTRY 00020804 CHNT 00000000 MISC 001002
 D[8] MASK 00000100 IFS 002ffc0f RTRY 0008200a CHNT 00000000 MISC 040100
 D[9] MASK 00000200 IFS 003ffc1f RTRY 0008200a CHNT 00000000 MISC 250100
 mesh-2893# athregs -q
 Q_TXE    00000200  Q_TXD    00000000  Q_RDYTIMSHD 00000000
 Q_ONESHOTARM_SC 00000000  Q_ONESHOTARM_CC 00000000
 Q[0] TXDP 00000000 CBR 00000000 RDYT 00000000 MISC 00000800 STS 00000000
 Q[1] TXDP 07c6ea40 CBR 00000000 RDYT 00000000 MISC 00000800 STS 00000000
 Q[2] TXDP 00000000 CBR 00000000 RDYT 00000000 MISC 00000800 STS 00000000
 Q[3] TXDP 00000000 CBR 00000000 RDYT 00000000 MISC 00000800 STS 00000000
 Q[4] TXDP 00000000 CBR 00000000 RDYT 00000000 MISC 00000000 STS 00000000
 Q[5] TXDP 00000000 CBR 00000000 RDYT 00000000 MISC 00000000 STS 00000000
 Q[6] TXDP 00000000 CBR 00000000 RDYT 00000000 MISC 00000000 STS 00000000
 Q[7] TXDP 00000000 CBR 00000000 RDYT 00000000 MISC 00000000 STS 00000000
 Q[8] TXDP 00000000 CBR 00000000 RDYT 01017000 MISC 00000862 STS 00000000
 Q[9] TXDP 07c6f000 CBR 00000000 RDYT 00000000 MISC 000008a2 STS 00000000
 --Boundary-00=_HvthP91+WvoKOR8--
>Unformatted:
