🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #6775

Re: [PATCH net v2] net: sparx5: fix tx DCB index drift in fdma xmit

#6775
From: Simon Horman
Date: Fri, 23 Oct 2026 10:53
35 lines
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>
Technical Details
Message-ID: <20261023105357.GI708417@horms.kernel.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-351021-linux-kernel-netdev=dewy.ru
References: <20261021-sparx5-fdma-last-dcb-v2-1-7b8fabdb9239@microchip.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-351021-linux-kernel-netdev=dewy.ru
From: horms@kernel.org (Simon Horman)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net v2] net: sparx5: fix tx DCB index drift in fdma xmit
Date: Fri, 23 Oct 2026 11:53:57 +0100
Organization: Usenet Network
Message-ID: <20261023105357.GI708417@horms.kernel.org>
References: <20261021-sparx5-fdma-last-dcb-v2-1-7b8fabdb9239@microchip.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: usenet.network;
	logging-data="479682"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:Uen4K+cqKvzMiZhz/6tTn7kSQ6g= sha256:04L6u6FX/99NkrfJFZWdUUPELyJ+e98iDXieI1qCUI8=
	sha1:tIS47Wym/SYFfT9gFvJzYNLoJb0= sha256:50VypDIWM8v7LSC7vN+AoUzH91GgPI4g6zDLHrjVYxA=
Content-Disposition: inline
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 6142811146E; Fri, 23 Oct 2026 13:56:30 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.739
X-Spam-Status: No, score=-3.739 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.339, DKIM_SIGNED=0.1,
	DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=kernel.org
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id w-2DtO0ogSHW;
	Fri, 23 Oct 2026 13:56:26 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-351021-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 9206211146C; Fri, 23 Oct 2026 13:56:18 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id 2A0B039508; Fri, 23 Oct 2026 10:54:09 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1792752848;
	b=K8GiPIpYeSo2ojO14LkgD0KTylvUgeDd7zi6wC1uFAXHvmdzGWXPa9Thp58Ti+rc9Oa7
	 5yy+7QhRSWo58g2moOuWLukuzj9NeAe3ckqgC2wk9d5VV5sCUdObiF47MOGQ9/6nW9DTo
	 aomlK+DT0QMr/yleOPQxzxE92BJ5nkPDfSsg9fiMsvymj6kDau040ga7O4M4yj31gQC6X
	 0cqI81ajlkGB8TF/VB4qn1iHF9oZ2H34nHmvNnvqttRJZrwREhULoqkhGOA0Y+quclJMA
	 JgxG0NYCY/hxQWXvjTvt69lp/52UUyrpPPFJSkgSPN+tVoaTsGtsSriE2f9PfqHYyew==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1792752848;
	h=X-Original-To:Received:Received:DKIM-Signature:Date:From:To:Cc:
	 Subject:Message-ID:References:X-Mailing-List:List-Id:List-Post:
	 List-Help:List-Subscribe:List-Unsubscribe:List-Owner:Precedence:
	 MIME-Version:Content-Type:Content-Disposition:In-Reply-To;
	bh=MZ8NpIYPnlGXMQOlUfqmQ9hbqT25RKQJ31W0QHbqyC4=;
	b=TqWi7qJuCRsHxJtjYJXDB7cOA5hQdimaAXnVheN6ySj3+6ljEt5E11oY4UOpRAZDDaIL
	 p1DxREcNSXCbsin7KKtSe4vLZtFu/pQrFD/BQCvicwBuGXTdtPhVcN++ms+Z8lyc2Fhd0
	 OcuTTwdaldSIIffpsy95/mkvv9OQnzrpEDFCZDirTOwZM44Za2OmYR5Amv/Tsa9sKUXod
	 /P+ZfHraGgqoq1C7Dt1ZdVMmn8SM7TnXBVLRtb+De3Z/e6U5Hnm6SCQwOYEeFNZyZg4l8
	 TrC2oCyxPW0vuuN4C7NOdyGUEzL4rQWLQ1qxnCR7BiCLC9NtwV4uB2kDohs1m7s+G6Q==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=mSaHLEWP;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 601ED606A323;
	Fri, 23 Oct 2026 10:54:08 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=mSaHLEWP
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1792752842;
	b=bLCu3ZqHO6ScgHFUxj+GlftJCowZ3bSt1a3QpXSJzfJ9xIr/LxoNBehOCtr9fG0yqZFt
	 6uItwpyxYwFlMoP9F5CSCS6Q6R1zxXFxyeJEoq2/UOB0xKqbl9yEsRztN2CxWZhENMqop
	 mB/G+yl+EgaFfO+kt5fAeXPJH3RUQlprFLCOdn1PDZZHcghAR/BwfxdAeVJbDHop1GT9i
	 V6Zdp6h9jgPt/FbkeTkTYpzAEP9jpNVvM8RSTULpkgTrGlkwH4PW9w3TItmnxpAwrsIkI
	 4StEPhi5E90w2lRyhU7hKguG0mV71r+qyMh11kZ9ujA7GN4iTIHPUq5TmgmbhbqrcGQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1792752842;
	h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID:
	 References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To;
	bh=MZ8NpIYPnlGXMQOlUfqmQ9hbqT25RKQJ31W0QHbqyC4=;
	b=ar4bauuQ4MYLg6nip5ymxVFLSVc6IalGmBqIFcROSTtpHQgSNj9IJEQo9u0VzAuCXHw8
	 KMiZ5mAgy7lQilROudBpdCeyeFoWVKdg4Qvzat/hKo86wrjpj+wHZudgDKcCpmamX8tG1
	 4NjiiXf/x4EVzWtIooDbnBwYgCSBWPAuD6fOmprz0uJS1VhS6P2y9moqQI8aJnETrXSiZ
	 G+bVwMKYuu68sYRbMXdpNUAtEHx/lz05ZN5B5EG66luevy+Qe/BQbTGAkYowHL3BMjUFW
	 oZMAvc9bQonFWyhdUWf4d+jsq2Ne0QQHDGEltYMVPio8N9ovE2mhLTSP7R7ma2h8kqg==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=mSaHLEWP;
	arc=none smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 45B08606A31B;
	Fri, 23 Oct 2026 10:54:02 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8DBCA1F01825;
	Fri, 23 Oct 2026 10:53:59 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1792752841;
	bh=MZ8NpIYPnlGXMQOlUfqmQ9hbqT25RKQJ31W0QHbqyC4=;
	h=Date:From:To:Cc:Subject:References:In-Reply-To;
	b=mSaHLEWPI9H8m0bPTSzjL1qh53dmhcdPOwx60K4UZ2rMjMqoIxTXdT0WLjExSSW4z
	 s9tfW85JTIznEhF18GRfFhrP8TtTnUburywjmV9IzSGkhboGz1+siHMm/0lc2exLgx
	 Q5fOWEBs1kZql/XTMDT3HRmjgK4bES6KbaSvtfKcKwgv10ul7UX5K/hOacF+3U4NME
	 J8rmMM9k8T2is6arL3SKVUsr0Zlv7oTYQa5qgItEhSEhrmfcGtjJxY77EdgGOvBpDT
	 kwUcBB556cbjnoJaaFPepBQgIMf7btxZmtxClKx2etV9wyQ0seg5sNoe7/Ifrbw9uk
	 V39Xd9/A1bdJg==
X-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
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list
X-In-Reply-To: <20261021-sparx5-fdma-last-dcb-v2-1-7b8fabdb9239@microchip.com>