Subject: Re: ath Atheros driver no buffer space available and can't power off
To: None <fair@NetBSD.org, dyoung@pobox.com>
From: Alicia da Conceicao <alicia@engine.ca>
List: port-i386
Date: 04/23/2004 05:17:17
Hi everybody:

Something I forgot to say previously.  My laptop can boot multiple operating 
systems (including NetBSD & WinXP).  The Atheros 5212 uses the built-in
drivers in the WinXP kernel.  And with the same laptop, with the same
Atheros mini-pci cards and antennas, connected to the same Wi/Fi router in
the same location does not freeze under WinXP.  So there is no problem with
the hardware or router, and the freezing is a bug specifically with the
NetBSD ath driver.

I filed a couple of send-pr reports, but I don't have the PR number.  The
send-pr reporting system should return back the PR number, at the very least 
to confirm that it was received properly.  Still waiting to see it here:

        http://www.netbsd.org/Gnats/category/port-i386.html

David Young wrote:
>>       ping: sendto: No buffer space available
> I think that ath(4) might have a problem with mbuf exhaustion, although
> it is strange if only you and I have noticed.  Does it fully recover
> after 3-5 minutes?  That is strange.  Are you perhaps using your ath in
> ad hoc mode?

No, I am only using infrastructure mode only.  Note that if I do:
"ifconfig ath0 down ; sleep 2 ; ifconfig ath0 up" the ath driver unfreezes
within 20 seconds or so, instead of 2-5 minutes.
        
Erik E. Fair wrote:
> PR kern/7285 is related to this

Not really.  The lack of buffer space is a symptom due to the ath driver
freezing up network activity allowing the buffers to fit up.  The problem
that needs to be addressed is the ath driver freezing up in the first place.

The network freeze with the ath driver occurs even with a simple SSH session
with "hunt-n-peck" keystrokes (I can't touch-type).  This is a far cry from
a UDP blast as described in PR kern/7285.

David Young wrote:
> Just an addition to the above.  When the ath driver temporily halts
> the network activity:
>>       > wiconfig ath0 -D
>>       scanning ...
>>       No APs available
> I would not expect that ever to work.

But when the ath driver unfreezes, I do get a proper Wi/Fi scan and the
following ifconfig:

=============================================================================
# wiconfig ath0 -D
scanning ......
AP Information
ap[0]:
        netname (SSID):                 [ engine ]
        BSSID:                          [ 00:04:e2:8c:d5:56 ]
        Channel:                        [ 10 ]
        Quality/Signal/Noise [signal]:  [ 0 / 0 / 0 ]
                                [dBm]:  [ 0 / -149 / -149 ]
        BSS Beacon Interval [msec]:     [ 100 ]
        Capinfo:                        [ ESS WEP ]
        DataRate [Mbps]:                [ 11 ]
=============================================================================
ath0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        ssid engine nwkey 0x0123456789abcdef0123456789
        powersave off
        bssid 00:04:e2:8c:d5:56 chan 10
        address: 00:40:05:29:ad:ab
        media: IEEE802.11 autoselect mode 11b (DS11 mode 11b)
        status: active
        inet 192.168.2.9 netmask 0xffffff00 broadcast 192.168.2.255
=============================================================================

Keep in mind than when the ath driver freezes, the Wi/Fi router is still up
and my PocketPC Wi/Fi enabled PDA can use it for network access.

David Young wrote:
> BTW, I would like to see the netstat -m output when this happens.  Also,
> ifconfig ath0 output.

As requested see below:

=============================================================================
# netstat -m
112 mbufs in use:
        95 mbufs allocated to data
        6 mbufs allocated to packet headers
        11 mbufs allocated to socket names and addresses
0 calls to protocol drain routines
=============================================================================
# ifconfig ath0
ath0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        ssid engine nwkey 0x0123456789abcdef0123456789
        powersave off
        chan 10
        address: 00:40:05:29:ad:ab
        media: IEEE802.11 autoselect mode 11b (DS1 mode 11b)
        status: no network
        inet 192.168.2.9 netmask 0xffffff00 broadcast 192.168.2.255
=============================================================================

Remember this network freeze occurs every though the Wi/Fi router (access
point) is in the same room, just 3-5 meters away, and the laptop is
stationary.  And during the network freeze on my laptop, my Wi/Fi PDA can
just access the Internet.

Any help with the network freeze is greatly appreciated.

Thanks in advance.
Alicia.