Skip to content

bridge: Fix snooping in multi-bridge config with switchdev

Joseph Huang bridge lkml netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest6 patches 6 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6bridge: Refactor br_mdb_notifynet/bridge/br_mdb.c net/bridge/br_private.h+36 -230 replies
2/6bridge: Offload mrouter port forwarding to switchdevnet/bridge/br_multicast.c+28 -00 replies
3/6bridge: Avoid traffic disruption when Querier state changesnet/bridge/br_mdb.c net/bridge/br_multicast.c net/bridge/br_private.h+75 -230 replies
4/6bridge: Force mcast_flooding for mrouter portsnet/bridge/br_multicast.c+15 -00 replies
5/6bridge: Flood Queries even when mcast_flood is disablednet/bridge/br_forward.c net/bridge/br_multicast.c net/bridge/br_private.h+8 -10 replies
6/6bridge: Always multicast_flood Reportsnet/bridge/br_device.c net/bridge/br_input.c net/bridge/br_multicast.c +1 more+12 -40 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH net 0/6] bridge: Fix snooping in multi-bridge config with switchdev

This series of patches contains the following fixes:

1. In a distributed system with multiple hardware-offloading bridges, if a multicast source is attached to a Non-Querier bridge, the bridge will not forward any multicast packets from that source to the Querier.

                    +--------------------+
                    |                    |
                    |      Snooping      |    +------------+
                    |      Bridge 1      |----| Listener 1 |
                    |     (Querier)      |    +------------+
                    |                    |
                    +--------------------+
                              |
                              |
                    +----+---------+-----+
                    |    | mrouter |     |
   +-----------+    |    +---------+     |    +------------+
   | MC Source |----|      Snooping      |----| Listener 2 |
   +-----------|    |      Bridge 2      |    +------------+
                    |    (Non-Querier)   |
                    +--------------------+

In this scenario, Listener 1 will never receive multicast traffic from MC Source since Snooping Bridge 2 does not forward multicast packets to the mrouter port. Patches 0001, 0002, and 0003 address this issue.

2. If mcast_flood is disabled on a bridge port, some of the snooping functions stop working properly.

a. Consider the following scenario:

                       +--------------------+
                       |                    |
                       |      Snooping      |    +------------+
                       |      Bridge 1      |----| Listener 1 |
                       |     (Querier)      |    +------------+
                       |                    |
                       +--------------------+
                                 |
                                 |
                       +--------------------+
                       |    | mrouter |     |
      +-----------+    |    +---------+     |
      | MC Source |----|      Snooping      |
      +-----------|    |      Bridge 2      |
                       |    (Non-Querier)   |
                       +--------------------+

In this scenario, Listener 1 will never receive multicast traffic from MC Source if mcast_flood is disabled on the mrouter port on Snooping Bridge 2. Patch 0004 addresses this issue.

b. For a Non-Querier bridge, if mcast_flood is disabled on a bridge
port, Queries received from other Querier will not be forwarded out of that bridge port. Patch 0005 addresses this issue.

3. After a system boots up, the first couple Reports are not handled properly:

1) the Report from the Host is being flooded (via br_flood) to all bridge ports, and
2) if the mrouter port's mcast_flood is disabled, the Reports received from other hosts will not be forwarded to the Querier.

Patch 0006 addresses this issue.

These patches were developed and verified initially against 5.4 kernel (due to hardware platform limitation) and forward-patched to 5.12. Snooping code introduced between 5.4 and 5.12 are not extensively tested (only IGMPv2/MLDv1 were tested). The hardware platform used were two bridges utilizing a single Marvell 88E6352 Ethernet switch chip (i.e., no cross-chip bridging involved).

Joseph Huang (6):
bridge: Refactor br_mdb_notify
bridge: Offload mrouter port forwarding to switchdev
bridge: Avoid traffic disruption when Querier state changes
bridge: Force mcast_flooding for mrouter ports
bridge: Flood Queries even when mcast_flood is disabled
bridge: Always multicast_flood Reports

 net/bridge/br_device.c    |   5 +-
 net/bridge/br_forward.c   |   3 +-
 net/bridge/br_input.c     |   5 +-
 net/bridge/br_mdb.c       |  70 +++++++++++++---------
 net/bridge/br_multicast.c | 121 ++++++++++++++++++++++++++++++++++----
 net/bridge/br_private.h   |  11 +++-
 6 files changed, 169 insertions(+), 46 deletions(-)

base-commit: 5e321ded302da4d8c5d5dd953423d9b748ab3775

Signature · 1 line
2.17.1