igc: remove napi_synchronize() in igc_down()
Subsystems (4)
PATCH 1/1 igc: remove napi_synchronize() in igc_down()
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.
--- drivers/net/ethernet/intel/igc/igc_main.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/ethernet/intel/igc/igc_main.c +1 -2
@@ -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 ); } }
Signature · 1 line
2.53.0
Quoted 12 lines · David Carlier
When an
AF_XDPzero-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, sonapi_complete_done()never clearsNAPI_STATE_SCHED.
igc_down()callsnapi_synchronize()beforenapi_disable(), so it spins forever waiting for that bit and the interface never goes down. Drop thenapi_synchronize()and letnapi_disable()do the job -- it setsNAPI_STATE_DISABLE, which forces the stuck poll to complete. Reorder it ahead ofigc_set_queue_napi()so the NAPI mapping is cleared only after polling has stopped, matching the recent igb fixb1e067240379.
Quoted 4 lines
Fixes fc9df2a0b520 ("igc: Enable RX via AF_XDP zero-copy")Suggested-by Maciej Fijalkowski <[email protected]>Signed-off-by David Carlier <[email protected]>
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.
Quoted 22 lines
--- drivers/net/ethernet/intel/igc/igc_main.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/net/ethernet/intel/igc/igc_main.c +1
-2@@ -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 ); } }Signature · 1 line
2.53.0
Ruinskiy, Dima
Reviewed-byQuoted 46 lines · Maciej Fijalkowski
Quoted 12 lines · David Carlier
When an
AF_XDPzero-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, sonapi_complete_done()never clearsNAPI_STATE_SCHED.
igc_down()callsnapi_synchronize()beforenapi_disable(), so it spins forever waiting for that bit and the interface never goes down. Drop thenapi_synchronize()and letnapi_disable()do the job -- it setsNAPI_STATE_DISABLE, which forces the stuck poll to complete. Reorder it ahead ofigc_set_queue_napi()so the NAPI mapping is cleared only after polling has stopped, matching the recent igb fixb1e067240379.Quoted 4 lines
Fixes fc9df2a0b520 ("igc: Enable RX via AF_XDP zero-copy")Suggested-by Maciej Fijalkowski <[email protected]>Signed-off-by David Carlier <[email protected]>Reviewed-by Maciej Fijalkowski <[email protected]>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.
Quoted 19 lines
--- drivers/net/ethernet/intel/igc/igc_main.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/net/ethernet/intel/igc/igc_main.c +1
-2@@ -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 ); } }
Quoted 3 lines
Quoted 3 lines
Signature · 1 line
2.53.0
Kadosh, MoriyaX
Tested-byQuoted 41 lines · Dima
Quoted 40 lines · Maciej Fijalkowski
Quoted 12 lines · David Carlier
When an
AF_XDPzero-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, sonapi_complete_done()never clearsNAPI_STATE_SCHED.
igc_down()callsnapi_synchronize()beforenapi_disable(), so it spins forever waiting for that bit and the interface never goes down. Drop thenapi_synchronize()and letnapi_disable()do the job -- it setsNAPI_STATE_DISABLE, which forces the stuck poll to complete. Reorder it ahead ofigc_set_queue_napi()so the NAPI mapping is cleared only after polling has stopped, matching the recent igb fixb1e067240379.Quoted 4 lines
Fixes fc9df2a0b520 ("igc: Enable RX via AF_XDP zero-copy")Suggested-by Maciej Fijalkowski <[email protected]>Signed-off-by David Carlier <[email protected]>Reviewed-by Maciej Fijalkowski <[email protected]>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.
Quoted 13 lines
---
drivers/net/ethernet/intel/igc/igc_main.c| 3 +--1 file changed, 1 insertion(+), 2 deletions(-)drivers/net/ethernet/intel/igc/igc_main.c +0
-2@@ -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);
Quoted 8 lines
Quoted 7 lines
Quoted 7 lines
drivers/net/ethernet/intel/igc/igc_main.c +1
-0napi_disable(&adapter->q_vector[i]->napi); + igc_set_queue_napi(adapter, i, NULL); } }Signature · 1 line
2.53.0Reviewed-by Dima Ruinskiy <[email protected]>