Skip to content

mlxsw: Preparations for support of CFF flood mode

Petr Machata netdev 1 version Applied

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

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest14 patches 0 repliesApplied 14/14

Patches in v1 All 14 applied

#Subject and filesSizeRepliesApplied
1/14mlxsw: cmd: Add cmd_mbox.query_fw.cff_supportdrivers/net/ethernet/mellanox/mlxsw/cmd.h+6 -00 repliesApplied
2/14mlxsw: cmd: Add MLXSW_CMD_MBOX_CONFIG_PROFILE_FLOOD_MODE_CFFdrivers/net/ethernet/mellanox/mlxsw/cmd.h+5 -00 repliesApplied
3/14mlxsw: resources: Add max_cap_nve_flood_prfdrivers/net/ethernet/mellanox/mlxsw/resources.h+2 -00 repliesApplied
4/14mlxsw: reg: Add Switch FID Flooding Profiles Registerdrivers/net/ethernet/mellanox/mlxsw/reg.h+45 -00 repliesApplied
5/14mlxsw: reg: Mark SFGC & some SFMR fields as reserved in CFF modedrivers/net/ethernet/mellanox/mlxsw/reg.h+6 -00 repliesApplied
6/14mlxsw: reg: Drop unnecessary writes from mlxsw_reg_sfmr_pack()drivers/net/ethernet/mellanox/mlxsw/reg.h+0 -20 repliesApplied
7/14mlxsw: reg: Extract flood-mode specific part of mlxsw_reg_sfmr_pack()drivers/net/ethernet/mellanox/mlxsw/reg.h drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c+10 -100 repliesApplied
8/14mlxsw: reg: Add to SFMR register the fields related to CFF flood modedrivers/net/ethernet/mellanox/mlxsw/reg.h+20 -00 repliesApplied
9/14mlxsw: core, pci: Add plumbing related to CFF modedrivers/net/ethernet/mellanox/mlxsw/core.c drivers/net/ethernet/mellanox/mlxsw/core.h drivers/net/ethernet/mellanox/mlxsw/pci.c+28 -00 repliesApplied
10/14mlxsw: pci: Permit enabling CFF modedrivers/net/ethernet/mellanox/mlxsw/core.h drivers/net/ethernet/mellanox/mlxsw/pci.c+14 -10 repliesApplied
11/14mlxsw: spectrum_fid: Drop unnecessary conditionsdrivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c+0 -60 repliesApplied
12/14mlxsw: spectrum_fid: Extract SFMR packing into a helperdrivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c+25 -200 repliesApplied
13/14mlxsw: spectrum_router: Add a helper to get subport number from a RIFdrivers/net/ethernet/mellanox/mlxsw/spectrum.h drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c+16 -00 repliesApplied
14/14mlxsw: spectrum_router: Call RIF setup before obtaining FIDdrivers/net/ethernet/mellanox/mlxsw/spectrum_router.c+3 -30 repliesApplied

Reviews trailers per patch

All 14 patches have a Reviewed-by or Acked-by.

PatchAmit CohenIdo Schimmel
1/14R-b R-b
2/14R-b R-b
3/14R-b R-b
4/14R-b R-b
5/14R-b R-b
6/14R-b R-b
7/14R-b R-b
8/14R-b R-b
9/14R-b R-b
10/14R-b R-b
11/14R-b R-b
12/14R-b R-b
13/14R-b R-b
14/14R-b R-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/14] mlxsw: Preparations for support of CFF flood mode

PGT is an in-HW table that maps addresses to sets of ports. Then when some HW process needs a set of ports as an argument, instead of embedding the actual set in the dynamic configuration, what gets configured is the address referencing the set. The HW then works with the appropriate PGT entry.

Among other allocations, the PGT currently contains two large blocks for bridge flooding: one for 802.1q and one for 802.1d. Within each of these blocks are three tables, for unknown-unicast, multicast and broadcast flooding:

      . . . |    802.1q    |    802.1d    | . . .
            | UC | MC | BC | UC | MC | BC |

\______ _____/ \_____ ______/
v v
FID flood vectors

Thus each FID (which corresponds to an 802.1d bridge or one VLAN in an 802.1q bridge) uses three flood vectors spread across a fairly large region of PGT.

This way of organizing the flood table (called "controlled") is not very flexible. E.g. to decrease a bridge scale and store more IP MC vectors, one would need to completely rewrite the bridge PGT blocks, or resort to hacks such as storing individual MC flood vectors into unused part of the bridge table.

