[PATCH RFC net-next 00/10] MC Flood disable and snooping

From: Joseph Huang
Date: Mon Apr 01 2024 - 20:13:39 EST


There is a use case where one would like to enable multicast snooping
on a bridge but disable multicast flooding on all bridge ports so that
registered multicast traffic will only reach the intended recipients and
unregistered multicast traffic will be dropped. However, with existing
bridge ports' mcast_flood flag implementation, it doesn't work as desired.

This patchset aims to make multicast snooping work even when multicast
flooding is disabled on the bridge ports, without changing the semantic of
the mcast_flood flag too much. Patches 1 to 4 attempt to address this issue.

Also, in a network where more than one multicast snooping capable bridges
are interconnected without multicast routers being present, multicast
snooping fails if:

1. The source is not directly attached to the Querier
2. The listener is beyond the mrouter port of the bridge where the
source is directly attached
3. A hardware offloading switch is involved

When all of the conditions are met, the listener will not receive any
multicast packets from the source. Patches 5 to 10 attempt to address this
issue. Specifically, patches 5 to 8 set up the infrastructure, patch 9
handles unregistered multicast packets forwarding, and patch 10 handles
registered multicast packets forwarding to the mrouter port.

The patches were developed against 5.15, and forward-ported to 6.8.
Tests were done on a Pi 4B + Marvell 6393X Eval board with a single
switch chip with no VLAN.

V1 -> V2:
- Moved the bulk of the change from the bridge to the mv88e6xxx driver.
- Added more patches (specifically 3 and 4) to workaround some more
issues with multicast flooding being disabled.

v1 here:
https://patchwork.kernel.org/project/netdevbpf/cover/20210504182259.5042-1-Joseph.Huang@xxxxxxxxxx/


Joseph Huang (10):
net: bridge: Flood Queries even when mc flood is disabled
net: bridge: Always multicast_flood Reports
net: bridge: Always flood local subnet mc packets
net: dsa: mv88e6xxx: Add all hosts mc addr to ATU
net: dsa: Add support for PORT_MROUTER attribute
net: dsa: mv88e6xxx: Track soft bridge objects
net: dsa: mv88e6xxx: Track bridge mdb objects
net: dsa: mv88e6xxx: Convert MAB to use bit flags
net: dsa: mv88e6xxx: Enable mc flood for mrouter port
net: dsa: mv88e6xxx: Offload mrouter port

drivers/net/dsa/mv88e6xxx/Kconfig | 12 +
drivers/net/dsa/mv88e6xxx/chip.c | 439 +++++++++++++++++++++++-
drivers/net/dsa/mv88e6xxx/chip.h | 16 +-
drivers/net/dsa/mv88e6xxx/global1_atu.c | 3 +-
include/net/dsa.h | 2 +
net/bridge/br_device.c | 5 +-
net/bridge/br_forward.c | 3 +-
net/bridge/br_input.c | 5 +-
net/bridge/br_multicast.c | 21 +-
net/bridge/br_private.h | 6 +
net/dsa/port.c | 11 +
net/dsa/port.h | 2 +
net/dsa/user.c | 6 +
13 files changed, 502 insertions(+), 29 deletions(-)

--
2.17.1