Skip to content

mlxsw: Unified bridge conversion - part 4/6

Ido Schimmel netdev 1 version Applied

Status from this message: This series was applied to netdev/net-next.git (master)

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest13 patches 0 repliesApplied 13/13

Patches in v1 All 13 applied

#Subject and filesSizeRepliesApplied
1/13mlxsw: spectrum: Add a temporary variable to indicate bridge modeldrivers/net/ethernet/mellanox/mlxsw/spectrum.c drivers/net/ethernet/mellanox/mlxsw/spectrum.h+2 -00 repliesApplied
2/13mlxsw: spectrum_fid: Configure flooding table type for rFIDdrivers/net/ethernet/mellanox/mlxsw/reg.h drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c+14 -30 repliesApplied
3/13mlxsw: Prepare 'bridge_type' field for SFMR usagedrivers/net/ethernet/mellanox/mlxsw/reg.h drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c+9 -80 repliesApplied
4/13mlxsw: spectrum_fid: Store 'bridge_type' as part of FID familydrivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c+4 -50 repliesApplied
5/13mlxsw: Set flood bridge type for FIDsdrivers/net/ethernet/mellanox/mlxsw/reg.h drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c+14 -50 repliesApplied
6/13mlxsw: spectrum_fid: Configure egress VID classification for multicastdrivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c+23 -00 repliesApplied
7/13mlxsw: Add an initial PGT table supportdrivers/net/ethernet/mellanox/mlxsw/Makefile drivers/net/ethernet/mellanox/mlxsw/resources.h drivers/net/ethernet/mellanox/mlxsw/spectrum.h +1 more+136 -10 repliesApplied
8/13mlxsw: Add an indication of SMPE index validity for PGT tabledrivers/net/ethernet/mellanox/mlxsw/spectrum.c drivers/net/ethernet/mellanox/mlxsw/spectrum.h drivers/net/ethernet/mellanox/mlxsw/spectrum_pgt.c+7 -00 repliesApplied
9/13mlxsw: Add a dedicated structure for bitmap of portsdrivers/net/ethernet/mellanox/mlxsw/spectrum.h drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c+43 -190 repliesApplied
10/13mlxsw: Extend PGT APIs to support maintaining list of ports per entrydrivers/net/ethernet/mellanox/mlxsw/spectrum.h drivers/net/ethernet/mellanox/mlxsw/spectrum_pgt.c+231 -00 repliesApplied
11/13mlxsw: spectrum: Initialize PGT tabledrivers/net/ethernet/mellanox/mlxsw/spectrum.c+9 -00 repliesApplied
12/13mlxsw: spectrum_fid: Set 'mid_base' as part of flood tables initializationdrivers/net/ethernet/mellanox/mlxsw/reg.h drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c+32 -40 repliesApplied
13/13mlxsw: spectrum_fid: Configure flooding entries using PGT APIsdrivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c+59 -60 repliesApplied

Reviews trailers per patch

11 of 13 patches have a Reviewed-by or Acked-by.

PatchPetr Machata
1/13R-b
2/13R-b
3/13R-b
4/13R-b
5/13R-b
6/13R-b
7/13R-b
8/13R-b
9/13
10/13
11/13R-b
12/13R-b
13/13R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH net-next 00/13] mlxsw: Unified bridge conversion - part 4/6

This is the fourth part of the conversion of mlxsw to the unified bridge model.

Unlike previous parts that prepared mlxsw for the conversion, this part actually starts the conversion. It focuses on flooding configuration and converts mlxsw to the more "raw" APIs of the unified bridge model.

The patches configure the different stages of the flooding pipeline in Spectrum that looks as follows (at a high-level):

         +------------+                +----------+           +-------+
  {FID,  |            | {Packet type,  |          |           |       |  MID
   DMAC} | FDB lookup |  Bridge type}  |   SFGC   | MID base  |       | Index
