Skip to contentSkip to conversation

igc: Clean the TX buffer and TX descriptor ring

PATCH Superseded Muhammad Husaini Zulkifli 2 participants 2 messages Apr 10, 2023 – Apr 24, 2023

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

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")
---
 drivers/net/ethernet/intel/igc/igc_main.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/net/ethernet/intel/igc/igc_main.c +7 -0
index ba49728be919a..839f2c1a6f429 100644
@@ -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
Tested-by on v1 1/1
#1 lore raw
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")
---
  drivers/net/ethernet/intel/igc/igc_main.c | 7 +++++++
  1 file changed, 7 insertions(+)

_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan