Skip to content

Commit 64254a2

Browse files
idoschdavem330
authored andcommitted
mlxsw: spectrum_switchdev: Do not treat static FDB entries as sticky
The driver currently treats static FDB entries as both static and sticky. This is incorrect and prevents such entries from being roamed to a different port via learning. Fix this by configuring static entries with ageing disabled and roaming enabled. In net-next we can add proper support for the newly introduced 'sticky' flag. Fixes: 56ade8f ("mlxsw: spectrum: Add initial support for Spectrum ASIC") Signed-off-by: Ido Schimmel <idosch@mellanox.com> Reported-by: Alexander Petrovskiy <alexpe@mellanox.com> Reviewed-by: Petr Machata <petrm@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 710ae72 commit 64254a2

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1233,7 +1233,7 @@ mlxsw_sp_bridge_port_fdb_flush(struct mlxsw_sp *mlxsw_sp,
12331233
static enum mlxsw_reg_sfd_rec_policy mlxsw_sp_sfd_rec_policy(bool dynamic)
12341234
{
12351235
return dynamic ? MLXSW_REG_SFD_REC_POLICY_DYNAMIC_ENTRY_INGRESS :
1236-
MLXSW_REG_SFD_REC_POLICY_STATIC_ENTRY;
1236+
MLXSW_REG_SFD_REC_POLICY_DYNAMIC_ENTRY_MLAG;
12371237
}
12381238

12391239
static enum mlxsw_reg_sfd_op mlxsw_sp_sfd_op(bool adding)
@@ -1290,7 +1290,7 @@ static int mlxsw_sp_port_fdb_tunnel_uc_op(struct mlxsw_sp *mlxsw_sp,
12901290
static int __mlxsw_sp_port_fdb_uc_op(struct mlxsw_sp *mlxsw_sp, u8 local_port,
12911291
const char *mac, u16 fid, bool adding,
12921292
enum mlxsw_reg_sfd_rec_action action,
1293-
bool dynamic)
1293+
enum mlxsw_reg_sfd_rec_policy policy)
12941294
{
12951295
char *sfd_pl;
12961296
u8 num_rec;
@@ -1301,8 +1301,7 @@ static int __mlxsw_sp_port_fdb_uc_op(struct mlxsw_sp *mlxsw_sp, u8 local_port,
13011301
return -ENOMEM;
13021302

13031303
mlxsw_reg_sfd_pack(sfd_pl, mlxsw_sp_sfd_op(adding), 0);
1304-
mlxsw_reg_sfd_uc_pack(sfd_pl, 0, mlxsw_sp_sfd_rec_policy(dynamic),
1305-
mac, fid, action, local_port);
1304+
mlxsw_reg_sfd_uc_pack(sfd_pl, 0, policy, mac, fid, action, local_port);
13061305
num_rec = mlxsw_reg_sfd_num_rec_get(sfd_pl);
13071306
err = mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(sfd), sfd_pl);
13081307
if (err)
@@ -1321,15 +1320,16 @@ static int mlxsw_sp_port_fdb_uc_op(struct mlxsw_sp *mlxsw_sp, u8 local_port,
13211320
bool dynamic)
13221321
{
13231322
return __mlxsw_sp_port_fdb_uc_op(mlxsw_sp, local_port, mac, fid, adding,
1324-
MLXSW_REG_SFD_REC_ACTION_NOP, dynamic);
1323+
MLXSW_REG_SFD_REC_ACTION_NOP,
1324+
mlxsw_sp_sfd_rec_policy(dynamic));
13251325
}
13261326

13271327
int mlxsw_sp_rif_fdb_op(struct mlxsw_sp *mlxsw_sp, const char *mac, u16 fid,
13281328
bool adding)
13291329
{
13301330
return __mlxsw_sp_port_fdb_uc_op(mlxsw_sp, 0, mac, fid, adding,
13311331
MLXSW_REG_SFD_REC_ACTION_FORWARD_IP_ROUTER,
1332-
false);
1332+
MLXSW_REG_SFD_REC_POLICY_STATIC_ENTRY);
13331333
}
13341334

13351335
static int mlxsw_sp_port_fdb_uc_lag_op(struct mlxsw_sp *mlxsw_sp, u16 lag_id,

0 commit comments

Comments
 (0)