Thread View: linux.kernel.netdev
1 messages
1 total messages
Started by Simon Horman
Fri, 23 Oct 2026 10:53
Re: [PATCH net v2] net: sparx5: fix tx DCB index drift in fdma xmit
Author: Simon Horman
Date: Fri, 23 Oct 2026 10:53
Date: Fri, 23 Oct 2026 10:53
35 lines
9728 bytes
9728 bytes
On Wed, Oct 21, 2026 at 04:04:59PM +0200, Daniel Machon wrote:
> sparx5_fdma_xmit() advances dcb_index before checking that the FDMA is
> done with the DCB, and does not undo the advance when the check fails.
> Before commit f4aa7e361ae2 ("net: sparx5: use FDMA library for adding
> DCB's in the tx path") the next DCB was always the one after last_dcb.
> Since then dcb_index drifts one DCB further away from last_dcb on every
> failed transmit.
>
> While the ring is full, this drops frames even though completed DCBs
> sit behind dcb_index. After a run of failures, dcb_index can also land
> on last_dcb itself. Re-adding last_dcb loses the frame, because the
> FDMA has already passed the tail of the chain, and that DCB is never
> completed again.
>
> Fix this by making dcb_index the next DCB to use, and advancing it only
> after the DCB has been added, as the rx path does. dcb_index and
> last_dcb now only move together, so dcb_index always points at the DCB
> after last_dcb.
>
> The issue was found by an AI code review agent. It was reproduced on a
> sparx5 PCB135 board with a modified kernel that forces 63 consecutive
> transmit failures. Afterwards, about 1 in 64 frames is lost for good.
> With the fix, the same test loses no frames.
>
> Fixes: f4aa7e361ae2 ("net: sparx5: use FDMA library for adding DCB's in the tx path")
> Signed-off-by: Daniel Machon <daniel.machon@microchip.com>
> ---
> Changes in v2:
> - Advance dcb_index only after the DCB has been added, instead of
> rejecting last_dcb. This fixes the drift itself (AI review).
> - Reword the subject and commit message to match.
> - Link to v1: https://lore.kernel.org/r/20261020-sparx5-fdma-last-dcb-v1-1-fb9a956196dd@microchip.com
Reviewed-by: Simon Horman <horms@kernel.org>
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads