Patch "gve: Fix XDP TX completion handling when counters overflow" has been added to the 6.6-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    gve: Fix XDP TX completion handling when counters overflow

to the 6.6-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     gve-fix-xdp-tx-completion-handling-when-counters-ove.patch
and it can be found in the queue-6.6 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit c208f78cb1e43fe957e1440cbc0087fa22eb04ba
Author: Joshua Washington <joshwash@xxxxxxxxxx>
Date:   Tue Jul 16 10:10:41 2024 -0700

    gve: Fix XDP TX completion handling when counters overflow
    
    [ Upstream commit 03b54bad26f3c78bb1f90410ec3e4e7fe197adc9 ]
    
    In gve_clean_xdp_done, the driver processes the TX completions based on
    a 32-bit NIC counter and a 32-bit completion counter stored in the tx
    queue.
    
    Fix the for loop so that the counter wraparound is handled correctly.
    
    Fixes: 75eaae158b1b ("gve: Add XDP DROP and TX support for GQI-QPL format")
    Signed-off-by: Joshua Washington <joshwash@xxxxxxxxxx>
    Signed-off-by: Praveen Kaligineedi <pkaligineedi@xxxxxxxxxx>
    Reviewed-by: Simon Horman <horms@xxxxxxxxxx>
    Link: https://patch.msgid.link/20240716171041.1561142-1-pkaligineedi@xxxxxxxxxx
    Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/ethernet/google/gve/gve_tx.c b/drivers/net/ethernet/google/gve/gve_tx.c
index 9f6ffc4a54f0b..2ae891a62875c 100644
--- a/drivers/net/ethernet/google/gve/gve_tx.c
+++ b/drivers/net/ethernet/google/gve/gve_tx.c
@@ -158,15 +158,16 @@ static int gve_clean_xdp_done(struct gve_priv *priv, struct gve_tx_ring *tx,
 			      u32 to_do)
 {
 	struct gve_tx_buffer_state *info;
-	u32 clean_end = tx->done + to_do;
 	u64 pkts = 0, bytes = 0;
 	size_t space_freed = 0;
 	u32 xsk_complete = 0;
 	u32 idx;
+	int i;
 
-	for (; tx->done < clean_end; tx->done++) {
+	for (i = 0; i < to_do; i++) {
 		idx = tx->done & tx->mask;
 		info = &tx->info[idx];
+		tx->done++;
 
 		if (unlikely(!info->xdp.size))
 			continue;




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux