Netdev List
 help / color / mirror / Atom feed
* [PATCH net] igc: remove napi_synchronize() in igc_down()
@ 2026-07-12 13:22 David Carlier
  2026-07-13  9:42 ` Maciej Fijalkowski
  0 siblings, 1 reply; 4+ messages in thread
From: David Carlier @ 2026-07-12 13:22 UTC (permalink / raw)
  To: intel-wired-lan, netdev
  Cc: anthony.l.nguyen, przemyslaw.kitszel, maciej.fijalkowski,
	aleksandr.loktionov, advoretsky, stable, David Carlier

When an AF_XDP zero-copy application is killed abruptly, the XSK pool is
torn down but NAPI keeps polling. igc_clean_rx_irq_zc() then returns the
full budget on every poll, so napi_complete_done() never clears
NAPI_STATE_SCHED.

igc_down() calls napi_synchronize() before napi_disable(), so it spins
forever waiting for that bit and the interface never goes down. Drop the
napi_synchronize() and let napi_disable() do the job -- it sets
NAPI_STATE_DISABLE, which forces the stuck poll to complete. Reorder it
ahead of igc_set_queue_napi() so the NAPI mapping is cleared only after
polling has stopped, matching the recent igb fix b1e067240379.

Fixes: fc9df2a0b520 ("igc: Enable RX via AF_XDP zero-copy")
Suggested-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Cc: stable@vger.kernel.org
Signed-off-by: David Carlier <devnexen@gmail.com>
---
 drivers/net/ethernet/intel/igc/igc_main.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c
index 2c9e2dfd8499..b3883a5a7d7a 100644
--- a/drivers/net/ethernet/intel/igc/igc_main.c
+++ b/drivers/net/ethernet/intel/igc/igc_main.c
@@ -5352,9 +5352,8 @@ void igc_down(struct igc_adapter *adapter)
 
 	for (i = 0; i < adapter->num_q_vectors; i++) {
 		if (adapter->q_vector[i]) {
-			napi_synchronize(&adapter->q_vector[i]->napi);
-			igc_set_queue_napi(adapter, i, NULL);
 			napi_disable(&adapter->q_vector[i]->napi);
+			igc_set_queue_napi(adapter, i, NULL);
 		}
 	}
 
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net] igc: remove napi_synchronize() in igc_down()
  2026-07-12 13:22 [PATCH net] igc: remove napi_synchronize() in igc_down() David Carlier
@ 2026-07-13  9:42 ` Maciej Fijalkowski
  2026-07-20  7:39   ` [Intel-wired-lan] " Ruinskiy, Dima
  0 siblings, 1 reply; 4+ messages in thread
From: Maciej Fijalkowski @ 2026-07-13  9:42 UTC (permalink / raw)
  To: David Carlier
  Cc: intel-wired-lan, netdev, anthony.l.nguyen, przemyslaw.kitszel,
	aleksandr.loktionov, advoretsky, stable

On Sun, Jul 12, 2026 at 02:22:42PM +0100, David Carlier wrote:
> When an AF_XDP zero-copy application is killed abruptly, the XSK pool is
> torn down but NAPI keeps polling. igc_clean_rx_irq_zc() then returns the
> full budget on every poll, so napi_complete_done() never clears
> NAPI_STATE_SCHED.
> 
> igc_down() calls napi_synchronize() before napi_disable(), so it spins
> forever waiting for that bit and the interface never goes down. Drop the
> napi_synchronize() and let napi_disable() do the job -- it sets
> NAPI_STATE_DISABLE, which forces the stuck poll to complete. Reorder it
> ahead of igc_set_queue_napi() so the NAPI mapping is cleared only after
> polling has stopped, matching the recent igb fix b1e067240379.
> 
> Fixes: fc9df2a0b520 ("igc: Enable RX via AF_XDP zero-copy")
> Suggested-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
> Cc: stable@vger.kernel.org
> Signed-off-by: David Carlier <devnexen@gmail.com>

Reviewed-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>

This is a mirror of what Alex Dvoretsky did on igb, correct? Did you
reproduce the same issue on your side or is it a blind shot at this
driver?

Regardless, I think it's a correct thing to do, but some clarification
would be nice.

> ---
>  drivers/net/ethernet/intel/igc/igc_main.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c
> index 2c9e2dfd8499..b3883a5a7d7a 100644
> --- a/drivers/net/ethernet/intel/igc/igc_main.c
> +++ b/drivers/net/ethernet/intel/igc/igc_main.c
> @@ -5352,9 +5352,8 @@ void igc_down(struct igc_adapter *adapter)
>  
>  	for (i = 0; i < adapter->num_q_vectors; i++) {
>  		if (adapter->q_vector[i]) {
> -			napi_synchronize(&adapter->q_vector[i]->napi);
> -			igc_set_queue_napi(adapter, i, NULL);
>  			napi_disable(&adapter->q_vector[i]->napi);
> +			igc_set_queue_napi(adapter, i, NULL);
>  		}
>  	}
>  
> -- 
> 2.53.0
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Intel-wired-lan] [PATCH net] igc: remove napi_synchronize() in igc_down()
  2026-07-13  9:42 ` Maciej Fijalkowski
@ 2026-07-20  7:39   ` Ruinskiy, Dima
  2026-07-20  8:13     ` Kadosh, MoriyaX
  0 siblings, 1 reply; 4+ messages in thread
From: Ruinskiy, Dima @ 2026-07-20  7:39 UTC (permalink / raw)
  To: Maciej Fijalkowski, David Carlier
  Cc: intel-wired-lan, netdev, anthony.l.nguyen, przemyslaw.kitszel,
	aleksandr.loktionov, advoretsky, stable

On 13/07/2026 12:42, Maciej Fijalkowski wrote:
> On Sun, Jul 12, 2026 at 02:22:42PM +0100, David Carlier wrote:
>> When an AF_XDP zero-copy application is killed abruptly, the XSK pool is
>> torn down but NAPI keeps polling. igc_clean_rx_irq_zc() then returns the
>> full budget on every poll, so napi_complete_done() never clears
>> NAPI_STATE_SCHED.
>>
>> igc_down() calls napi_synchronize() before napi_disable(), so it spins
>> forever waiting for that bit and the interface never goes down. Drop the
>> napi_synchronize() and let napi_disable() do the job -- it sets
>> NAPI_STATE_DISABLE, which forces the stuck poll to complete. Reorder it
>> ahead of igc_set_queue_napi() so the NAPI mapping is cleared only after
>> polling has stopped, matching the recent igb fix b1e067240379.
>>
>> Fixes: fc9df2a0b520 ("igc: Enable RX via AF_XDP zero-copy")
>> Suggested-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
>> Cc: stable@vger.kernel.org
>> Signed-off-by: David Carlier <devnexen@gmail.com>
> 
> Reviewed-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
> 
> This is a mirror of what Alex Dvoretsky did on igb, correct? Did you
> reproduce the same issue on your side or is it a blind shot at this
> driver?
> 
> Regardless, I think it's a correct thing to do, but some clarification
> would be nice.
> 
>> ---
>>   drivers/net/ethernet/intel/igc/igc_main.c | 3 +--
>>   1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c
>> index 2c9e2dfd8499..b3883a5a7d7a 100644
>> --- a/drivers/net/ethernet/intel/igc/igc_main.c
>> +++ b/drivers/net/ethernet/intel/igc/igc_main.c
>> @@ -5352,9 +5352,8 @@ void igc_down(struct igc_adapter *adapter)
>>   
>>   	for (i = 0; i < adapter->num_q_vectors; i++) {
>>   		if (adapter->q_vector[i]) {
>> -			napi_synchronize(&adapter->q_vector[i]->napi);
>> -			igc_set_queue_napi(adapter, i, NULL);
>>   			napi_disable(&adapter->q_vector[i]->napi);
>> +			igc_set_queue_napi(adapter, i, NULL);
>>   		}
>>   	}
>>   
>> -- 
>> 2.53.0
>>
Reviewed-by: Dima Ruinskiy <dima.ruinskiy@intel.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Intel-wired-lan] [PATCH net] igc: remove napi_synchronize() in igc_down()
  2026-07-20  7:39   ` [Intel-wired-lan] " Ruinskiy, Dima
@ 2026-07-20  8:13     ` Kadosh, MoriyaX
  0 siblings, 0 replies; 4+ messages in thread
