Re: [PATCH net] net: 8139cp: close race between NAPI completion and Rx unmask
From: Colton Pawielski
Date: Tue Oct 27 2026 - 19:43:18 EST
On Mon, 26 Oct 2026 00:06:15 +0000, netdev-bot+sashiko@xxxxxxxxxx wrote:
> Wouldn't this CPU then spin forever on a cp->lock it already holds? On
> SMP, one ARP request or ping from a peer on the link looks like enough to
> trigger it.
Yes, this is correct. napi_complete_done() flushes GRO into the
stack, and a reply sent from there re-enters cp_start_xmit() while
cp->lock is held. The LANDISK is UP, so it didn't surface in my testing.
I reproduced it in QEMU (x86_64, -smp 4), where v1 locks up shortly
after link up, and on a Raspberry Pi CM4 with an RTL8139C+ PCI card,
where lockdep complains within seconds. I should have tested it on
a wider variety of hardware configs, lesson learned.
v2 will leave cp_rx_poll() as it is and fix the race from the
cp_interrupt() side instead.
Daniel, Geert: thanks for testing. Since the fix is changing, I'll
drop your Tested-by tags from v2 and Cc you on it.
Thanks,
Colton
pw-bot: cr