* [PATCH net] net: dsa: mv88e6xxx: Enable IGMP snooping on user ports only
@ 2023-03-29 15:01 Fabio Estevam
2023-03-29 15:12 ` Andrew Lunn
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Fabio Estevam @ 2023-03-29 15:01 UTC (permalink / raw)
To: kuba; +Cc: andrew, olteanv, netdev, steffen, Fabio Estevam
From: Steffen Bätz <steffen@innosonix•de>
Do not set the MV88E6XXX_PORT_CTL0_IGMP_MLD_SNOOP bit on CPU or DSA ports.
This allows the host CPU port to be a regular IGMP listener by sending out
IGMP Membership Reports, which would otherwise not be forwarded by the
mv88exxx chip, but directly looped back to the CPU port itself.
Fixes: 54d792f257c6 ("net: dsa: Centralise global and port setup code into mv88e6xxx.")
Signed-off-by: Steffen Bätz <steffen@innosonix•de>
Signed-off-by: Fabio Estevam <festevam@denx•de>
---
Changes since RFC:
- Use dsa_is_user_port() to decide when to set the snoop bit (Andrew).
- Reword the commit message to differentiate between IGMP snooping and an IGMP listener on
the bridge.
drivers/net/dsa/mv88e6xxx/chip.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
index b73d1d6747b7..62a126402983 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -3354,9 +3354,14 @@ static int mv88e6xxx_setup_port(struct mv88e6xxx_chip *chip, int port)
* If this is the upstream port for this switch, enable
* forwarding of unknown unicasts and multicasts.
*/
- reg = MV88E6XXX_PORT_CTL0_IGMP_MLD_SNOOP |
- MV88E6185_PORT_CTL0_USE_TAG | MV88E6185_PORT_CTL0_USE_IP |
+ reg = MV88E6185_PORT_CTL0_USE_TAG | MV88E6185_PORT_CTL0_USE_IP |
MV88E6XXX_PORT_CTL0_STATE_FORWARDING;
+ /* Forward any IPv4 IGMP or IPv6 MLD frames received
+ * by a USER port to the CPU port to allow snooping.
+ */
+ if (dsa_is_user_port(ds, port))
+ reg |= MV88E6XXX_PORT_CTL0_IGMP_MLD_SNOOP;
+
err = mv88e6xxx_port_write(chip, port, MV88E6XXX_PORT_CTL0, reg);
if (err)
return err;
--
2.34.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH net] net: dsa: mv88e6xxx: Enable IGMP snooping on user ports only
2023-03-29 15:01 [PATCH net] net: dsa: mv88e6xxx: Enable IGMP snooping on user ports only Fabio Estevam
@ 2023-03-29 15:12 ` Andrew Lunn
2023-03-30 12:08 ` Vladimir Oltean
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Andrew Lunn @ 2023-03-29 15:12 UTC (permalink / raw)
To: Fabio Estevam; +Cc: kuba, olteanv, netdev, steffen, Fabio Estevam
On Wed, Mar 29, 2023 at 12:01:40PM -0300, Fabio Estevam wrote:
> From: Steffen Bätz <steffen@innosonix•de>
>
> Do not set the MV88E6XXX_PORT_CTL0_IGMP_MLD_SNOOP bit on CPU or DSA ports.
>
> This allows the host CPU port to be a regular IGMP listener by sending out
> IGMP Membership Reports, which would otherwise not be forwarded by the
> mv88exxx chip, but directly looped back to the CPU port itself.
>
> Fixes: 54d792f257c6 ("net: dsa: Centralise global and port setup code into mv88e6xxx.")
> Signed-off-by: Steffen Bätz <steffen@innosonix•de>
> Signed-off-by: Fabio Estevam <festevam@denx•de>
Reviewed-by: Andrew Lunn <andrew@lunn•ch>
Andrew
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH net] net: dsa: mv88e6xxx: Enable IGMP snooping on user ports only
2023-03-29 15:01 [PATCH net] net: dsa: mv88e6xxx: Enable IGMP snooping on user ports only Fabio Estevam
2023-03-29 15:12 ` Andrew Lunn
@ 2023-03-30 12:08 ` Vladimir Oltean
2023-03-30 12:52 ` Florian Fainelli
2023-03-30 18:40 ` patchwork-bot+netdevbpf
3 siblings, 0 replies; 5+ messages in thread
From: Vladimir Oltean @ 2023-03-30 12:08 UTC (permalink / raw)
To: Fabio Estevam; +Cc: kuba, andrew, netdev, steffen, Fabio Estevam
On Wed, Mar 29, 2023 at 12:01:40PM -0300, Fabio Estevam wrote:
> From: Steffen Bätz <steffen@innosonix•de>
>
> Do not set the MV88E6XXX_PORT_CTL0_IGMP_MLD_SNOOP bit on CPU or DSA ports.
>
> This allows the host CPU port to be a regular IGMP listener by sending out
> IGMP Membership Reports, which would otherwise not be forwarded by the
> mv88exxx chip, but directly looped back to the CPU port itself.
>
> Fixes: 54d792f257c6 ("net: dsa: Centralise global and port setup code into mv88e6xxx.")
I checked to see if the Fixes tag is correct, and... it's complicated.
That patch comes from the consolidation of multiple drivers
(mv88e6123_61_65.c, mv88e6131.c, mv88e6171.c, mv88e6352.c into what
later became the common mv88e6xxx driver. In principle, each of the
above drivers had their own buggy pre-existing logic to enable IGMP/MLD
snooping on all ports, but it seems a pointless exercise to add
individual Fixes: tags for all drivers prior to an unification process
that took place in 2015. So this gets my:
Reviewed-by: Vladimir Oltean <olteanv@gmail•com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH net] net: dsa: mv88e6xxx: Enable IGMP snooping on user ports only
2023-03-29 15:01 [PATCH net] net: dsa: mv88e6xxx: Enable IGMP snooping on user ports only Fabio Estevam
2023-03-29 15:12 ` Andrew Lunn
2023-03-30 12:08 ` Vladimir Oltean
@ 2023-03-30 12:52 ` Florian Fainelli
2023-03-30 18:40 ` patchwork-bot+netdevbpf
3 siblings, 0 replies; 5+ messages in thread
From: Florian Fainelli @ 2023-03-30 12:52 UTC (permalink / raw)
To: Fabio Estevam, kuba; +Cc: andrew, olteanv, netdev, steffen, Fabio Estevam
On 3/29/2023 8:01 AM, Fabio Estevam wrote:
> From: Steffen Bätz <steffen@innosonix•de>
>
> Do not set the MV88E6XXX_PORT_CTL0_IGMP_MLD_SNOOP bit on CPU or DSA ports.
>
> This allows the host CPU port to be a regular IGMP listener by sending out
> IGMP Membership Reports, which would otherwise not be forwarded by the
> mv88exxx chip, but directly looped back to the CPU port itself.
>
> Fixes: 54d792f257c6 ("net: dsa: Centralise global and port setup code into mv88e6xxx.")
> Signed-off-by: Steffen Bätz <steffen@innosonix•de>
> Signed-off-by: Fabio Estevam <festevam@denx•de>
Reviewed-by: Florian Fainelli <f.fainelli@gmail•com>
--
Florian
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH net] net: dsa: mv88e6xxx: Enable IGMP snooping on user ports only
2023-03-29 15:01 [PATCH net] net: dsa: mv88e6xxx: Enable IGMP snooping on user ports only Fabio Estevam
` (2 preceding siblings ...)
2023-03-30 12:52 ` Florian Fainelli
@ 2023-03-30 18:40 ` patchwork-bot+netdevbpf
3 siblings, 0 replies; 5+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-03-30 18:40 UTC (permalink / raw)
To: Fabio Estevam; +Cc: kuba, andrew, olteanv, netdev, steffen, festevam
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel•org>:
On Wed, 29 Mar 2023 12:01:40 -0300 you wrote:
> From: Steffen Bätz <steffen@innosonix•de>
>
> Do not set the MV88E6XXX_PORT_CTL0_IGMP_MLD_SNOOP bit on CPU or DSA ports.
>
> This allows the host CPU port to be a regular IGMP listener by sending out
> IGMP Membership Reports, which would otherwise not be forwarded by the
> mv88exxx chip, but directly looped back to the CPU port itself.
>
> [...]
Here is the summary with links:
- [net] net: dsa: mv88e6xxx: Enable IGMP snooping on user ports only
https://git.kernel.org/netdev/net/c/7bcad0f0e6fb
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2023-03-30 18:40 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-29 15:01 [PATCH net] net: dsa: mv88e6xxx: Enable IGMP snooping on user ports only Fabio Estevam
2023-03-29 15:12 ` Andrew Lunn
2023-03-30 12:08 ` Vladimir Oltean
2023-03-30 12:52 ` Florian Fainelli
2023-03-30 18:40 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox