Skip to content

Commit 03b54ba

Browse files
josh8551021kuba-moo
authored andcommitted
gve: Fix XDP TX completion handling when counters overflow
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: 75eaae1 ("gve: Add XDP DROP and TX support for GQI-QPL format") Signed-off-by: Joshua Washington <[email protected]> Signed-off-by: Praveen Kaligineedi <[email protected]> Reviewed-by: Simon Horman <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 0e03c64 commit 03b54ba

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/net/ethernet/google/gve/gve_tx.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,15 +158,16 @@ static int gve_clean_xdp_done(struct gve_priv *priv, struct gve_tx_ring *tx,
158158
u32 to_do)
159159
{
160160
struct gve_tx_buffer_state *info;
161-
u32 clean_end = tx->done + to_do;
162161
u64 pkts = 0, bytes = 0;
163162
size_t space_freed = 0;
164163
u32 xsk_complete = 0;
165164
u32 idx;
165+
int i;
166166

167-
for (; tx->done < clean_end; tx->done++) {
167+
for (i = 0; i < to_do; i++) {
168168
idx = tx->done & tx->mask;
169169
info = &tx->info[idx];
170+
tx->done++;
170171

171172
if (unlikely(!info->xdp.size))
172173
continue;

0 commit comments

Comments
 (0)