Netdev List
 help / color / mirror / Atom feed
From: David Yang <mmyangfl@gmail.com>
To: netdev@vger.kernel.org
Cc: David Yang <mmyangfl@gmail.com>, Andrew Lunn <andrew@lunn.ch>,
	Vladimir Oltean <olteanv@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>
Subject: [PATCH net v3 1/3] net: dsa: motorcomm: Ignore multicast addresses in FDB ops
Date: Fri, 20 Nov 2026 06:10:41 +0800	[thread overview]
Message-ID: <20261119221110.1123578-2-mmyangfl@gmail.com> (raw)
In-Reply-To: <20261119221110.1123578-1-mmyangfl@gmail.com>

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.

Fixes: 186623f4aa72 ("net: dsa: yt921x: Add support for Motorcomm YT921x")
Signed-off-by: David Yang <mmyangfl@gmail.com>
---
 drivers/net/dsa/motorcomm/chip.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/net/dsa/motorcomm/chip.c b/drivers/net/dsa/motorcomm/chip.c
index b12bf32f8896..eddec2f26586 100644
--- a/drivers/net/dsa/motorcomm/chip.c
+++ b/drivers/net/dsa/motorcomm/chip.c
@@ -862,6 +862,9 @@ yt921x_dsa_port_fdb_del(struct dsa_switch *ds, int port,
 	struct yt921x_priv *priv = dsa_to_yt921x_priv(ds);
 	int res;
 
+	if (is_multicast_ether_addr(addr))
+		return 0;
+
 	mutex_lock(&priv->reg_lock);
 	res = yt921x_fdb_leave(priv, addr, vid, BIT(port));
 	mutex_unlock(&priv->reg_lock);
@@ -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;
+
 	mutex_lock(&priv->reg_lock);
 	res = yt921x_fdb_join(priv, addr, vid, BIT(port));
 	mutex_unlock(&priv->reg_lock);
-- 
2.53.0


  reply	other threads:[~2026-11-19 22:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-19 22:10 [PATCH net v3 0/3] net: dsa: motorcomm: FDB fixup David Yang
2026-11-19 22:10 ` David Yang [this message]
2026-11-19 22:10 ` [PATCH net v3 2/3] net: dsa: motorcomm: Do not inherit ports from dynamic FDB entries David Yang
2026-11-19 22:10 ` [PATCH net v3 3/3] net: dsa: motorcomm: Rewrite FDB entry on port migration David Yang

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=20261119221110.1123578-2-mmyangfl@gmail.com \
    --to=mmyangfl@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --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