mbox series

[net-next,00/11] mlxsw: Move allocation of LAG table to the driver

Message ID cover.1697710282.git.petrm@nvidia.com (mailing list archive)
Headers show
Series mlxsw: Move allocation of LAG table to the driver | expand

Message

Petr Machata Oct. 19, 2023, 10:27 a.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.

Within the PGT is placed a LAG table. That is a contiguous block of PGT
memory where each entry describes which ports are members of the
corresponding LAG port.

The PGT is split to two parts: one managed by the FW, and one managed by
the driver. Historically, the FW part included also the LAG table, referred
to as FW LAG mode. Giving the responsibility for placement of the LAG table
to the driver, referred to as SW LAG mode, makes the whole system more
flexible. The FW currently supports both FW and SW LAG modes. To shed
complexity, the FW should in the future only support SW LAG mode.

Hence this patchset, where support for placement of LAG is added to mlxsw.

There are FW versions out there that do not support SW LAG mode, and on
Spectrum-1 in particular, there is no plan to support it at all. mlxsw will
therefore have to support both modes of operation.

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

The feature is therefore expressed in terms of "does the driver prefer SW
LAG mode?", and "what LAG mode the PCI module managed to configure the FW
with". This is unlike current flood mode configuration, where the driver
can give a strict value, and that's what gets configured. But it gives a
chance to the driver to determine whether LAG mode should be enabled at
all.

The "does the driver prefer SW LAG mode?" bit is expressed as a boolean
lag_mode_prefer_sw. The reason for this is largely another feature that
will be introduced in a follow-up patchset: support for CFF flood mode. The
driver currently requires that the FW be configured with what is called
controlled flood mode. But on capable systems, CFF would be preferred. So
there are two values in flight: the preferred flood mode, and the fallback.
This could be expressed with an array of flood modes ordered by preference,
but that looks like an overkill in comparison. This flag/value model is
then reused for LAG mode as well, except the fallback value is absent and
implied to be FW, because there are no other values to choose from.

The patchset progresses as follows:

- Patches #1 to #5 adjust reg.h and cmd.h with new register fields,
  constants and remarks.

- Patches #6 and #7 add the ability to request SW LAG mode and to query the
  LAG mode that was actually negotiated. This is where the abovementioned
  lag_mode_prefer_sw flag is added.

- Patches #7 to #9 generalize PGT allocations to make it possible to
  allocate the LAG table, which is done in patch #10.

- In patch #11, toggle lag_mode_prefer_sw on Spectrum-2 and above, which
  makes the newly-added code live.

Petr Machata (11):
  mlxsw: reg: Drop SGCR.llb
  mlxsw: reg: Add SGCR.lag_lookup_pgt_base
  mlxsw: cmd: Fix omissions in CONFIG_PROFILE field names in comments
  mlxsw: cmd: Add CONFIG_PROFILE.{set_, }lag_mode
  mlxsw: cmd: Add QUERY_FW.lag_mode_support
  mlxsw: core, pci: Add plumbing related to LAG mode
  mlxsw: pci: Permit toggling LAG mode
  mlxsw: spectrum_fid: Allocate PGT for the whole FID family in one go
  mlxsw: spectrum_pgt: Generalize PGT allocation
  mlxsw: spectrum: Allocate LAG table when in SW LAG mode
  mlxsw: spectrum: Set SW LAG mode on Spectrum>1

 drivers/net/ethernet/mellanox/mlxsw/cmd.h     | 43 +++++++--
 drivers/net/ethernet/mellanox/mlxsw/core.c    |  7 ++
 drivers/net/ethernet/mellanox/mlxsw/core.h    |  4 +
 drivers/net/ethernet/mellanox/mlxsw/pci.c     | 28 +++++-
 drivers/net/ethernet/mellanox/mlxsw/reg.h     | 14 +--
 .../net/ethernet/mellanox/mlxsw/spectrum.c    | 95 ++++++++++++++++---
 .../net/ethernet/mellanox/mlxsw/spectrum.h    |  3 +-
 .../ethernet/mellanox/mlxsw/spectrum_fid.c    | 69 +++++++-------
 .../ethernet/mellanox/mlxsw/spectrum_pgt.c    | 20 +---
 9 files changed, 202 insertions(+), 81 deletions(-)

Comments

patchwork-bot+netdevbpf@kernel.org Oct. 20, 2023, 10:50 a.m. UTC | #1
Hello:

This series was applied to netdev/net-next.git (main)
by David S. Miller <davem@davemloft.net>:

On Thu, 19 Oct 2023 12:27:09 +0200 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.
> 
> Within the PGT is placed a LAG table. That is a contiguous block of PGT
> memory where each entry describes which ports are members of the
> corresponding LAG port.
> 
> [...]

Here is the summary with links:
  - [net-next,01/11] mlxsw: reg: Drop SGCR.llb
    https://git.kernel.org/netdev/net-next/c/66eaaa85418b
  - [net-next,02/11] mlxsw: reg: Add SGCR.lag_lookup_pgt_base
    https://git.kernel.org/netdev/net-next/c/cf0a86e8ce60
  - [net-next,03/11] mlxsw: cmd: Fix omissions in CONFIG_PROFILE field names in comments
    https://git.kernel.org/netdev/net-next/c/be9ed47d3fab
  - [net-next,04/11] mlxsw: cmd: Add CONFIG_PROFILE.{set_, }lag_mode
    https://git.kernel.org/netdev/net-next/c/eb26a5923277
  - [net-next,05/11] mlxsw: cmd: Add QUERY_FW.lag_mode_support
    https://git.kernel.org/netdev/net-next/c/8eabd10cdce4
  - [net-next,06/11] mlxsw: core, pci: Add plumbing related to LAG mode
    https://git.kernel.org/netdev/net-next/c/b2e9b1fe8c2e
  - [net-next,07/11] mlxsw: pci: Permit toggling LAG mode
    https://git.kernel.org/netdev/net-next/c/daee7aaba849
  - [net-next,08/11] mlxsw: spectrum_fid: Allocate PGT for the whole FID family in one go
    https://git.kernel.org/netdev/net-next/c/f5e293f9939e
  - [net-next,09/11] mlxsw: spectrum_pgt: Generalize PGT allocation
    https://git.kernel.org/netdev/net-next/c/8c893abd64ae
  - [net-next,10/11] mlxsw: spectrum: Allocate LAG table when in SW LAG mode
    https://git.kernel.org/netdev/net-next/c/c678972580ae
  - [net-next,11/11] mlxsw: spectrum: Set SW LAG mode on Spectrum>1
    https://git.kernel.org/netdev/net-next/c/b46c1f3f5e07

You are awesome, thank you!