mbox series

[net-next,00/14] mlxsw: Preparations for support of CFF flood mode

Message ID cover.1700503643.git.petrm@nvidia.com (mailing list archive)
Headers show
Series mlxsw: Preparations for support of CFF flood mode | expand

Message

Petr Machata Nov. 20, 2023, 6:25 p.m. UTC
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(-)

Comments

patchwork-bot+netdevbpf@kernel.org Nov. 21, 2023, 11 p.m. UTC | #1
Hello:

This series was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Mon, 20 Nov 2023 19:25:17 +0100 you wrote:
> 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:
> 
> [...]

Here is the summary with links:
  - [net-next,01/14] mlxsw: cmd: Add cmd_mbox.query_fw.cff_support
    https://git.kernel.org/netdev/net-next/c/8405d6626289
  - [net-next,02/14] mlxsw: cmd: Add MLXSW_CMD_MBOX_CONFIG_PROFILE_FLOOD_MODE_CFF
    https://git.kernel.org/netdev/net-next/c/50ee67789b82
  - [net-next,03/14] mlxsw: resources: Add max_cap_nve_flood_prf
    https://git.kernel.org/netdev/net-next/c/2d19da927719
  - [net-next,04/14] mlxsw: reg: Add Switch FID Flooding Profiles Register
    https://git.kernel.org/netdev/net-next/c/e1e4ce6c6d54
  - [net-next,05/14] mlxsw: reg: Mark SFGC & some SFMR fields as reserved in CFF mode
    https://git.kernel.org/netdev/net-next/c/7eb902954b62
  - [net-next,06/14] mlxsw: reg: Drop unnecessary writes from mlxsw_reg_sfmr_pack()
    https://git.kernel.org/netdev/net-next/c/642d6a2033d8
  - [net-next,07/14] mlxsw: reg: Extract flood-mode specific part of mlxsw_reg_sfmr_pack()
    https://git.kernel.org/netdev/net-next/c/446bc1e9dec6
  - [net-next,08/14] mlxsw: reg: Add to SFMR register the fields related to CFF flood mode
    https://git.kernel.org/netdev/net-next/c/6b10371c386c
  - [net-next,09/14] mlxsw: core, pci: Add plumbing related to CFF mode
    https://git.kernel.org/netdev/net-next/c/095915956867
  - [net-next,10/14] mlxsw: pci: Permit enabling CFF mode
    https://git.kernel.org/netdev/net-next/c/9aad19a363f6
  - [net-next,11/14] mlxsw: spectrum_fid: Drop unnecessary conditions
    https://git.kernel.org/netdev/net-next/c/b51c876c2297
  - [net-next,12/14] mlxsw: spectrum_fid: Extract SFMR packing into a helper
    https://git.kernel.org/netdev/net-next/c/2b7bccd1f167
  - [net-next,13/14] mlxsw: spectrum_router: Add a helper to get subport number from a RIF
    https://git.kernel.org/netdev/net-next/c/27851dfaa3d6
  - [net-next,14/14] mlxsw: spectrum_router: Call RIF setup before obtaining FID
    https://git.kernel.org/netdev/net-next/c/f7ebb4023765

You are awesome, thank you!