From: Simon Horman <horms@kernel.org>
To: Daniel Machon <daniel.machon@microchip.com>
Cc: "Andrew Lunn" <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
"Eric Dumazet" <edumazet@kernel.org>,
"Jakub Kicinski" <kuba@kernel.org>,
"Paolo Abeni" <pabeni@redhat.com>,
"Steen Hegelund" <Steen.Hegelund@microchip.com>,
UNGLinuxDriver@microchip.com,
"Jens Emil Schulz Østergaard"
<jensemil.schulzostergaard@microchip.com>,
"Horatiu Vultur" <horatiu.vultur@microchip.com>,
netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH net v2] net: sparx5: fix tx DCB index drift in fdma xmit
Date: Fri, 23 Oct 2026 11:53:57 +0100 [thread overview]
Message-ID: <20261023105357.GI708417@horms.kernel.org> (raw)
In-Reply-To: <20261021-sparx5-fdma-last-dcb-v2-1-7b8fabdb9239@microchip.com>
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>
prev parent reply other threads:[~2026-10-23 10:54 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-21 14:04 Daniel Machon
2026-10-23 10:53 ` Simon Horman [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261023105357.GI708417@horms.kernel.org \
--to=horms@kernel.org \
--cc=Steen.Hegelund@microchip.com \
--cc=UNGLinuxDriver@microchip.com \
--cc=andrew+netdev@lunn.ch \
--cc=daniel.machon@microchip.com \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=horatiu.vultur@microchip.com \
--cc=jensemil.schulzostergaard@microchip.com \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®