All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ido Schimmel <idosch@nvidia.com>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com,
	edumazet@google.com, petrm@nvidia.com, amcohen@nvidia.com,
	mlxsw@nvidia.com, Ido Schimmel <idosch@nvidia.com>
Subject: [PATCH net-next 00/13] mlxsw: Unified bridge conversion - part 4/6
Date: Mon, 27 Jun 2022 10:06:08 +0300	[thread overview]
Message-ID: <20220627070621.648499-1-idosch@nvidia.com> (raw)

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

-- 
2.36.1


             reply	other threads:[~2022-06-27  7:07 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-27  7:06 Ido Schimmel [this message]
2022-06-27  7:06 ` [PATCH net-next 01/13] mlxsw: spectrum: Add a temporary variable to indicate bridge model Ido Schimmel
2022-06-27  7:06 ` [PATCH net-next 02/13] mlxsw: spectrum_fid: Configure flooding table type for rFID Ido Schimmel
2022-06-27  7:06 ` [PATCH net-next 03/13] mlxsw: Prepare 'bridge_type' field for SFMR usage Ido Schimmel
2022-06-27  7:06 ` [PATCH net-next 04/13] mlxsw: spectrum_fid: Store 'bridge_type' as part of FID family Ido Schimmel
2022-06-27  7:06 ` [PATCH net-next 05/13] mlxsw: Set flood bridge type for FIDs Ido Schimmel
2022-06-27  7:06 ` [PATCH net-next 06/13] mlxsw: spectrum_fid: Configure egress VID classification for multicast Ido Schimmel
2022-06-27  7:06 ` [PATCH net-next 07/13] mlxsw: Add an initial PGT table support Ido Schimmel
2022-06-27  7:06 ` [PATCH net-next 08/13] mlxsw: Add an indication of SMPE index validity for PGT table Ido Schimmel
2022-06-27  7:06 ` [PATCH net-next 09/13] mlxsw: Add a dedicated structure for bitmap of ports Ido Schimmel
2022-06-27  7:06 ` [PATCH net-next 10/13] mlxsw: Extend PGT APIs to support maintaining list of ports per entry Ido Schimmel
2022-06-27  7:06 ` [PATCH net-next 11/13] mlxsw: spectrum: Initialize PGT table Ido Schimmel
2022-06-27  7:06 ` [PATCH net-next 12/13] mlxsw: spectrum_fid: Set 'mid_base' as part of flood tables initialization Ido Schimmel
2022-06-27  7:06 ` [PATCH net-next 13/13] mlxsw: spectrum_fid: Configure flooding entries using PGT APIs Ido Schimmel
2022-06-28 13:00 ` [PATCH net-next 00/13] mlxsw: Unified bridge conversion - part 4/6 patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220627070621.648499-1-idosch@nvidia.com \
    --to=idosch@nvidia.com \
    --cc=amcohen@nvidia.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=mlxsw@nvidia.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=petrm@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.