๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #21346

Re: [PATCH net v3 1/3] net: dsa: motorcomm: Ignore multicast addresses in FDB ops

#21346
From: netdev-bot+sashiko
Date: Mon, 23 Nov 2026 22:11
119 lines
12347 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 does not say what actually breaks in hardware,
  even though the patch carries a Fixes: tag.
- [Low] For multicast MACs, yt921x_dsa_port_fdb_add() now returns 0
  without writing anything to the switch.

--

net: dsa: motorcomm: Ignore multicast addresses in FDB ops

This patch makes yt921x_dsa_port_fdb_add() and yt921x_dsa_port_fdb_del()
return early for multicast MAC addresses. Multicast entries are then no
longer touched from the FDB path, because the software bridge never
forwards according to a multicast FDB entry.

> The software bridge never forwards according to an FDB entry with a
> multicast MAC. A multicast entry created by "bridge fdb add" is
> therefore inert in the software data path, but its switchdev
> notification still reaches .port_fdb_add().
>
> Ignore multicast addresses in .port_fdb_add() and .port_fdb_del() so
> multicast entries are not touched from FDB side.

[Severity: Low]
This isn't a bug, but could the commit message say what goes wrong in
hardware without this change? The patch carries a Fixes: tag, and the
description does not mention the user-visible impact.

In this driver the FDB and MDB ops share one hardware table. They use
the same (addr, vid) key and the same helpers:

drivers/net/dsa/motorcomm/chip.c:yt921x_dsa_port_mdb_add() {
    ...
	res = yt921x_fdb_join(priv, addr, vid, BIT(port));
    ...
}

yt921x_dsa_port_mdb_del() calls yt921x_fdb_leave(), which is also what
the FDB ops called before this patch.

Before this patch, "bridge fdb add <mcast> dev swpN master static" wrote
a static hardware entry. The switch then forwarded that group by the FDB
port mask, while the software bridge forwarded it by MDB or by flooding.

Also, a later "bridge fdb del" of an address that MDB had also
programmed ran yt921x_fdb_leave(). That cleared the port bit from the
MDB-owned entry, or deleted the entry once no ports were left:

