All of lore.kernel.org
 help / color / mirror / Atom feed
* [ath9k-devel] ath9k_hw_addrxbuf_edma
@ 2014-10-24 16:12 Astrit Zhushi
  2014-10-24 19:15 ` Adrian Chadd
  0 siblings, 1 reply; 13+ messages in thread
From: Astrit Zhushi @ 2014-10-24 16:12 UTC (permalink / raw)
  To: ath9k-devel

Hi,

I was wondering if someone can help me understand receiver buffer
management on the ath9k driver.

While running TCP experiments using an AP and a wireless node (both
running  AR9380 mini PCI-e cards, with PCI-e adapter) I noticed that
TCP was invoking fast retransmit. At the transmitter, the retry
counters didn't show that the frame was dropped. In addition, looking
at the over the air captured traces (by a third party wireless node),
the receiver's card actually acknowledges the missing frame and the
traces show only one transmission of the missing frame.
Instrumenting the driver I noticed that the missing frames are being
dropped because the received frame descriptor ID didn't match that of
the Athero's vendor ID.
That is, AR_DescId=0 and MS(rxsp->ds_info, AR_DescId) != 0x168c (maybe
replace it with ATHEROS_VENDOR_ID?) condition on ar9003_mac.c fails.

So I started looking at the way the receive buffers are managed by the
ath9k driver. This is my understanding so far:

Before the the card can use the DMA allocated buffers (the pool of 512
buffers kept in rx.rxbuf, they are added to ATH9K_RX_QUEUE_LP (128
buffers) or ATH9K_RX_QUEUE_HP (16 buffers) FIFO queues) and then the
hardware is told about the address by calling ath9k_hw_addrxbuf_edma
function. After which point the hardware can make use of those
buffers.

On a receive interrupt, the driver processes incoming buffers, calls
ath_edma_get_buffers, removes the buffer from rx_edma->rx_fifo
(__skb_unlink(skb, &rx_edma->rx_fifo). This buffer ends up being put
back to the rx.rxbuff pool.
I don't see any call informing the hardware that it shouldn't be using
that buffer. It could be that the equivalent of this is happening
somewhere in the code, but I am missing it?

The only place where the descriptor is memset to zero is when calling
ath_rx_edma_buf_link, before telling the hardware that it can use the
buffer. Now supposing that the card still thinks that it can use a
buffer, and memset(0) is called on the same buffer (because it is
being added back to the rx.rx_buf queue) wouldn't I end up receiving
frames where AR_DescId is 0?

I hope I was clear enough

Thanks,
Astrit

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2014-11-01 20:17 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-24 16:12 [ath9k-devel] ath9k_hw_addrxbuf_edma Astrit Zhushi
2014-10-24 19:15 ` Adrian Chadd
2014-10-25 10:38   ` Astrit Zhushi
2014-10-25 18:31     ` Adrian Chadd
2014-10-27 10:41       ` Astrit Zhushi
2014-10-27 18:24         ` Adrian Chadd
2014-10-28 11:14           ` Astrit Zhushi
2014-10-31 18:13             ` Astrit Zhushi
2014-10-31 22:13               ` Adrian Chadd
2014-11-01 12:58                 ` Astrit Zhushi
2014-11-01 14:46                   ` Ben Greear
2014-11-01 20:11                     ` Adrian Chadd
2014-11-01 20:17                       ` Astrit Zhushi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.