igc: Clean the TX buffer and TX descriptor ring
Subsystems (2)
PATCH 1/1 igc: Clean the TX buffer and TX descriptor ring
There could be a race condition during link down where interrupt being generated and igc_clean_tx_irq() been called to perform the TX completion. Properly clear the TX buffer and TX descriptor ring to avoid those case.
Fixes 13b5b7fd6a4a ("igc: Add support for Tx/Rx rings")
Signed-off-by Muhammad Husaini Zulkifli <[email protected]>
--- drivers/net/ethernet/intel/igc/igc_main.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/net/ethernet/intel/igc/igc_main.c +7 -0
@@ -254,6 +254,13 @@ static void igc_clean_tx_ring(struct igc_ring *tx_ring)/* reset BQL for queue */ netdev_tx_reset_queue (txring_txq (tx_ring)); +/* Zero out the buffer ring */ +memset (tx_ring->tx_buffer_info,0 , +sizeof (*tx_ring->tx_buffer_info) * tx_ring->count); + +/* Zero out the descriptor ring */ +memset (tx_ring->desc,0 , tx_ring->size); +/* reset next_to_use and next_to_clean */ tx_ring->next_to_use =0 ; tx_ring->next_to_clean =0 ;
Signature · 6 lines
2.17.1 _______________________________________________ Intel-wired-lan mailing list [email protected] https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
Quoted 10 lines · Muhammad Husaini Zulkifli
There could be a race condition during link down where interrupt being generated and
igc_clean_tx_irq()been called to perform the TX completion. Properly clear the TX buffer and TX descriptor ring to avoid those case.Fixes 13b5b7fd6a4a ("igc: Add support for Tx/Rx rings")Signed-off-by Muhammad Husaini Zulkifli <[email protected]>--- drivers/net/ethernet/intel/igc/igc_main.c | 7 +++++++ 1 file changed, 7 insertions(+)
Tested-by Naama Meir <[email protected]>
_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan