Skip to content

Commit 93303ff

Browse files
Amit CohenPaolo Abeni
authored andcommitted
mlxsw: spectrum_fid: Configure flooding table type for rFID
Using unified bridge model, RITR register no longer configures the rFID used for sub-port RIFs. It needs to be created by software via SFMR. Such FIDs need to be created with a special flood indication using 'SFMR.flood_rsp=1'. It means that for such FIDs, router sub-port flooding table will be used, this table is configured by firmware. Set the above mentioned field as part of FID initialization and FID edition, so then when other fields will be updated in SFMR, this field will store the correct value and will not be overwritten. Add 'flood_rsp' variable to 'struct mlxsw_sp_fid_family', set it to true for rFID and to false for the rest. 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 d6d9026 commit 93303ff

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

drivers/net/ethernet/mellanox/mlxsw/reg.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1960,14 +1960,15 @@ MLXSW_ITEM32(reg, sfmr, smpe, 0x28, 0, 16);
19601960

19611961
static inline void mlxsw_reg_sfmr_pack(char *payload,
19621962
enum mlxsw_reg_sfmr_op op, u16 fid,
1963-
u16 fid_offset)
1963+
u16 fid_offset, bool flood_rsp)
19641964
{
19651965
MLXSW_REG_ZERO(sfmr, payload);
19661966
mlxsw_reg_sfmr_op_set(payload, op);
19671967
mlxsw_reg_sfmr_fid_set(payload, fid);
19681968
mlxsw_reg_sfmr_fid_offset_set(payload, fid_offset);
19691969
mlxsw_reg_sfmr_vtfp_set(payload, false);
19701970
mlxsw_reg_sfmr_vv_set(payload, false);
1971+
mlxsw_reg_sfmr_flood_rsp_set(payload, flood_rsp);
19711972
}
19721973

19731974
/* SPVMLR - Switch Port VLAN MAC Learning Register

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

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ struct mlxsw_sp_fid_family {
109109
enum mlxsw_sp_rif_type rif_type;
110110
const struct mlxsw_sp_fid_ops *ops;
111111
struct mlxsw_sp *mlxsw_sp;
112+
bool flood_rsp;
112113
};
113114

114115
static const int mlxsw_sp_sfgc_uc_packet_types[MLXSW_REG_SFGC_TYPE_MAX] = {
@@ -422,19 +423,27 @@ static int mlxsw_sp_fid_op(const struct mlxsw_sp_fid *fid, bool valid)
422423
{
423424
struct mlxsw_sp *mlxsw_sp = fid->fid_family->mlxsw_sp;
424425
char sfmr_pl[MLXSW_REG_SFMR_LEN];
426+
bool flood_rsp = false;
427+
428+
if (mlxsw_sp->ubridge)
429+
flood_rsp = fid->fid_family->flood_rsp;
425430

426431
mlxsw_reg_sfmr_pack(sfmr_pl, mlxsw_sp_sfmr_op(valid), fid->fid_index,
427-
fid->fid_offset);
432+
fid->fid_offset, flood_rsp);
428433
return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(sfmr), sfmr_pl);
429434
}
430435

431436
static int mlxsw_sp_fid_edit_op(const struct mlxsw_sp_fid *fid)
432437
{
433438
struct mlxsw_sp *mlxsw_sp = fid->fid_family->mlxsw_sp;
434439
char sfmr_pl[MLXSW_REG_SFMR_LEN];
440+
bool flood_rsp = false;
441+
442+
if (mlxsw_sp->ubridge)
443+
flood_rsp = fid->fid_family->flood_rsp;
435444

436445
mlxsw_reg_sfmr_pack(sfmr_pl, MLXSW_REG_SFMR_OP_CREATE_FID,
437-
fid->fid_index, fid->fid_offset);
446+
fid->fid_index, fid->fid_offset, flood_rsp);
438447
mlxsw_reg_sfmr_vv_set(sfmr_pl, fid->vni_valid);
439448
mlxsw_reg_sfmr_vni_set(sfmr_pl, be32_to_cpu(fid->vni));
440449
mlxsw_reg_sfmr_vtfp_set(sfmr_pl, fid->nve_flood_index_valid);
@@ -898,6 +907,7 @@ static const struct mlxsw_sp_fid_family mlxsw_sp_fid_rfid_family = {
898907
.end_index = MLXSW_SP_RFID_BASE + MLXSW_SP_RFID_MAX - 1,
899908
.rif_type = MLXSW_SP_RIF_TYPE_SUBPORT,
900909
.ops = &mlxsw_sp_fid_rfid_ops,
910+
.flood_rsp = true,
901911
};
902912

903913
static void mlxsw_sp_fid_dummy_setup(struct mlxsw_sp_fid *fid, const void *arg)

0 commit comments

Comments
 (0)