Skip to content

Commit 068d8b7

Browse files
tirthendu-intelkuba-moo
authored andcommitted
i40e: sync next_to_clean and next_to_process for programming status desc
When a programming status desc is encountered on the rx_ring, next_to_process is bumped along with cleaned_count but next_to_clean is not. This causes I40E_DESC_UNUSED() macro to misbehave resulting in overwriting whole ring with new buffers. Update next_to_clean to point to next_to_process on seeing a programming status desc if not in the middle of handling a multi-frag packet. Also, bump cleaned_count only for such case as otherwise next_to_clean buffer may be returned to hardware on reaching clean_threshold. Fixes: e9031f2 ("i40e: introduce next_to_process to i40e_ring") Suggested-by: Maciej Fijalkowski <[email protected]> Reported-by: [email protected] Reported by: Solomon Peachy <[email protected]> Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217678 Tested-by: [email protected] Tested by: Indrek Järve <[email protected]> Signed-off-by: Tirthendu Sarkar <[email protected]> Tested-by: Arpana Arland <[email protected]> (A Contingent worker at Intel) Signed-off-by: Jacob Keller <[email protected]> Acked-by: Maciej Fijalkowski <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent e7684d2 commit 068d8b7

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

drivers/net/ethernet/intel/i40e/i40e_txrx.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2544,7 +2544,14 @@ static int i40e_clean_rx_irq(struct i40e_ring *rx_ring, int budget,
25442544
rx_buffer = i40e_rx_bi(rx_ring, ntp);
25452545
i40e_inc_ntp(rx_ring);
25462546
i40e_reuse_rx_page(rx_ring, rx_buffer);
2547-
cleaned_count++;
2547+
/* Update ntc and bump cleaned count if not in the
2548+
* middle of mb packet.
2549+
*/
2550+
if (rx_ring->next_to_clean == ntp) {
2551+
rx_ring->next_to_clean =
2552+
rx_ring->next_to_process;
2553+
cleaned_count++;
2554+
}
25482555
continue;
25492556
}
25502557

0 commit comments

Comments
 (0)