πŸš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #17188

Re: [PATCH net v2 07/12] net: au1000: fix buffer descriptor free list insertion

#17188
From: netdev-bot+sashiko
Date: Mon, 16 Nov 2026 13:50
68 lines
10639 bytes
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.

Low priority / nit picks for your consideration:

- [Low] The commit message for "net: au1000: fix buffer descriptor free
  list insertion" says the old au1000_ReleaseDB() "loses free…

--

net: au1000: fix buffer descriptor free list insertion

This patch changes au1000_ReleaseDB() so the returned descriptor's pnext
points to the old free list head before it becomes the new head. Before
this, the old head's pnext was set to the returned descriptor. The new
code matches au1000_GetFreeDB() and how the list is set up in probe.

> ReleaseDB links the old head to the returned descriptor and makes the
> returned descriptor the new head without updating its stale next
> pointer. This loses free descriptors and can create cycles. Link the
> returned descriptor to the old head instead, matching GetFreeDB and the
> list initialization.
>
> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")

[Severity: Low]
The code change looks correct. Should the commit message say that the old
behaviour had no runtime effect, though?

au1000_ReleaseDB() is only called on teardown paths: the err_out unwind
in au1000_probe() and au1000_remove(). In both cases the descriptor
buffers and aup are freed right afterwards:

drivers/net/ethernet/amd/au1000_eth.c:au1000_remove() {
    ...
	for (i = 0; i < NUM_RX_DMA; i++)
		if (aup->rx_db_inuse[i])
			au1000_ReleaseDB(aup, aup->rx_db_inuse[i]);

	for (i = 0; i < NUM_TX_DMA; i++)
		if (aup->tx_db_inuse[i])
			au1000_ReleaseDB(aup, aup->tx_db_inuse[i]);

	dma_free_coherent(&pdev->dev, MAX_BUF_SIZE * (NUM_TX_BUFFS + NUM_RX_BUFFS),
			  aup->vaddr, aup->dma_addr);
    ...
	free_netdev(dev);
}

The err_out path in au1000_probe() also falls through to
dma_free_coherent() and free_netdev().

au1000_GetFreeDB() is only called from au1000_probe(), before any
au1000_ReleaseDB() call, and no RX or TX path walks aup->pDBfree. Also,
NUM_RX_BUFFS equals NUM_RX_DMA and NUM_TX_BUFFS equals NUM_TX_DMA, so
the free list is already empty after a successful probe.

So the lost entries or cycles only ever exist in a list that is about to
be freed and is never read again. With the Fixes: tag, stable tooling
could pick this up as a user-visible fix.

Could the message say the bug is latent with no functional impact, and
either drop the Fixes: tag or explain why it is needed?

-- 
Sashiko AI review Β· https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261112045301.3669532-1-f.fainelli%40gmail.com
Technical Details
Message-ID: <179483704622.3136.16694282680991633445@kernel.org>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-364357-linux-kernel-netdev=dewy.ru
References: <20261112045301.3669532-8-f.fainelli@gmail.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-364357-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net v2 07/12] net: au1000: fix buffer descriptor free list
 insertion
Date: Mon, 16 Nov 2026 13:50:46 +0000
Organization: Usenet Network
Message-ID: <179483704622.3136.16694282680991633445@kernel.org>
References: <20261112045301.3669532-8-f.fainelli@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="2076576"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:i/lBpIp14+5HrAm70eATmJyN24o= sha256:EwA3HkZVurbCgPUf8PfWfnT1Gs/o300W4Z5mo3NYhMQ=
	sha1:BIUoxT/DQwzQ2eeKqVQQ8JDpOWg= sha256:DZ5CRdfbrT5kCa+DTuGM9740x0a65A0uVARaMX7TLug=
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 C5F5E114C35; Mon, 16 Nov 2026 16:51:48 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.4
X-Spam-Status: No, score=-3.4 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, 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, URIBL_BLOCKED=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 DqTsYy9TGuZq;
	Mon, 16 Nov 2026 16:51:45 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-364357-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 tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id 0527F114C0C; Mon, 16 Nov 2026 16:51:37 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by tor.lore.kernel.org (Postfix) with ESMTP id E5C172D780; Mon, 16 Nov 2026 13:51:16 +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=1794837054;
	b=V6n0krL6suv/GDFMhWNQHVtj1of91crNPC3QDvu/9JcsbpVvHliJCyVjxMtxqdEcSDI0
	 CCU70jwtxsWplCUnq7MpZZ44iHwMW+weCBkPwrslFR5Daqa4Y3vBBRtCJfHumDGBlGZZP
	 HPiH4VS4HHzTGYcff9kGJnUM0r0byUMMmAj/nAGne5Q+gchFb1jlJo36C8/eiTbncpVXC
	 5zPz+qGcGCr64dttLXJJwJPPC5X5NoVppQyK9EjinhZfjlshYUI24AB48esatruOJNt+5
	 vdY1naLoQtQuFWfHo8BIAQ7VaRzyykOuTaf8X1apEP5M0MXDVP7QZotDG8mgT2LZfMw==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794837054;
	h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc:
	 Date:Message-ID:In-Reply-To:References:X-sashiko-severity:
	 Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id:
	 List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
	 Precedence:MIME-Version;
	bh=ShEPZTXRu5lnPu0jihWcq6zhrQ4h/M1aHTPZu8H9wS8=;
	b=XnXQVxTthyrWDf3UEKk0kAW9sh1KQjgVI6xVqqWeVyfrF6S/RcEZs3Fiqf5FSaJ8X8cF
	 C2huJIqeLpbVbsxocD+kP9I4TEPvoQOLdRxhm6mJSPxF4i/fjRSjKcrpFr4FhpdQJcpkL
	 B8aVXai/dM4C7NN2QRN5r60C+v6AcgZONiS6ntiqzTIxwdAu96b3+P9Mvs4XHhbR9CWYS
	 sRA5WkwswaqadW8XvUZO11W4Ne4h4USKdPJdH1eEb1/wjc2Pff081ztXsW1FZs0oEpIlR
	 Vp1E4fGoZ4022q8IsQ3MFpz9/8dhThliVkaPDPZIm4/36FzzJ5nwmOIJU0HDHRLa60w==
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=bTiKHiXx;
	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 09ED7606A333;
	Mon, 16 Nov 2026 13:50:54 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=bTiKHiXx
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=1794837048;
	b=rJuFj0HBOPrZf8Nfz5ovWV0cNk5YKDtZRrMgVep00oG4QNj+x7sbqeqRi1mPSSl+6Cgz
	 Oew5anpySJMqJg/Ca7+oi062z/1KTbrq8i/TUKwpZpp9gjPh0wkVjTHCJuwIAvnr1epyg
	 3sOF8afScPpagsiCZPJD6qZDOpGpGaGaQWx7wSD/Ji2u6XYqCR+ZzsHgCMGGTM8gROUBl
	 YVMcM1l9w0+BIhGW00zCyt8EK+Xb/LGA99DlZg3NZc8nGpeQXC96f9GmFF+aarAgq61VB
	 SC/n5SzQL0ocJCcgUBme6yO9bMxbtEsAJTzrR0fEIeFLmA05lB5G5FNnuOS6R4osUkQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794837048;
	h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID:
	 In-Reply-To:References:X-sashiko-severity:Content-Type:
	 Content-Transfer-Encoding:MIME-Version;
	bh=ShEPZTXRu5lnPu0jihWcq6zhrQ4h/M1aHTPZu8H9wS8=;
	b=yezCXSfXsZIz1sIT+hvld25bp4lRAKvfukNSut019AhKlBFPhMCvBbKPmu+MgDnDuXIX
	 1nLqpEFPFAefI9pxdcDTCICYTnKdDzG11iTSDmbb9YqpP7w2Ujz3dWYt3lcTObGCUZfRs
	 FfkYznb1YnNzLbQHbzK4ljMg0CkLjue/X8d4W/2HHRQG9u0cF51eV4WLqvZ1hX0pD+ji/
	 tuGF2XeWTtTEjiEOk7Y1+mxTr6S4iGMSZ4jnzNmOffuFqn4TdfDu3clcKFq7VsqRROpAw
	 Qz8GebYpX+NJBF3wXipKlEolJRZ+B1hJm8r2OGkpYXMcb1aFVgygDUx10gn67nJ4hSQ==
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=bTiKHiXx;
	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 293DC60A3838;
	Mon, 16 Nov 2026 13:50:48 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id AFED71F000C6;
	Mon, 16 Nov 2026 13:50:46 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1794837047;
	bh=ShEPZTXRu5lnPu0jihWcq6zhrQ4h/M1aHTPZu8H9wS8=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=bTiKHiXxTNVRTHjtMmTR1aSUiXntHFDP60UO+8okDh5hFYSFKL/vZIaShcUonJDhx
	 MSd5SqH2qRftAMrqKrOdSkQ2CximcnxIMrdrzjmTARBu0q5/g0WEzzKmnFkxf9suuY
	 69wK7ReC9Absp1xlVX54E3we1vKS412/IU3VtHW302K7E6k7OlD2mU6Zk18IuwzP6J
	 d7MhSpH3nADe1NnKhyg0i4gs2XedIJr9C2UV/wvW3f7N8HAjDJYGKWefWow073OawC
	 r1tRdjT9yNiGFmLyYqG8RGKs+MtRbKcar17cbbdZ+KEdu88XxUDiq1E83LiaOGLiLJ
	 2L3/gOtRqY/fw==
X-Cc: netdev@vger.kernel.org, andrew+netdev@lunn.ch, davem@davemloft.net,
 edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, hkallweit1@gmail.com,
 linux@armlinux.org.uk, shaojijie@huawei.com, horms@kernel.org,
 runyu.xiao@seu.edu.cn, mmyangfl@gmail.com, hvr@gnu.org, jeff@garzik.org,
 danny.kukawka@bisect.de, mugunthanvnm@ti.com, sebastian.hesselbarth@gmail.com,
 linux-kernel@vger.kernel.org, manuel.lauss@gmail.com
X-In-Reply-To: <20261112045301.3669532-8-f.fainelli@gmail.com>
X-sashiko-severity: Low
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