๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #17412

Re: [PATCH net v5 3/8] net: dsa: b53: clear stale state when creating an ARL entry

#17412
From: netdev-bot+sashiko
Date: Mon, 16 Nov 2026 19:02
95 lines
11211 bytes
Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.

Critical: 0 ยท High: 0 ยท Medium: 1 ยท Low: 0

If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).

- [Medium] In b53_arl_op() (drivers/net/dsa/b53/b53_common.c), the code
  does not do what the commit message says about return values.

--

net: dsa: b53: clear stale state when creating an ARL entry

This patch clears the b53_arl_entry in b53_arl_op() before a new ARL
entry is created, so a multicast add no longer ORs the port into the
forwarding bitmap of an unrelated bin. It also returns early when
deleting an entry that is not present, so stale bin contents are no
longer written back.

> Deleting an entry which is not present now returns -ENOENT, including
> when the lookup ran out of space (-ENOSPC), where it previously returned
> 0 in that case.

[Severity: Medium]
Is this paragraph accurate? The code below seems to keep returning 0 for
a delete of an absent entry in both cases.

When the lookup misses, b53_arl_read() returns one of two values:

drivers/net/dsa/b53/b53_common.c:b53_arl_read() {
    ...
	return *idx >= dev->num_arl_bins ? -ENOSPC : -ENOENT;
}

> diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c
> index 1f5776dfaae2e..dac6013f8fe29 100644
> --- a/drivers/net/dsa/b53/b53_common.c
> +++ b/drivers/net/dsa/b53/b53_common.c
> @@ -2055,9 +2055,13 @@ static int b53_arl_op(struct b53_device *dev, int op, int port,
>  			addr, vid);
>  		return is_valid ? ret : 0;

The -ENOSPC case is not changed by this patch. With is_valid == false it
still returns 0, not -ENOENT.

>  	case -ENOENT:
> +		if (!is_valid)
> +			return 0;
> +

The new early return in the -ENOENT case also gives 0 for a delete.

Before this patch, the -ENOENT delete path fell through to
b53_arl_write_entry() and returned b53_arl_rw_op(dev, 0), which is
normally 0. So b53_fdb_del() and b53_mdb_del() get 0 for an absent entry
both before and after this change. The real difference is that the stale
bin is no longer written back.

Keeping 0 looks like the right behavior. b53_mdb_del() logs an error on
any non-zero return:

drivers/net/dsa/b53/b53_common.c:b53_mdb_del() {
    ...
	ret = b53_arl_op(priv, 0, port, mdb->addr, mdb->vid, false);
	mutex_unlock(&priv->arl_mutex);
	if (ret)
		dev_err(ds->dev, "failed to delete MDB entry\n");
    ...
}

Returning -ENOENT there would produce errors during normal teardown.

None of the later patches in the series touch b53_arl_op(), so the code
is the same at the end of the series.

Could this paragraph be dropped, or reworded to describe the change the
code actually makes? Or was a code change from an earlier version of the
patch left out?

>  		/* We could not find a matching MAC, so reset to a new entry */
>  		dev_dbg(dev->dev, "{%pM,%.4d} not found, using idx: %d\n",
>  			addr, vid, idx);
> +		memset(&ent, 0, sizeof(ent));
>  		break;

[ ... ]

-- 
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261112180202.324504-1-florian.fainelli%40broadcom.com
Technical Details
Message-ID: <179485573753.3136.13658549628439256102@kernel.org>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-364653-linux-kernel-netdev=dewy.ru
References: <20261112180202.324504-4-florian.fainelli@broadcom.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-364653-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net v5 3/8] net: dsa: b53: clear stale state when creating
 an ARL entry
Date: Mon, 16 Nov 2026 19:02:17 +0000
Organization: Usenet Network
Message-ID: <179485573753.3136.13658549628439256102@kernel.org>
References: <20261112180202.324504-4-florian.fainelli@broadcom.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="2144405"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:GPo6xF1/ARoSM3wGWLMqhBkj5UU= sha256:33TbEanAMW7BrFy0TWjfUsrBp1hgqdX/6Cq2WX7BUns=
	sha1:ntv6GaJN6aU32q1mmflY3/QcDW4= sha256:oGFXknBnOP7RhxNQFJdMdNbuqmQmGLz9ZGx9NVn0h+s=
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 736B6114D1C; Mon, 16 Nov 2026 22:03:24 +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 oMVb6Y4SVQ1e;
	Mon, 16 Nov 2026 22:03:20 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-364653-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 55C9A114D42; Mon, 16 Nov 2026 22:03:12 +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 5FA9D2F4A6; Mon, 16 Nov 2026 19:02:21 +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=1794855739;
	b=Z7u+ltY/lWNVtOKQaKVPUIidV0dvEXu6oHWYU2eHoNc0F4dCqZY51y15LfDA5SCFCdMm
	 OUG2M9nEEjN5xxNT8hV+OBqcagVGu8fTbBNav+JEUw7PqHPrG4dRqx54y6yWASFN9waQr
	 HEcYhxS9w1Tz5yeXKssCcsTDwGRLKOoDdJa49Dh1tMUWTYodJbQR7A03b2RIF6ezTvGfp
	 FGN/eCo1c2U4eNs93UAC1H3QrZKQsS1kWdIXVRNYqIsbkKoc8RSpsqoiLiXk/EHvsko5a
	 Ch6zOHH6BUbPqisWjYW2WYvD4m0tk+Xq2AUTN87RgDILHqCh8veYpzE6aU3PO7Mma4g==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794855739;
	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=apkEuudvJbCekMTvJmYGOcll41kktITW2BH/+e4mxBQ=;
	b=177/AdekpSX4UkyxfAgrfv2bAhPDVr2bOn2o59PK2VARV4sx2QSb8l9R+SmojHrpPhDy
	 u0XUXrcOG0OV5P3he6QG60zu6vVGKuzsni+MvTnwi1bih9L53xMmsx+NlIPxLhPE7AMrH
	 lio2OLMC5boxP5pAdY2KzVR96OKLxSraW13NldpaDYuUfPm86Hy+fC1QiltSAAzsRD/az
	 oFvsl803ckv+bFWdB/QhFIPpLA80DTgUU1oX7FD1J+BCChd3z4EBEMLV/6W4FLs00oarr
	 81j1RiQvgStDV7jjZV+6OskRrgEYHzBR/rf9atqxH65xIxkSlzWB/60JQeAZKRvX/OA==
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=H4MFYrog;
	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 D9632606A33D;
	Mon, 16 Nov 2026 19:02:19 +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=H4MFYrog
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=1794855739;
	b=eGPTn7SxcBt3RaTbqxR0gVFFfr3Bp2dNW7hkrBgeBfGkvvEyvHtXxjWq8HBs3e9f4rpN
	 wIYExStiJ9WmGSmsMSMlP9bJsLmod9XpOAIBNXKjyKCTJcnqlxE4YyQk/BojEHGU3pdXt
	 m7KXt1Dt77IlG6FdkPQXPQPOrc1UnBEwh4zFjG1Ej12DYZJXEqp/y+XEfwDFOPmfffAQa
	 ydfMynw6a6bwlb6eKqhN64Klkdkp/C8bRh8BK3HHHOTlx7oBRVDh1+JcMX7WCYOz7rXTw
	 EeW0LkyiTgQ/1WxtUMkvfq1F3Fj+gYgzbqnafDqrdjvMOpdIu38XKi9pCSqugfKeYeA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794855739;
	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=apkEuudvJbCekMTvJmYGOcll41kktITW2BH/+e4mxBQ=;
	b=pqNlm7WLnlawnZD5jTeGpPA7hy8UZN148igRJuWUG7VhjYY22BoV2LJCmLNdCUItYG+B
	 J3IfG3Z3gf7lgxvwjmYuyEoN0jhG+rw/KSQv1zb9wQq7PLHMb7pSOvleym9ygAtRV/L/A
	 t/d3hoCP8mQw1+GRgUVb7/REMPteoQnF6YJutkMJHDEw101BK2SjCHJ+wWLYfNCAg1p6k
	 wBEaRLE46TZhE4oHMOSyHP4g5JerprUGvkcsp1r6OwsCa96Y6hHJdBuwgeDhMhmamhmTv
	 6djtTvsDDlrnR+RTeBTwLdFD6ivg5+o8ytHP/WBUFjVWVR5+ID9ZMLL+mt0pr2r8oJg==
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=H4MFYrog;
	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 06EA3606A322;
	Mon, 16 Nov 2026 19:02:18 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 075741F000CD;
	Mon, 16 Nov 2026 19:02:17 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1794855738;
	bh=apkEuudvJbCekMTvJmYGOcll41kktITW2BH/+e4mxBQ=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=H4MFYrogSwS6fMiUMfz4GdTj54tZtWv4sFoApwopsY1RmKb0Klw15GSebGmo8c/MF
	 A9NxaoxHV7wc4D7Cn4L+/IMSc+HSWiyw5WJTE0l0eIOx6YNceLfkWei+CNPxuMKDvP
	 +Z2lD1RjKrSa8cnn4wyHEPRTiNwxWTBZHk3t6/99i0BPYlgRH2Lo4o+/v74/jiCvzP
	 +hb5bY8G48DrGwex2xI7AL7gIl3fRAWBRqvELnB3VKQrHjBQRk/tK2m3aCjxhlRjDB
	 HUFrB7CrRcn02gYL+FRj/qet8r8z8Y4SQ7p3i0zW7/8+SeT/zlSju/J5XdbJekeRrf
	 Lhk039PkTZ95Q==
X-Cc: netdev@vger.kernel.org, jonas.gorski@gmail.com, andrew@lunn.ch,
 olteanv@gmail.com, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org,
 pabeni@redhat.com, vivien.didelot@gmail.com, linux-kernel@vger.kernel.org
X-In-Reply-To: <20261112180202.324504-4-florian.fainelli@broadcom.com>
X-sashiko-severity: Medium
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