+-------->   (miss)   +----------------> register +-----------> Adder +------->
         |            |                |          |           |       |
         |            |                |          |           |       |
         +------------+                +----+-----+           +---^---+
                                            |                     |
                                    Table   |                     |
                                     type   |                     | Offset
                                            |      +-------+      |
                                            |      |       |      |
                                            |      |       |      |
                                            +----->+  Mux  +------+
                                                   |       |
                                                   |       |
                                                   +-^---^-+
                                                     |   |
                                                  FID|   |FID
                                                     |   |offset
                                                     +   +

The multicast identifier (MID) index is used as an index to the port group table (PGT) that contains a bitmap of ports via which a packet needs to be replicated.

From the PGT table, the packet continues to the multicast port egress (MPE) table that determines the packet's egress VLAN. This is a two-dimensional table that is indexed by port and switch multicast port to egress (SMPE) index. The latter can be thought of as a FID. Without it, all the packets replicated via a certain port would get the same VLAN, regardless of the bridge domain (FID).

Logically, these two steps look as follows:

PGT table MPE table
+-----------------------+ +---------------+
| | {Local port, | | Egress

  MID index  | Local ports bitmap #1 |  SMPE index}  |               |  VID
+------------>        ...            +--------------->               +-------->
             | Local ports bitmap #N |               |               |
             |                       |          SMPE |               |
             +-----------------------+               +---------------+
                                                        Local port

Patchset overview:

Patch #1 adds a variable to guard against mixed model configuration. Will be removed in part 6 when mlxsw is fully converted to the unified model.

Patches #2-#5 introduce two new FID attributes required for flooding configuration in the new model:

1. 'flood_rsp': Instructs the firmware to handle flooding configuration for this FID. Only set for router FIDs (rFIDs) which are used to connect a {Port, VLAN} to the router block.

2. 'bridge_type': Allows the device to determine the flood table (i.e., base index to the PGT table) for the FID. The first type will be used for FIDs in a VLAN-aware bridge and the second for FIDs representing VLAN-unaware bridges.

Patch #6 configures the MPE table that determines the egress VLAN of a packet that is forwarded according to L2 multicast / flood.

Patches #7-#11 add the PGT table and related APIs to allocate entries and set / clear ports in them.

Patches #12-#13 convert the flooding configuration to use the new PGT APIs.

Amit Cohen (13):
mlxsw: spectrum: Add a temporary variable to indicate bridge model
mlxsw: spectrum_fid: Configure flooding table type for rFID
mlxsw: Prepare 'bridge_type' field for SFMR usage
mlxsw: spectrum_fid: Store 'bridge_type' as part of FID family
mlxsw: Set flood bridge type for FIDs
mlxsw: spectrum_fid: Configure egress VID classification for multicast
mlxsw: Add an initial PGT table support
mlxsw: Add an indication of SMPE index validity for PGT table
mlxsw: Add a dedicated structure for bitmap of ports
mlxsw: Extend PGT APIs to support maintaining list of ports per entry
mlxsw: spectrum: Initialize PGT table
mlxsw: spectrum_fid: Set 'mid_base' as part of flood tables
initialization
mlxsw: spectrum_fid: Configure flooding entries using PGT APIs

 drivers/net/ethernet/mellanox/mlxsw/Makefile  |   3 +-
 drivers/net/ethernet/mellanox/mlxsw/reg.h     |  17 +-
 .../net/ethernet/mellanox/mlxsw/resources.h   |   2 +
 .../net/ethernet/mellanox/mlxsw/spectrum.c    |  14 +
 .../net/ethernet/mellanox/mlxsw/spectrum.h    |  41 ++
 .../ethernet/mellanox/mlxsw/spectrum_fid.c    | 147 +++++++-
 .../ethernet/mellanox/mlxsw/spectrum_pgt.c    | 351 ++++++++++++++++++
 .../mellanox/mlxsw/spectrum_switchdev.c       |  37 +-
 8 files changed, 572 insertions(+), 40 deletions(-)
 create mode 100644 drivers/net/ethernet/mellanox/mlxsw/spectrum_pgt.c
Signature · 1 line
2.36.1