* [Intel-wired-lan] [PATCH] igc: Clean the TX buffer and TX descriptor ring
@ 2023-04-10 6:51 Muhammad Husaini Zulkifli
2023-04-24 6:39 ` naamax.meir
0 siblings, 1 reply; 2+ messages in thread
From: Muhammad Husaini Zulkifli @ 2023-04-10 6:51 UTC (permalink / raw)
To: intel-wired-lan; +Cc: anthony.l.nguyen
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 <muhammad.husaini.zulkifli@intel.com>
---
drivers/net/ethernet/intel/igc/igc_main.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c
index ba49728be919a..839f2c1a6f429 100644
--- a/drivers/net/ethernet/intel/igc/igc_main.c
+++ b/drivers/net/ethernet/intel/igc/igc_main.c
@@ -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;
--
2.17.1
_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Intel-wired-lan] [PATCH] igc: Clean the TX buffer and TX descriptor ring
2023-04-10 6:51 [Intel-wired-lan] [PATCH] igc: Clean the TX buffer and TX descriptor ring Muhammad Husaini Zulkifli
@ 2023-04-24 6:39 ` naamax.meir
0 siblings, 0 replies; 2+ messages in thread
From: naamax.meir @ 2023-04-24 6:39 UTC (permalink / raw)
To: Muhammad Husaini Zulkifli, intel-wired-lan; +Cc: anthony.l.nguyen
On 4/10/2023 09:51, Muhammad Husaini Zulkifli wrote:
> 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 <muhammad.husaini.zulkifli@intel.com>
> ---
> drivers/net/ethernet/intel/igc/igc_main.c | 7 +++++++
> 1 file changed, 7 insertions(+)
Tested-by: Naama Meir <naamax.meir@linux.intel.com>
_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-04-24 6:39 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-10 6:51 [Intel-wired-lan] [PATCH] igc: Clean the TX buffer and TX descriptor ring Muhammad Husaini Zulkifli
2023-04-24 6:39 ` naamax.meir
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox