Skip to content

Commit dd8c77d

Browse files
Amit CohenPaolo Abeni
authored andcommitted
mlxsw: spectrum_fid: Store 'bridge_type' as part of FID family
Currently, 'bridge_type' is an attribute of 'struct mlxsw_sp_flood_table', which is defined per FID family. Instead, it can be an attribute of 'struct mlxsw_sp_fid_family' as all flood tables in the same family are of the same type. This change will ease the configuration of 'SFMR.flood_bridge_type' which will be added in the next patch. Signed-off-by: Amit Cohen <[email protected]> Reviewed-by: Petr Machata <[email protected]> Signed-off-by: Ido Schimmel <[email protected]> Signed-off-by: Paolo Abeni <[email protected]>
1 parent fad8e1b commit dd8c77d

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ static const struct rhashtable_params mlxsw_sp_fid_vni_ht_params = {
7171

7272
struct mlxsw_sp_flood_table {
7373
enum mlxsw_sp_flood_type packet_type;
74-
enum mlxsw_reg_bridge_type bridge_type;
7574
enum mlxsw_flood_table_type table_type;
7675
int table_index;
7776
};
@@ -110,6 +109,7 @@ struct mlxsw_sp_fid_family {
110109
const struct mlxsw_sp_fid_ops *ops;
111110
struct mlxsw_sp *mlxsw_sp;
112111
bool flood_rsp;
112+
enum mlxsw_reg_bridge_type bridge_type;
113113
};
114114

115115
static const int mlxsw_sp_sfgc_uc_packet_types[MLXSW_REG_SFGC_TYPE_MAX] = {
@@ -709,19 +709,16 @@ static const struct mlxsw_sp_fid_ops mlxsw_sp_fid_8021d_ops = {
709709
static const struct mlxsw_sp_flood_table mlxsw_sp_fid_8021d_flood_tables[] = {
710710
{
711711
.packet_type = MLXSW_SP_FLOOD_TYPE_UC,
712-
.bridge_type = MLXSW_REG_BRIDGE_TYPE_1,
713712
.table_type = MLXSW_REG_SFGC_TABLE_TYPE_FID,
714713
.table_index = 0,
715714
},
716715
{
717716
.packet_type = MLXSW_SP_FLOOD_TYPE_MC,
718-
.bridge_type = MLXSW_REG_BRIDGE_TYPE_1,
719717
.table_type = MLXSW_REG_SFGC_TABLE_TYPE_FID,
720718
.table_index = 1,
721719
},
722720
{
723721
.packet_type = MLXSW_SP_FLOOD_TYPE_BC,
724-
.bridge_type = MLXSW_REG_BRIDGE_TYPE_1,
725722
.table_type = MLXSW_REG_SFGC_TABLE_TYPE_FID,
726723
.table_index = 2,
727724
},
@@ -737,6 +734,7 @@ static const struct mlxsw_sp_fid_family mlxsw_sp_fid_8021d_family = {
737734
.nr_flood_tables = ARRAY_SIZE(mlxsw_sp_fid_8021d_flood_tables),
738735
.rif_type = MLXSW_SP_RIF_TYPE_FID,
739736
.ops = &mlxsw_sp_fid_8021d_ops,
737+
.bridge_type = MLXSW_REG_BRIDGE_TYPE_1,
740738
};
741739

742740
static bool
@@ -785,6 +783,7 @@ static const struct mlxsw_sp_fid_family mlxsw_sp_fid_8021q_emu_family = {
785783
.nr_flood_tables = ARRAY_SIZE(mlxsw_sp_fid_8021d_flood_tables),
786784
.rif_type = MLXSW_SP_RIF_TYPE_VLAN_EMU,
787785
.ops = &mlxsw_sp_fid_8021q_emu_ops,
786+
.bridge_type = MLXSW_REG_BRIDGE_TYPE_1,
788787
};
789788

790789
static void mlxsw_sp_fid_rfid_setup(struct mlxsw_sp_fid *fid, const void *arg)
@@ -1132,7 +1131,7 @@ mlxsw_sp_fid_flood_table_init(struct mlxsw_sp_fid_family *fid_family,
11321131

11331132
if (!sfgc_packet_types[i])
11341133
continue;
1135-
mlxsw_reg_sfgc_pack(sfgc_pl, i, flood_table->bridge_type,
1134+
mlxsw_reg_sfgc_pack(sfgc_pl, i, fid_family->bridge_type,
11361135
flood_table->table_type,
11371136
flood_table->table_index);
11381137
err = mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(sfgc), sfgc_pl);

0 commit comments

Comments
 (0)