arge1 on TL WDR3600

Eugene Grosbein eugen at grosbein.net
Thu Oct 29 21:15:20 UTC 2015


On 30.10.2015 01:41, Adrian Chadd wrote:
> AH, ok. So it says TX_UNDERRUN + TX_PKT_SENT. So hm.
> 
> The way this is supposed to work is .. odd.
> 
> You queue TX packets to the hardware. The hardware increments
> TXPKTCOUNT in the TX DMA status register.
> 
> Then for each packet you see transmitted, you write TXPKTSENT to the
> TX DMA status register and that decrements TXPKTCOUNT. Once it's zero,
> you won't see any more TX interrupts.
> 
> Now, the 'arge_tx_cnt' value tracks that; it should be zero if it's
> idle. It's 126, which means there are still things to process. there's
> 128 ring slots, so that prod/cons value indicates there's 126 things
> in the ring. arge_tx_locked() does the decrementing and poking
> TXPKTSENT.
> 
> So, I bet the driver and hardware is out of sync. I bet that the (ctrl
> & ARGE_DESC_EMPTY) check is triggering on the current frame in that
> ring. I don't know if it's because prod/cons are out of whack, or it's
> currently trying to check a descriptor in a multi-frame TX descriptor,
> or whether the hardware is just plain buggy and it didn't update that.
> But, that's actually what's going on.
> 
> So that's my 5 minute analysis of it. I wish I could reproduce it on
> what I have here because then I could see what the state of the ring
> is and whether the hardware is buggy or our tx prod/cons tracking is
> busted. I'd reaally appreciate help here :(

I do not think that hardware is buggy because several versions of "official"
TP-Link firmware work just fine with this particular device and earlier
versions of FreeBSD 11 also work without interrupt storms.

In fact, I've applied dichotomy and found guilty commit. It took 12 iterations
but here is it: kernel built using head at r289897 runs my test without a storm
(but forwarding speed is pretty bad) and kernel built with r289898 or later
revisions has interrupt storm.

This is the change:
https://svnweb.freebsd.org/base/head/sys/mips/atheros/if_arge.c?r1=289744&r2=289898&view=patch

My device has hw.model: Atheros AR9344 rev 2




More information about the freebsd-mips mailing list