From: Kadosh, MoriyaX @ 2026-07-20  8:13 UTC (permalink / raw)
  To: Ruinskiy, Dima, Maciej Fijalkowski, David Carlier
  Cc: intel-wired-lan, netdev, anthony.l.nguyen, przemyslaw.kitszel,
	aleksandr.loktionov, advoretsky, stable



On 20/07/2026 10:39, Ruinskiy, Dima wrote:
> On 13/07/2026 12:42, Maciej Fijalkowski wrote:
>> On Sun, Jul 12, 2026 at 02:22:42PM +0100, David Carlier wrote:
>>> When an AF_XDP zero-copy application is killed abruptly, the XSK pool is
>>> torn down but NAPI keeps polling. igc_clean_rx_irq_zc() then returns the
>>> full budget on every poll, so napi_complete_done() never clears
>>> NAPI_STATE_SCHED.
>>>
>>> igc_down() calls napi_synchronize() before napi_disable(), so it spins
>>> forever waiting for that bit and the interface never goes down. Drop the
>>> napi_synchronize() and let napi_disable() do the job -- it sets
>>> NAPI_STATE_DISABLE, which forces the stuck poll to complete. Reorder it
>>> ahead of igc_set_queue_napi() so the NAPI mapping is cleared only after
>>> polling has stopped, matching the recent igb fix b1e067240379.
>>>
>>> Fixes: fc9df2a0b520 ("igc: Enable RX via AF_XDP zero-copy")
>>> Suggested-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
>>> Cc: stable@vger.kernel.org
>>> Signed-off-by: David Carlier <devnexen@gmail.com>
>>
>> Reviewed-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
>>
>> This is a mirror of what Alex Dvoretsky did on igb, correct? Did you
>> reproduce the same issue on your side or is it a blind shot at this
>> driver?
>>
>> Regardless, I think it's a correct thing to do, but some clarification
>> would be nice.
>>
>>> ---
>>>   drivers/net/ethernet/intel/igc/igc_main.c | 3 +--
>>>   1 file changed, 1 insertion(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ 
>>> ethernet/intel/igc/igc_main.c
>>> index 2c9e2dfd8499..b3883a5a7d7a 100644
>>> --- a/drivers/net/ethernet/intel/igc/igc_main.c
>>> +++ b/drivers/net/ethernet/intel/igc/igc_main.c
>>> @@ -5352,9 +5352,8 @@ void igc_down(struct igc_adapter *adapter)
>>>       for (i = 0; i < adapter->num_q_vectors; i++) {
>>>           if (adapter->q_vector[i]) {
>>> -            napi_synchronize(&adapter->q_vector[i]->napi);
>>> -            igc_set_queue_napi(adapter, i, NULL);
>>>               napi_disable(&adapter->q_vector[i]->napi);
>>> +            igc_set_queue_napi(adapter, i, NULL);
>>>           }
>>>       }
>>> -- 
>>> 2.53.0
>>>
> Reviewed-by: Dima Ruinskiy <dima.ruinskiy@intel.com>
Tested-by: Moriya Kadosh <moriyax.kadosh@intel.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-07-20  8:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-12 13:22 [PATCH net] igc: remove napi_synchronize() in igc_down() David Carlier
2026-07-13  9:42 ` Maciej Fijalkowski
2026-07-20  7:39   ` [Intel-wired-lan] " Ruinskiy, Dima
2026-07-20  8:13     ` Kadosh, MoriyaX

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox