Subject: Re: BQL support in gianfar causes network hiccup

From: Claudiu Manoil <[email-masked]>
Date: Tue, 3 Sep 2013 19:09:45 +0300

On 9/3/2013 6:42 PM, Eric Dumazet wrote:
> On Tue, 2013-09-03 at 09:55 +0200, Per Dalén wrote:
>
>> Yes, it's weird. The only reason I removed the BQL commit
>> (d8a0f1b0af67679bba886784de10d8c21acc4e0e) was because the error Tino
>> Keitel had was the similar as mine.
>
>
> I suspect a genuine race in this driver. BQL only makes this race happen
> more often.
>
> gfar_poll_sq() has the following :
>
> /* run Tx cleanup to completion */
> if (tx_queue->tx_skbuff[tx_queue->skb_dirtytx])
>          gfar_clean_tx_ring(tx_queue);
>
> While gfar_poll() has a different method :
>
> if (tx_queue->tx_skbuff[tx_queue->skb_dirtytx]) {
>      gfar_clean_tx_ring(tx_queue);
>      has_tx_work = 1;
> }
>
> Note the has_tx_work use in gfar_poll() only.
>
> Note that memory barriers seems to be missing.
>
> 1) In your cases, is it gfar_poll_sq() or gfar_poll() that is used ?
>

It's gfar_poll_sq(). P2020 single Tx/Rx queues.

I'm also seeing carrier errors and packet collisions in this case
(100/Half link).

> 2) Is the bug happening if only one CPU is used ?
>

I didn't try this. Maybe Per did?