Commit d4324e31 authored by Amit Cohen's avatar Amit Cohen Committed by David S. Miller

mlxsw: Add new FID families for unified bridge model

In the unified bridge model, mlxsw will no longer emulate 802.1Q FIDs
using 802.1D FIDs. The new FID table will look as follows:

     +---------------+
     | 802.1q FIDs   | 4K entries
     | [1..4094]     |
     +---------------+
     | 802.1d FIDs   | 1K entries
     | [4095..5118]  |
     +---------------+
     | Dummy FIDs    | 1 entry
     | [5119..5119]  |
     +---------------+
     | rFIDs         | 11K entries
     | [5120..16383] |
     +---------------+

In order to make the change easier to review, four new temporary FID
families will be added (e.g., MLXSW_SP_FID_TYPE_8021D_UB) and will not
be registered with the FID core until mlxsw is flipped to use the unified
bridge model.

Add .1d, rfid and dummy FID families for unified bridge, the next patch
will add .1q family separately as it requires more changes.

The following changes are required:
1. Add 'smpe_index_valid' field to 'struct mlxsw_sp_fid_family' and set
   SFMR.smpe accordingly. SMPE index is reserved for rFIDs, as their
   flooding is handled by firmware, and always reserved in Spectrum-1,
   as it is configured as part of PGT table.

2. Add 'ubridge' field to 'struct mlxsw_sp_fid_family'. This field will
   be removed later, use it in mlxsw_sp_fid_family_{register,unregister}()
   to skip the registration / unregistration of the new families when the
   legacy model is used.

3. Indexes - the start and end indexes of each FID family will need to be
   changed according to the above diagram.

4. Add flood tables for unified bridge model, use 'fid_offset' as table
   type, as in the new model the access to flood tables will be using
   'fid_offset' calculation.

5. FID family operation changes:
   a. rFID supposed to be created using SFMR, as it is not created by
      firmware using unified bridge model.
   b. port_vid_map() should perform SVFA for rFID, as the mapping is not
      created by firmware using unified bridge model.
   c. flood_index() is not aligned to the new model, as this function will
      be removed later.
Signed-off-by: default avatarAmit Cohen <amcohen@nvidia.com>
Reviewed-by: default avatarPetr Machata <petrm@nvidia.com>
Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 662761d8
...@@ -1969,7 +1969,8 @@ MLXSW_ITEM32(reg, sfmr, smpe, 0x28, 0, 16); ...@@ -1969,7 +1969,8 @@ MLXSW_ITEM32(reg, sfmr, smpe, 0x28, 0, 16);
static inline void mlxsw_reg_sfmr_pack(char *payload, static inline void mlxsw_reg_sfmr_pack(char *payload,
enum mlxsw_reg_sfmr_op op, u16 fid, enum mlxsw_reg_sfmr_op op, u16 fid,
u16 fid_offset, bool flood_rsp, u16 fid_offset, bool flood_rsp,
enum mlxsw_reg_bridge_type bridge_type) enum mlxsw_reg_bridge_type bridge_type,
bool smpe_valid, u16 smpe)
{ {
MLXSW_REG_ZERO(sfmr, payload); MLXSW_REG_ZERO(sfmr, payload);
mlxsw_reg_sfmr_op_set(payload, op); mlxsw_reg_sfmr_op_set(payload, op);
...@@ -1979,6 +1980,8 @@ static inline void mlxsw_reg_sfmr_pack(char *payload, ...@@ -1979,6 +1980,8 @@ static inline void mlxsw_reg_sfmr_pack(char *payload,
mlxsw_reg_sfmr_vv_set(payload, false); mlxsw_reg_sfmr_vv_set(payload, false);
mlxsw_reg_sfmr_flood_rsp_set(payload, flood_rsp); mlxsw_reg_sfmr_flood_rsp_set(payload, flood_rsp);
mlxsw_reg_sfmr_flood_bridge_type_set(payload, bridge_type); mlxsw_reg_sfmr_flood_bridge_type_set(payload, bridge_type);
mlxsw_reg_sfmr_smpe_valid_set(payload, smpe_valid);
mlxsw_reg_sfmr_smpe_set(payload, smpe);
} }
/* SPVMLR - Switch Port VLAN MAC Learning Register /* SPVMLR - Switch Port VLAN MAC Learning Register
......
...@@ -106,6 +106,10 @@ enum mlxsw_sp_fid_type { ...@@ -106,6 +106,10 @@ enum mlxsw_sp_fid_type {
MLXSW_SP_FID_TYPE_8021D, MLXSW_SP_FID_TYPE_8021D,
MLXSW_SP_FID_TYPE_RFID, MLXSW_SP_FID_TYPE_RFID,
MLXSW_SP_FID_TYPE_DUMMY, MLXSW_SP_FID_TYPE_DUMMY,
MLXSW_SP_FID_TYPE_8021Q_UB,
MLXSW_SP_FID_TYPE_8021D_UB,
MLXSW_SP_FID_TYPE_RFID_UB,
MLXSW_SP_FID_TYPE_DUMMY_UB,
MLXSW_SP_FID_TYPE_MAX, MLXSW_SP_FID_TYPE_MAX,
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment