Re: [Intel-wired-lan] [PATCH iwl-net v2] igc: Fix infinite initialization loop with early XDP redirect

From: naamax.meir
Date: Wed Sep 13 2023 - 06:56:35 EST


On 9/7/2023 03:30, Vinicius Costa Gomes wrote:
When a XDP redirect happens before the link is ready, that
transmission will not finish and will timeout, causing an adapter
reset. If the redirects do not stop, the adapter will not stop
resetting.

Wait for the driver to signal that there's a carrier before allowing
transmissions to proceed.

Previous code was relying that when __IGC_DOWN is cleared, the NIC is
ready to transmit as all the queues are ready, what happens is that
the carrier presence will only be signaled later, after the watchdog
workqueue has a chance to run. And during this interval (between
clearing __IGC_DOWN and the watchdog running) if any transmission
happens the timeout is emitted (detected by igc_tx_timeout()) which
causes the reset, with the potential for the inifite loop.

Fixes: 4ff320361092 ("igc: Add support for XDP_REDIRECT action")
Reported-by: Ferenc Fejes <ferenc.fejes@xxxxxxxxxxxx>
Closes: https://lore.kernel.org/netdev/0caf33cf6adb3a5bf137eeaa20e89b167c9986d5.camel@xxxxxxxxxxxx/
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@xxxxxxxxx>
Tested-by: Ferenc Fejes <ferenc.fejes@xxxxxxxxxxxx>
Reviewed-by: Maciej Fijalkowski <maciej.fijalkowski@xxxxxxxxx>
---
v1 -> v2:
- Added more information to the commit message (Maciej Fijalkowski)


drivers/net/ethernet/intel/igc/igc_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Tested-by: Naama Meir <naamax.meir@xxxxxxxxxxxxxxx>