In order to address these shortcomings, Spectrum-2 and above support what is called CFF flood mode, for Compressed FID Flooding. In CFF flood mode, each FID has a little table of its own, with three entries adjacent to each other, one for unknown-UC, one for MC, one for BC. This allows for a much more fine-grained approach to PGT management, where bits of it are allocated on demand.

      . . . | FID | FID | FID | FID | FID | . . .
            |U|M|B|U|M|B|U|M|B|U|M|B|U|M|B|

\_____________ _____________/
v
FID flood vectors

Besides the FID table organization, the CFF flood mode also impacts Router Subport (RSP) table. This table contains flood vectors for rFIDs, which are FIDs that reference front panel ports or LAGs. The RSP table contains two entries per front panel port and LAG, one for unknown-UC traffic, and one for everything else. Currently, the FW allocates and manages the table in its own part of PGT. rFIDs are marked with flood_rsp bit and managed specially. In CFF mode, rFIDs are managed as all other FIDs. The driver therefore has to allocate and maintain the flood vectors. Like with bridge FIDs, this is more work, but increases flexibility of the system.

The FW currently supports both the controlled and CFF flood modes. To shed complexity, in the future it should only support CFF flood mode. Hence this patchset, which is the first in series of two to add CFF flood mode support to mlxsw.

There are FW versions out there that do not support CFF flood mode, and on Spectrum-1 in particular, there is no plan to support it at all. mlxsw will therefore have to support both controlled flood mode as well as CFF.

Another aspect is that at least on Spectrum-1, there are FW versions out there that claim to support CFF flood mode, but then reject or ignore configurations enabling the same. The driver thus has to have a say in whether an attempt to configure CFF flood mode should even be made.

Much like with the LAG mode, the feature is therefore expressed in terms of "does the driver prefer CFF flood mode?", and "what flood mode the PCI module managed to configure the FW with". This gives to the driver a chance to determine whether CFF flood mode configuration should be attempted.

In this patchset, we lay the ground with new definitions, registers and their fields, and some minor code shaping. The next patchset will be more focused on introducing necessary abstractions and implementation.

- Patches #1 and #2 add CFF-related items to the command interface.

- Patch #3 adds a new resource, for maximum number of flood profiles supported. (A flood profile is a mapping between traffic type and offset in the per-FID flood vector table.)

- Patches #4 to #8 adjust reg.h. The SFFP register is added, which is used for configuring the abovementioned traffic-type-to-offset mapping. The SFMR, register, which serves for FID configuration, is extended with fields specific to CFF mode. And other minor adjustments.

- Patches #9 and #10 add the plumbing for CFF mode: a way to request that CFF flood mode be configured, and a way to query the flood mode that was actually configured.

- Patch #11 removes dead code.

- Patches #12 and #13 add helpers that the next patchset will make use of. Patch #14 moves RIF setup ahead so that FID code can make use of it.

Petr Machata (14):
mlxsw: cmd: Add cmd_mbox.query_fw.cff_support
mlxsw: cmd: Add MLXSW_CMD_MBOX_CONFIG_PROFILE_FLOOD_MODE_CFF
mlxsw: resources: Add max_cap_nve_flood_prf
mlxsw: reg: Add Switch FID Flooding Profiles Register
mlxsw: reg: Mark SFGC & some SFMR fields as reserved in CFF mode
mlxsw: reg: Drop unnecessary writes from mlxsw_reg_sfmr_pack()
mlxsw: reg: Extract flood-mode specific part of mlxsw_reg_sfmr_pack()
mlxsw: reg: Add to SFMR register the fields related to CFF flood mode
mlxsw: core, pci: Add plumbing related to CFF mode
mlxsw: pci: Permit enabling CFF mode
mlxsw: spectrum_fid: Drop unnecessary conditions
mlxsw: spectrum_fid: Extract SFMR packing into a helper
mlxsw: spectrum_router: Add a helper to get subport number from a RIF
mlxsw: spectrum_router: Call RIF setup before obtaining FID

 drivers/net/ethernet/mellanox/mlxsw/cmd.h     | 11 +++
 drivers/net/ethernet/mellanox/mlxsw/core.c    |  7 ++
 drivers/net/ethernet/mellanox/mlxsw/core.h    |  9 +++
 drivers/net/ethernet/mellanox/mlxsw/pci.c     | 27 ++++++-
 drivers/net/ethernet/mellanox/mlxsw/reg.h     | 78 +++++++++++++++++--
 .../net/ethernet/mellanox/mlxsw/resources.h   |  2 +
 .../net/ethernet/mellanox/mlxsw/spectrum.h    |  2 +
 .../ethernet/mellanox/mlxsw/spectrum_fid.c    | 46 ++++++-----
 .../ethernet/mellanox/mlxsw/spectrum_router.c | 20 ++++-
 9 files changed, 170 insertions(+), 32 deletions(-)
Signature · 1 line
2.41.0