Skip to content

Commit 1d07911

Browse files
pmachatakuba-moo
authored andcommitted
mlxsw: spectrum_fid: Move mlxsw_sp_fid_flood_table_init() up
Move the function to the point where it will need to be to be visible for the 802.1d ops. Signed-off-by: Petr Machata <petrm@nvidia.com> Reviewed-by: Amit Cohen <amcohen@nvidia.com> Reviewed-by: Ido Schimmel <idosch@nvidia.com> Link: https://lore.kernel.org/r/aef09e26b0c2dd077531e665d7135b300bdaf0a8.1701183892.git.petrm@nvidia.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 17eda11 commit 1d07911

File tree

1 file changed

+30
-30
lines changed

1 file changed

+30
-30
lines changed

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

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1077,6 +1077,36 @@ mlxsw_sp_fid_8021d_vid_to_fid_rif_update(const struct mlxsw_sp_fid *fid,
10771077
return 0;
10781078
}
10791079

1080+
static int
1081+
mlxsw_sp_fid_flood_table_init(struct mlxsw_sp_fid_family *fid_family,
1082+
const struct mlxsw_sp_flood_table *flood_table)
1083+
{
1084+
enum mlxsw_sp_flood_type packet_type = flood_table->packet_type;
1085+
struct mlxsw_sp *mlxsw_sp = fid_family->mlxsw_sp;
1086+
const int *sfgc_packet_types;
1087+
u16 mid_base;
1088+
int err, i;
1089+
1090+
mid_base = mlxsw_sp_fid_pgt_base_ctl(fid_family, flood_table);
1091+
1092+
sfgc_packet_types = mlxsw_sp_packet_type_sfgc_types[packet_type];
1093+
for (i = 0; i < MLXSW_REG_SFGC_TYPE_MAX; i++) {
1094+
char sfgc_pl[MLXSW_REG_SFGC_LEN];
1095+
1096+
if (!sfgc_packet_types[i])
1097+
continue;
1098+
1099+
mlxsw_reg_sfgc_pack(sfgc_pl, i, fid_family->bridge_type,
1100+
flood_table->table_type, 0, mid_base);
1101+
1102+
err = mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(sfgc), sfgc_pl);
1103+
if (err)
1104+
return err;
1105+
}
1106+
1107+
return 0;
1108+
}
1109+
10801110
static const struct mlxsw_sp_fid_ops mlxsw_sp_fid_8021d_ops_ctl = {
10811111
.setup = mlxsw_sp_fid_8021d_setup,
10821112
.configure = mlxsw_sp_fid_8021d_configure,
@@ -1675,36 +1705,6 @@ struct mlxsw_sp_fid *mlxsw_sp_fid_dummy_get(struct mlxsw_sp *mlxsw_sp)
16751705
return mlxsw_sp_fid_get(mlxsw_sp, MLXSW_SP_FID_TYPE_DUMMY, NULL);
16761706
}
16771707

1678-
static int
1679-
mlxsw_sp_fid_flood_table_init(struct mlxsw_sp_fid_family *fid_family,
1680-
const struct mlxsw_sp_flood_table *flood_table)
1681-
{
1682-
enum mlxsw_sp_flood_type packet_type = flood_table->packet_type;
1683-
struct mlxsw_sp *mlxsw_sp = fid_family->mlxsw_sp;
1684-
const int *sfgc_packet_types;
1685-
u16 mid_base;
1686-
int err, i;
1687-
1688-
mid_base = mlxsw_sp_fid_pgt_base_ctl(fid_family, flood_table);
1689-
1690-
sfgc_packet_types = mlxsw_sp_packet_type_sfgc_types[packet_type];
1691-
for (i = 0; i < MLXSW_REG_SFGC_TYPE_MAX; i++) {
1692-
char sfgc_pl[MLXSW_REG_SFGC_LEN];
1693-
1694-
if (!sfgc_packet_types[i])
1695-
continue;
1696-
1697-
mlxsw_reg_sfgc_pack(sfgc_pl, i, fid_family->bridge_type,
1698-
flood_table->table_type, 0, mid_base);
1699-
1700-
err = mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(sfgc), sfgc_pl);
1701-
if (err)
1702-
return err;
1703-
}
1704-
1705-
return 0;
1706-
}
1707-
17081708
static int
17091709
mlxsw_sp_fid_flood_tables_init(struct mlxsw_sp_fid_family *fid_family)
17101710
{

0 commit comments

Comments
 (0)