Skip to content

Commit c2e7490

Browse files
idoschdavem330
authored andcommitted
mlxsw: spectrum: Flip driver to use emulated 802.1Q FIDs
Replace 802.1Q FIDs and VLAN RIFs with their emulated counterparts. The emulated 802.1Q FIDs are actually 802.1D FIDs and thus use the same flood tables, of per-FID type. Therefore, add 4K-1 entries to the per-FID flood tables for the new FIDs and get rid of the FID-offset flood tables that were used by the old 802.1Q FIDs. Signed-off-by: Ido Schimmel <[email protected]> Reviewed-by: Petr Machata <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent ba6da02 commit c2e7490

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

drivers/net/ethernet/mellanox/mlxsw/spectrum.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4111,16 +4111,20 @@ static void mlxsw_sp_fini(struct mlxsw_core *mlxsw_core)
41114111
mlxsw_sp_kvdl_fini(mlxsw_sp);
41124112
}
41134113

4114+
/* Per-FID flood tables are used for both "true" 802.1D FIDs and emulated
4115+
* 802.1Q FIDs
4116+
*/
4117+
#define MLXSW_SP_FID_FLOOD_TABLE_SIZE (MLXSW_SP_FID_8021D_MAX + \
4118+
VLAN_VID_MASK - 1)
4119+
41144120
static const struct mlxsw_config_profile mlxsw_sp1_config_profile = {
41154121
.used_max_mid = 1,
41164122
.max_mid = MLXSW_SP_MID_MAX,
41174123
.used_flood_tables = 1,
41184124
.used_flood_mode = 1,
41194125
.flood_mode = 3,
4120-
.max_fid_offset_flood_tables = 3,
4121-
.fid_offset_flood_table_size = VLAN_N_VID - 1,
41224126
.max_fid_flood_tables = 3,
4123-
.fid_flood_table_size = MLXSW_SP_FID_8021D_MAX,
4127+
.fid_flood_table_size = MLXSW_SP_FID_FLOOD_TABLE_SIZE,
41244128
.used_max_ib_mc = 1,
41254129
.max_ib_mc = 0,
41264130
.used_max_pkey = 1,
@@ -4143,10 +4147,8 @@ static const struct mlxsw_config_profile mlxsw_sp2_config_profile = {
41434147
.used_flood_tables = 1,
41444148
.used_flood_mode = 1,
41454149
.flood_mode = 3,
4146-
.max_fid_offset_flood_tables = 3,
4147-
.fid_offset_flood_table_size = VLAN_N_VID - 1,
41484150
.max_fid_flood_tables = 3,
4149-
.fid_flood_table_size = MLXSW_SP_FID_8021D_MAX,
4151+
.fid_flood_table_size = MLXSW_SP_FID_FLOOD_TABLE_SIZE,
41504152
.used_max_ib_mc = 1,
41514153
.max_ib_mc = 0,
41524154
.used_max_pkey = 1,

drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -961,7 +961,7 @@ static const struct mlxsw_sp_fid_family mlxsw_sp_fid_dummy_family = {
961961
};
962962

963963
static const struct mlxsw_sp_fid_family *mlxsw_sp_fid_family_arr[] = {
964-
[MLXSW_SP_FID_TYPE_8021Q] = &mlxsw_sp_fid_8021q_family,
964+
[MLXSW_SP_FID_TYPE_8021Q] = &mlxsw_sp_fid_8021q_emu_family,
965965
[MLXSW_SP_FID_TYPE_8021D] = &mlxsw_sp_fid_8021d_family,
966966
[MLXSW_SP_FID_TYPE_RFID] = &mlxsw_sp_fid_rfid_family,
967967
[MLXSW_SP_FID_TYPE_DUMMY] = &mlxsw_sp_fid_dummy_family,

drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7373,7 +7373,7 @@ static const struct mlxsw_sp_rif_ops mlxsw_sp_rif_ipip_lb_ops = {
73737373

73747374
static const struct mlxsw_sp_rif_ops *mlxsw_sp_rif_ops_arr[] = {
73757375
[MLXSW_SP_RIF_TYPE_SUBPORT] = &mlxsw_sp_rif_subport_ops,
7376-
[MLXSW_SP_RIF_TYPE_VLAN] = &mlxsw_sp_rif_vlan_ops,
7376+
[MLXSW_SP_RIF_TYPE_VLAN] = &mlxsw_sp_rif_vlan_emu_ops,
73777377
[MLXSW_SP_RIF_TYPE_FID] = &mlxsw_sp_rif_fid_ops,
73787378
[MLXSW_SP_RIF_TYPE_IPIP_LB] = &mlxsw_sp_rif_ipip_lb_ops,
73797379
};

0 commit comments

Comments
 (0)