drivers/net/dsa/motorcomm/chip.c:yt921x_fdb_leave() {
    ...
	if (!(ctrl2 & YT921X_FDB_IO2_EGR_PORTS_M)) {
		ctrl = YT921X_FDB_OP_OP_DEL | YT921X_FDB_OP_START;
    ...
}

After that, hardware multicast forwarding no longer matches the software
MDB, which still believes the group is offloaded.

Could these two effects be described in the commit message?

> diff --git a/drivers/net/dsa/motorcomm/chip.c b/drivers/net/dsa/motorcomm/chip.c
> index c753c746490a1..9a9e8ed76e01f 100644
> --- a/drivers/net/dsa/motorcomm/chip.c
> +++ b/drivers/net/dsa/motorcomm/chip.c

[ ... ]

> @@ -876,6 +879,12 @@ yt921x_dsa_port_fdb_add(struct dsa_switch *ds, int port,
>  	struct yt921x_priv *priv = dsa_to_yt921x_priv(ds);
>  	int res;
>  
> +	/* The software bridge never forwards according to an FDB entry with a
> +	 * multicast MAC, do not touch it from the FDB path
> +	 */
> +	if (is_multicast_ether_addr(addr))
> +		return 0;

[Severity: Low]
Will returning 0 here make the bridge report the multicast entry as
offloaded, even though nothing was written to the switch?

dsa_user_switchdev_event_work() in net/dsa/user.c treats any 0 return
as a successful offload:

dsa_user_switchdev_event_work()
    dsa_port_fdb_add()
        yt921x_dsa_port_fdb_add()    <- returns 0 for multicast
    dsa_fdb_offload_notify()
        info.offloaded = true;
        call_switchdev_notifiers(SWITCHDEV_FDB_OFFLOADED, ...)

The bridge handles this in br_fdb_offloaded_set(), which sets
BR_FDB_OFFLOADED. br_fdb_fill_info() then reports NTF_OFFLOADED.

As a result, "bridge fdb show" would list the multicast entry as
"offload", but the hardware table has no such entry. The driver's fdb
dump path also filters out multicast, so the hardware side shows
nothing. Before this patch the entry was actually programmed.

For comparison, rtl83xx_port_fdb_add() and rtl83xx_port_fdb_del() in
drivers/net/dsa/realtek/rtl83xx.c return -EOPNOTSUPP for the same
check.

If 0 was chosen on purpose, for example to avoid the dev_err() that the
deferred work prints on failure, could the commit message or the code
comment say so?

This also seems to remain after the later patch in this series, "net:
dsa: motorcomm: Rewrite FDB entry on port migration". That patch keeps
the multicast early return of 0 in both fdb_add and fdb_del.

-- 
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261119221110.1123578-1-mmyangfl%40gmail.com
Technical Details
Message-ID: <179547187046.3135.5287571257450168353@kernel.org>
Path: mbox-mo1.pugleaf.net!news-can.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-369809-linux-kernel-netdev=dewy.ru
References: <20261119221110.1123578-2-mmyangfl@gmail.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-can.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-369809-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net v3 1/3] net: dsa: motorcomm: Ignore multicast
 addresses in FDB ops
Date: Mon, 23 Nov 2026 22:11:10 +0000
Organization: Usenet Network
Message-ID: <179547187046.3135.5287571257450168353@kernel.org>
References: <20261119221110.1123578-2-mmyangfl@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="3996206"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:C+IsufxYSQkuovXtwZ3bTN79iHw= sha256:3A8OKXOjy8eBF70puy287Lzsqq6vGjTIQjw/frNT/ts=
	sha1:MCMISC3RerdZ9z9rWaqszfZqxDA= sha256:1UoP36/eNTArfcLKPu0Tzqc+raPtYWUtnykotp7zNS8=
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 527C6125DC7; Tue, 24 Nov 2026 01:11:29 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.5
X-Spam-Status: No, score=-3.5 tagged_above=-9999 required=6.31
	tests=[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 sic37Njra9jk;
	Tue, 24 Nov 2026 01:11:24 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-369809-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 sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74])
	by mail.dewy.ru (Postfix) with ESMTPS id EBD7A125DC8; Tue, 24 Nov 2026 01:11:15 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sto.lore.kernel.org (Postfix) with ESMTP id 96877605A9F; Mon, 23 Nov 2026 22:11:14 +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=1795471873;
	b=JVuz9kSNRu2GbtUcRjRWO//0xgPp7PArVH0TyOMhuJ0/96/rqy2eDgHxuuc+Ctr2y4+s
	 TO0VuiNLjDOqlvCdHt0YVwaVzr83bbjKqQmNXMCamRlrm089qvonOYV47zN/okiPv7rls
	 wFtUO3oYO/LiCHV549U87A616+LMNQ5CXNim4noSpf6UNWY9Sb1tN3T4BhuyAMoQ/vCQG
	 MiPUlee7SFwP3y8bBJhUU4r2aPqfyElfmsmO5svuH1naWQe6Nsx+E+3tkN5DVNu/IAu9w
	 UdZap4YmaffEUsvhGJmfkb0++2ny/2S76tBoCRXzNmAAi/GptYPXPW5a+Wjuv9NDgSw==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795471873;
	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=4xHRp9aZooZyc9nci6AtLM+Hkldl0hr3+96Zvxfc5+Q=;
	b=0rlPoZCr5sCHicGU6Yg2EdBZAxYGMblU3shZzy5Ql+yU2xScoIMlqD4wTaIpjxNCW5qU
	 FjzrLV9uBzPoo1VjNmMOv69CaaMTPwGdcBz5JT7+ddti6tcbX+tE8732zOvyK8jYxShk/
	 hx/tOOaA60nvNri9Cg8JI+HQxJsZ3p1HiQEmK6SeiAcoE2rrG1t0cJyTe/Q2IqNINuxy7
	 p5EHSaf8yJSlh+gze6XFTiyJRM0829MFWtWb9+XyOILMxUSEn+7GItBAeLJv1nABG4OmC
	 KbfkHUjSGX49qv046/9v58BDGkNv6C9ImDDnQ8sV3hlGLoyq4r89ia6NcVcD1wJA76A==
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=Y2JOJRLC;
	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 F0C1B606A327;
	Mon, 23 Nov 2026 22:11:12 +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=Y2JOJRLC
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=1795471872;
	b=wMV4PSffdZLw6Zeo4BMKDcQTjAcReQP1pVrPdpe0X0wbtzBkyDOROKLycCi5fYVsMAcN
	 rZpxWEDN69HEpuMhVNgxBgY8Sqm4ix5dX9oHhC5ylAyhh7LiJWoEzKgZg5cEVjb39J0BL
	 gDJ8DmaLiUrtUHYetOabLiRPivMDy15A+UyrtY0K4Xn/jooaNuyXnPxFd4cvb34tTBQGK
	 kbj2PAftUrr37BAvDUZ1HjuP2KJRmNKSed04cTHEnfa/xlVvRmVGV5U0whO6FYkLZC2/6
	 +aXzxTny5yJL0JacwTVLtMUSaj/87IRmhL7GZS4/srpmjLUVDggKRik6hCylYs4nnGA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795471872;
	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=4xHRp9aZooZyc9nci6AtLM+Hkldl0hr3+96Zvxfc5+Q=;
	b=QAYBJwx9xub48mMR56FcT2ICJ2VrcDczzB8q2ruhFaIYF1fhw/2KouAHlbliKaL3vHiz
	 PInZrn+qjHl3181A0IRyO8KiwlQr8jwBfX4cEq3vSbFJTHAEzQsgA6KkhLGJLoOt6c8KA
	 tjIcd0M51bwdN88ZNdxKjASL7v1Wd1mmsEfvvi+zpqLY0hf2ZR+/FnEJS1Cg64aK6Ja2p
	 VeaEPb/o+AsIkqnFScHHNdO2Lb1RNwRpcRyqmUz2zyryNQfigf9nekA8BvxqsCS0QFdFx
	 EQ74JrnSmRdSl4DUtBGvtHVkmELomO4FUMMnmrFFBxkiZGaBfg8kKpuM0IOpt2Vy0TQ==
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=Y2JOJRLC;
	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 1DABC606A334
	for <netdev@vger.kernel.org>; Mon, 23 Nov 2026 22:11:11 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id DDEBD1F000D2;
	Mon, 23 Nov 2026 22:11:10 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1795471871;
	bh=4xHRp9aZooZyc9nci6AtLM+Hkldl0hr3+96Zvxfc5+Q=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=Y2JOJRLCiRKr85/tYVMzcedSLeQsCpKNLLCWADK6sEfWot2F7kmS/9W7kPwF1Ah2J
	 iy0gv8cIk5bTrqVpu/4uU9l3gnPDCtBdkTsnJhcV8PJ197RxIhzxs/LS4ju/MwP/9r
	 nan3886Hcwn80c6VPDpOQzCgNW66MxeWhcVHMcHjJrLUARRVqsmnfVD5jXVmhoOCR9
	 zW1zc571GQcLwYA4cM5iEAeMlMa6oj0zvmhN6qtf4Im2uug3p/mvSotUcK0biEpHc3
	 5blWlrxYEprBd3jX82IQ5LkXzUOKZG+ssVkiqXLmu50Y37tuDgr1xEqmSMVlTOjvQ0
	 zTKLGjKyDqaDg==
X-Cc: netdev@vger.kernel.org, andrew@lunn.ch, olteanv@gmail.com,
 davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com
X-In-Reply-To: <20261119221110.1123578-2-mmyangfl@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