Re: [PATCH net 2/2] net: bcmgenet: fix racing timeout handler

Justin Chen
2026-03-31T23:15:45Z

On 3/27/26 9:13 PM, Jakub Kicinski wrote:
> On Thu, 26 Mar 2026 11:45:29 -0700 justin.chen@broadcom.com wrote:
>> The bcmgenet_timeout handler tries to take down all tx queues when
>> a single queue times out. This is over zealous and causes many race
>> conditions with queues that are still chugging along. Instead lets
>> only restart the timed out queue.
>
> FWIW AI seems to suggest we should also stop NAPI and the DMA in this
> case, just to make sure that the queue in question doesn't suddenly
> wake up either. Which seems fair but probably as a follow up and only
> if not too hard in itself..

Yea this crossed my mind. I was thinking we might need to grab the ring
lock here in case we race on the napi tx relcaim. But in my testing, I
wasn't able to reproduce the lock up with these changes as is. But might
be worth throwing a lock in there anyways. I don't think we need to halt
the DMA, since we clean up everything, worst outcome is a packet gets
sent out when we tag it as being dropped.

Thanks,
Justin