mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 02:21:52 +09:00
mlxsw: spectrum_switchdev: Do not treat static FDB entries as sticky
[ Upstream commit64254a2054] 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:56ade8fe3f("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> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
4799417bb6
commit
e26772f056
@@ -1209,7 +1209,7 @@ mlxsw_sp_bridge_port_fdb_flush(struct mlxsw_sp *mlxsw_sp,
|
||||
static enum mlxsw_reg_sfd_rec_policy mlxsw_sp_sfd_rec_policy(bool dynamic)
|
||||
{
|
||||
return dynamic ? MLXSW_REG_SFD_REC_POLICY_DYNAMIC_ENTRY_INGRESS :
|
||||
MLXSW_REG_SFD_REC_POLICY_STATIC_ENTRY;
|
||||
MLXSW_REG_SFD_REC_POLICY_DYNAMIC_ENTRY_MLAG;
|
||||
}
|
||||
|
||||
static enum mlxsw_reg_sfd_op mlxsw_sp_sfd_op(bool adding)
|
||||
@@ -1221,7 +1221,7 @@ static enum mlxsw_reg_sfd_op mlxsw_sp_sfd_op(bool adding)
|
||||
static int __mlxsw_sp_port_fdb_uc_op(struct mlxsw_sp *mlxsw_sp, u8 local_port,
|
||||
const char *mac, u16 fid, bool adding,
|
||||
enum mlxsw_reg_sfd_rec_action action,
|
||||
bool dynamic)
|
||||
enum mlxsw_reg_sfd_rec_policy policy)
|
||||
{
|
||||
char *sfd_pl;
|
||||
u8 num_rec;
|
||||
@@ -1232,8 +1232,7 @@ static int __mlxsw_sp_port_fdb_uc_op(struct mlxsw_sp *mlxsw_sp, u8 local_port,
|
||||
return -ENOMEM;
|
||||
|
||||
mlxsw_reg_sfd_pack(sfd_pl, mlxsw_sp_sfd_op(adding), 0);
|
||||
mlxsw_reg_sfd_uc_pack(sfd_pl, 0, mlxsw_sp_sfd_rec_policy(dynamic),
|
||||
mac, fid, action, local_port);
|
||||
mlxsw_reg_sfd_uc_pack(sfd_pl, 0, policy, mac, fid, action, local_port);
|
||||
num_rec = mlxsw_reg_sfd_num_rec_get(sfd_pl);
|
||||
err = mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(sfd), sfd_pl);
|
||||
if (err)
|
||||
@@ -1252,7 +1251,8 @@ static int mlxsw_sp_port_fdb_uc_op(struct mlxsw_sp *mlxsw_sp, u8 local_port,
|
||||
bool dynamic)
|
||||
{
|
||||
return __mlxsw_sp_port_fdb_uc_op(mlxsw_sp, local_port, mac, fid, adding,
|
||||
MLXSW_REG_SFD_REC_ACTION_NOP, dynamic);
|
||||
MLXSW_REG_SFD_REC_ACTION_NOP,
|
||||
mlxsw_sp_sfd_rec_policy(dynamic));
|
||||
}
|
||||
|
||||
int mlxsw_sp_rif_fdb_op(struct mlxsw_sp *mlxsw_sp, const char *mac, u16 fid,
|
||||
@@ -1260,7 +1260,7 @@ int mlxsw_sp_rif_fdb_op(struct mlxsw_sp *mlxsw_sp, const char *mac, u16 fid,
|
||||
{
|
||||
return __mlxsw_sp_port_fdb_uc_op(mlxsw_sp, 0, mac, fid, adding,
|
||||
MLXSW_REG_SFD_REC_ACTION_FORWARD_IP_ROUTER,
|
||||
false);
|
||||
MLXSW_REG_SFD_REC_POLICY_STATIC_ENTRY);
|
||||
}
|
||||
|
||||
static int mlxsw_sp_port_fdb_uc_lag_op(struct mlxsw_sp *mlxsw_sp, u16 lag_id,
|
||||
|
||||
Reference in New Issue
Block a user