i40e: sync next_to_clean and next_to_process for programming status desc
Subsystems (3)
PATCH 1/1 i40e: sync next_to_clean and next_to_process for programming status desc
From: Tirthendu Sarkar <[email protected]>
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.
Reported by: Solomon Peachy <[email protected]>
Tested by: Indrek Järve <[email protected]>
--- drivers/net/ethernet/intel/i40e/i40e_txrx.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/net/ethernet/intel/i40e/i40e_txrx.c +8 -1
@@ -2544,7 +2544,14 @@ static int i40e_clean_rx_irq(struct i40e_ring *rx_ring, int budget, rx_buffer =i40e_rx_bi (rx_ring, ntp);i40e_inc_ntp (rx_ring);i40e_reuse_rx_page (rx_ring, rx_buffer); - cleaned_count++; +/* Update ntc and bump cleaned count if not in the +* middle of mb packet. +*/ +if (rx_ring->next_to_clean == ntp) { + rx_ring->next_to_clean = + rx_ring->next_to_process; + cleaned_count++; + }continue ; }
base-commit: ce55c22ec8b223a90ff3e084d842f73cfba35588
Signature · 1 line
2.41.0
Quoted 15 lines · Jacob Keller
From: Tirthendu Sarkar <[email protected]>
When a programming status desc is encountered on the
rx_ring,next_to_processis bumped along withcleaned_countbutnext_to_cleanis not. This causesI40E_DESC_UNUSED()macro to misbehave resulting in overwriting whole ring with new buffers.Update
next_to_cleanto point tonext_to_processon seeing a programming status desc if not in the middle of handling a multi-frag packet. Also, bumpcleaned_countonly for such case as otherwisenext_to_cleanbuffer may be returned to hardware on reachingclean_threshold.Fixes e9031f2da1ae ("i40e: introduce next_to_process to i40e_ring")Suggested-by Maciej Fijalkowski <[email protected]>Reported-by [email protected]
Quoted 7 lines
Reported by: Solomon Peachy <[email protected]>
Tested-by [email protected]Tested by: Indrek Järve <[email protected]>
Signed-off-by Tirthendu Sarkar <[email protected]>Signed-off-by Jacob Keller <[email protected]>
You missed my ack, so:
Quoted 29 lines
--- drivers/net/ethernet/intel/i40e/i40e_txrx.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)drivers/net/ethernet/intel/i40e/i40e_txrx.c +8
-1@@ -2544,7 +2544,14 @@ static int i40e_clean_rx_irq(struct i40e_ring *rx_ring, int budget, rx_buffer =i40e_rx_bi (rx_ring, ntp);i40e_inc_ntp (rx_ring);i40e_reuse_rx_page (rx_ring, rx_buffer); - cleaned_count++; +/* Update ntc and bump cleaned count if not in the +* middle of mb packet. +*/ +if (rx_ring->next_to_clean == ntp) { + rx_ring->next_to_clean = + rx_ring->next_to_process; + cleaned_count++; + }continue ; }base-commit:
ce55c22ec8b223a90ff3e084d842f73cfba35588Signature · 1 line
2.41.0
Quoted 24 lines · Maciej Fijalkowski
Quoted 15 lines · Jacob Keller
From: Tirthendu Sarkar <[email protected]>
When a programming status desc is encountered on the
rx_ring,next_to_processis bumped along withcleaned_countbutnext_to_cleanis not. This causesI40E_DESC_UNUSED()macro to misbehave resulting in overwriting whole ring with new buffers.Update
next_to_cleanto point tonext_to_processon seeing a programming status desc if not in the middle of handling a multi-frag packet. Also, bumpcleaned_countonly for such case as otherwisenext_to_cleanbuffer may be returned to hardware on reachingclean_threshold.Fixes e9031f2da1ae ("i40e: introduce next_to_process to i40e_ring")Suggested-by Maciej Fijalkowski <[email protected]>Reported-by [email protected]Quoted 7 lines
Reported by: Solomon Peachy <[email protected]>
Tested-by [email protected]Tested by: Indrek Järve <[email protected]>
Signed-off-by Tirthendu Sarkar <[email protected]>Signed-off-by Jacob Keller <[email protected]>
Quoted 3 lines
You missed my ack, so:
not sure why patchwork didn't pick this one up. Sorry about missing it. Thanks!
-Jake
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:
Quoted 8 lines · On Thu, 19 Oct 2023 13:38:52 -0700 you wrote:
From: Tirthendu Sarkar <[email protected]>
When a programming status desc is encountered on the
rx_ring,next_to_processis bumped along withcleaned_countbutnext_to_cleanis not. This causesI40E_DESC_UNUSED()macro to misbehave resulting in overwriting whole ring with new buffers.[...]
Here is the summary with links:
- [net] i40e: sync next_to_clean and next_to_process for programming status desc
https://git.kernel.org/netdev/net/c/068d8b75c1ae
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html