freebsd-nq/sys
Adrian Chadd 629ce2188a Implement "holding buffers" per TX queue rather than globally.
When working on TDMA, Sam Leffler found that the MAC DMA hardware
would re-read the last TX descriptor when getting ready to transmit
the next one.  Thus the whole ATH_BUF_BUSY came into existance -
the descriptor must be left alone (very specifically the link pointer
must be maintained) until the hardware has moved onto the next frame.

He saw this in TDMA because the MAC would be frequently stopping during
active transmit (ie, when it wasn't its turn to transmit.)

Fast-forward to today.  It turns out that this is a problem not with
a single MAC DMA instance, but with each QCU (from 0->9).  They each
maintain separate descriptor pointers and will re-read the last
descriptor when starting to transmit the next.

So when your AP is busy transmitting from multiple TX queues, you'll
(more) frequently see one QCU stopped, waiting for a higher-priority QCU
to finsh transmitting, before it'll go ahead and continue.  If you mess
up the descriptor (ie by freeing it) then you're short of luck.

Thanks to rpaulo for sticking with me whilst I diagnosed this issue
that he was quite reliably triggering in his environment.

This is a reimplementation; it doesn't have anything in common with
the ath9k or the Qualcomm Atheros reference driver.

Now - it in theory doesn't apply on the EDMA chips, as long as you
push one complete frame into the FIFO at a time.  But the MAC can DMA
from a list of frames pushed into the hardware queue (ie, you concat
'n' frames together with link pointers, and then push the head pointer
into the TXQ FIFO.)  Since that's likely how I'm going to implement
CABQ handling in hostap mode, it's likely that I will end up teaching
the EDMA TX completion code about busy buffers, just to be "sure"
this doesn't creep up.

Tested - iperf ap->sta and sta->ap (with both sides running this code):

* AR5416 STA
* AR9160/AR9220 hostap

To validate that it doesn't break the EDMA (FIFO) chips:

* AR9380, AR9485, AR9462 STA

Using iperf with the -S <tos byte decimal value> to set the TCP client
side DSCP bits, mapping to different TIDs and thus different TX queues.

TODO:

* Make this work on the EDMA chips, if we end up pushing lists of frames
  to the hardware (eg how we eventually will handle cabq in hostap/ibss
  mode.)
2013-03-14 06:20:02 +00:00
..
amd64 The kernel pmap is statically allocated, so there is really no need to 2013-03-10 21:07:44 +00:00
arm Functions m_getm2() and m_get2() have different order of arguments, 2013-03-12 13:42:47 +00:00
boot Attach the elf section headers to the loaded kernel as metadata, so 2013-03-10 00:43:01 +00:00
bsm - Implement two new system calls: 2013-03-02 21:11:30 +00:00
cam Re-enable CTL in GENERIC on i386 and amd64, but turn on the CTL disable 2013-03-04 21:18:45 +00:00
cddl Switch the vm_object mutex to be a rwlock. This will enable in the 2013-03-09 02:32:23 +00:00
compat Switch the vm_object mutex to be a rwlock. This will enable in the 2013-03-09 02:32:23 +00:00
conf Add __aeabi_memcpy to libkern as clang may generate calls to it. 2013-03-10 07:55:40 +00:00
contrib Simplify TAILQ usage and avoid additional memory allocations. 2013-03-05 08:08:16 +00:00
crypto When porting XTS-related code from OpenBSD I forgot to update copyright (only 2013-02-20 22:59:53 +00:00
ddb Small textdump enhancements. 2012-11-01 04:07:08 +00:00
dev Implement "holding buffers" per TX queue rather than globally. 2013-03-14 06:20:02 +00:00
fs Revert 195703 and 195821 as this special stop handling in NFS is now 2013-03-13 21:06:03 +00:00
gdb
geom Add legacy support to geom raid to create a /dev/arX device for support 2013-03-08 20:07:32 +00:00
gnu/fs/reiserfs Garbage collect XFS bits which are now already completely disconnected 2013-03-02 15:33:54 +00:00
i386 The kernel pmap is statically allocated, so there is really no need to 2013-03-10 21:07:44 +00:00
ia64 Switch the vm_object mutex to be a rwlock. This will enable in the 2013-03-09 02:32:23 +00:00
isa
kern - Fix two possible overflows when testing if ELF program headers are on 2013-03-13 22:01:31 +00:00
kgssapi Piete.Brooks at cl.cam.ac.uk reported via email a crash which was 2012-12-18 00:25:48 +00:00
libkern Add __aeabi_memcpy to libkern as clang may generate calls to it. 2013-03-10 07:55:40 +00:00
mips Switch the vm_object mutex to be a rwlock. This will enable in the 2013-03-09 02:32:23 +00:00
modules Disable warning/errors for two files for now - they don't compile clean 2013-03-14 00:27:53 +00:00
net Functions m_getm2() and m_get2() have different order of arguments, 2013-03-12 13:42:47 +00:00
net80211 Kill this, it's not needed at this point and (hopefully) the parent 2013-03-10 04:38:06 +00:00
netatalk Mechanically substitute flags from historic mbuf allocator with 2012-12-05 08:04:20 +00:00
netgraph Fix compilation warning. 2013-02-15 07:58:51 +00:00
netinet Functions m_getm2() and m_get2() have different order of arguments, 2013-03-12 13:42:47 +00:00
netinet6 Take the inpcb rlock before calculating checksum, it was accidentally 2013-03-12 02:20:20 +00:00
netipsec Mechanically substitute flags from historic mbuf allocator with 2012-12-05 08:04:20 +00:00
netipx Mechanically substitute flags from historic mbuf allocator with 2012-12-05 08:04:20 +00:00
netnatm Mechanically substitute flags from historic mbuf allocator with 2012-12-05 08:04:20 +00:00
netpfil Functions m_getm2() and m_get2() have different order of arguments, 2013-03-12 13:42:47 +00:00
netsmb Call make_dev_credf() rather than using the couple make_dev()/dev_ref(). 2013-03-09 16:58:19 +00:00
nfs Functions m_getm2() and m_get2() have different order of arguments, 2013-03-12 13:42:47 +00:00
nfsclient Revert 195703 and 195821 as this special stop handling in NFS is now 2013-03-13 21:06:03 +00:00
nfsserver Switch the vm_object mutex to be a rwlock. This will enable in the 2013-03-09 02:32:23 +00:00
nlm Remove the support for using non-mpsafe filesystem modules. 2012-10-22 17:50:54 +00:00
ofed Switch the vm_object mutex to be a rwlock. This will enable in the 2013-03-09 02:32:23 +00:00
opencrypto When porting XTS-related code from OpenBSD I forgot to update copyright (only 2013-02-20 22:59:53 +00:00
pc98 Switch the vm_object mutex to be a rwlock. This will enable in the 2013-03-09 02:32:23 +00:00
pci Fix build. 2013-02-21 12:52:18 +00:00
powerpc Switch the vm_object mutex to be a rwlock. This will enable in the 2013-03-09 02:32:23 +00:00
rpc Revert 195703 and 195821 as this special stop handling in NFS is now 2013-03-13 21:06:03 +00:00
security Switch the vm_object mutex to be a rwlock. This will enable in the 2013-03-09 02:32:23 +00:00
sparc64 Switch the vm_object mutex to be a rwlock. This will enable in the 2013-03-09 02:32:23 +00:00
sys Bump __FreeBSD_version after r248084, breaking VM KPI to introduce 2013-03-12 14:30:36 +00:00
teken
tools Further refine the handling of stop signals in the NFS client. The 2013-02-21 19:02:50 +00:00
ufs Switch the vm_object mutex to be a rwlock. This will enable in the 2013-03-09 02:32:23 +00:00
vm Simplify vm_page_is_valid(). 2013-03-12 12:20:49 +00:00
x86 MFcalloutng: 2013-02-28 13:46:03 +00:00
xdr Finish r243882: mechanically substitute flags from historic mbuf 2013-03-12 08:59:51 +00:00
xen Move the corresponding MTX_SYSINIT() next to their struct mtx declaration 2012-10-26 17:31:35 +00:00
Makefile Remove netncp cscope entry missed in r248097 2013-03-12 14:21:52 +00:00