From: Florian Fainelli <florian.fainelli@broadcom.com>
To: netdev@vger.kernel.org
Cc: Florian Fainelli <florian.fainelli@broadcom.com>,
Jonas Gorski <jonas.gorski@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>,
Russell King <linux@armlinux.org.uk>,
"Russell King (Oracle)" <rmk+kernel@armlinux.org.uk>,
linux-kernel@vger.kernel.org (open list)
Subject: [PATCH net v3 2/2] net: dsa: b53: Enable legacy IGMP snooping controls
Date: Wed, 28 Oct 2026 16:51:00 -0700 [thread overview]
Message-ID: <20261028235100.3892374-3-florian.fainelli@broadcom.com> (raw)
In-Reply-To: <20261028235100.3892374-1-florian.fainelli@broadcom.com>
The older switches do not implement the high-level protocol control
register used by newer devices, so they are currently skipped when
setting up multicast control packet delivery to the CPU.
Enable the IP-layer IGMP classifier in the 8-bit global management
configuration register on BCM5325E, BCM5365, BCM5389, BCM5397/5398 and
BCM63xx. Their manuals place this control at bit 3 of page 0x02, offset
0x00. Preserve the other management fields and propagate access errors.
Clear the separate IGMP redirection enable on BCM6318 and BCM63268 to
use snooping mode, as documented in 6318-PR100-R and 63X68-PR201-R.
These legacy classifiers have fixed forwarding behavior, including
query flooding which excludes the IMP on BCM5397/5398 and BCM63xx.
They do not provide the newer per-message IGMP/MLD controls. This change
only enables the documented legacy IGMP handling; it does not add MLD
classification.
Keep BCM5325M and unidentified BCM5325 variants excluded. The BCM5325M
manual reserves the global management IGMP bit and instead describes
snooping through the shared mirroring engine, requiring a different
implementation and coordination with port mirroring.
Fixes: 5d65b64a3d97 ("net: dsa: b53: Add support for MDB")
Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
---
drivers/net/dsa/b53/b53_common.c | 23 ++++++++++++++++++++---
drivers/net/dsa/b53/b53_regs.h | 2 ++
2 files changed, 22 insertions(+), 3 deletions(-)
diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c
index e54f6d4d1f7b..957a1501d3f4 100644
--- a/drivers/net/dsa/b53/b53_common.c
+++ b/drivers/net/dsa/b53/b53_common.c
@@ -841,12 +841,29 @@ int b53_enable_mcast_snooping(struct b53_device *dev)
u16 val16;
u32 val;
int ret;
+ u8 val8;
- /* Older switches use different IGMP controls, not HL_PRTC_CTRL. */
- if (is5325(dev) || is5365(dev) || dev->chip_id == BCM5389_DEVICE_ID ||
- is5397_98(dev) || is63xx(dev))
+ /* BCM5325M snooping uses the mirroring engine instead. */
+ if (is5325(dev) && !is5325e(dev))
return 0;
+ /* Older switches classify IGMP in the global management register.
+ * They do not provide the separate MLD controls of newer switches.
+ */
+ if (is5325e(dev) || is5365(dev) ||
+ dev->chip_id == BCM5389_DEVICE_ID || is5397_98(dev) || is63xx(dev)) {
+ ret = b53_read8(dev, B53_MGMT_PAGE, B53_GLOBAL_CONFIG, &val8);
+ if (ret)
+ return ret;
+
+ val8 |= GC_IGMP_IP_EN;
+ /* Disable the separate IGMP redirection mode on BCM6318/63268. */
+ if (is6318_268(dev))
+ val8 &= ~GC_IGMP_RED_EN_6318_268;
+
+ return b53_write8(dev, B53_MGMT_PAGE, B53_GLOBAL_CONFIG, val8);
+ }
+
/* IGMPv2 and MLDv1 reports use the group's destination MAC. Once
* the first listener is offloaded, ordinary multicast forwarding
* can keep subsequent reports from reaching the bridge CPU.
diff --git a/drivers/net/dsa/b53/b53_regs.h b/drivers/net/dsa/b53/b53_regs.h
index cfdb5ed38326..e994d3a188c7 100644
--- a/drivers/net/dsa/b53/b53_regs.h
+++ b/drivers/net/dsa/b53/b53_regs.h
@@ -217,6 +217,8 @@
#define B53_GLOBAL_CONFIG 0x00
#define GC_RESET_MIB 0x01
#define GC_RX_BPDU_EN 0x02
+#define GC_IGMP_IP_EN BIT(3)
+#define GC_IGMP_RED_EN_6318_268 BIT(4)
#define GC_MIB_AC_HDR_EN 0x10
#define GC_MIB_AC_EN 0x20
#define GC_FRM_MGMT_PORT_M 0xC0
--
2.53.0
prev parent reply other threads:[~2026-10-28 23:51 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-28 23:50 [PATCH net v3 0/2] net: dsa: b53: Fix IGMP/MLD snooping Florian Fainelli
2026-10-28 23:50 ` [PATCH net v3 1/2] net: dsa: b53: Enable IGMP and MLD control packet CPU copies Florian Fainelli
2026-10-28 23:51 ` Florian Fainelli [this message]
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=20261028235100.3892374-3-florian.fainelli@broadcom.com \
--to=florian.fainelli@broadcom.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=jonas.gorski@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=pabeni@redhat.com \
--cc=rmk+kernel@armlinux.org.uk \
/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
all inboxes | Powered by JetHome®