Commit 64771e31 authored by Ido Schimmel's avatar Ido Schimmel Committed by David S. Miller

mlxsw: spectrum: Enable FDB records for VLAN devices on top of LAG

When adding or removing FDB records of VLAN devices on top of LAG we
should set the lag_vid parameter to the VLAN ID of the VLAN device. It
is reserved otherwise.
Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent afd7f979
...@@ -588,8 +588,8 @@ static int mlxsw_sp_port_fdb_uc_op(struct mlxsw_sp_port *mlxsw_sp_port, ...@@ -588,8 +588,8 @@ static int mlxsw_sp_port_fdb_uc_op(struct mlxsw_sp_port *mlxsw_sp_port,
} }
static int mlxsw_sp_port_fdb_uc_lag_op(struct mlxsw_sp *mlxsw_sp, u16 lag_id, static int mlxsw_sp_port_fdb_uc_lag_op(struct mlxsw_sp *mlxsw_sp, u16 lag_id,
const char *mac, u16 fid, bool adding, const char *mac, u16 fid, u16 lag_vid,
bool dynamic) bool adding, bool dynamic)
{ {
char *sfd_pl; char *sfd_pl;
int err; int err;
...@@ -600,8 +600,8 @@ static int mlxsw_sp_port_fdb_uc_lag_op(struct mlxsw_sp *mlxsw_sp, u16 lag_id, ...@@ -600,8 +600,8 @@ static int mlxsw_sp_port_fdb_uc_lag_op(struct mlxsw_sp *mlxsw_sp, u16 lag_id,
mlxsw_reg_sfd_pack(sfd_pl, mlxsw_sp_sfd_op(adding), 0); mlxsw_reg_sfd_pack(sfd_pl, mlxsw_sp_sfd_op(adding), 0);
mlxsw_reg_sfd_uc_lag_pack(sfd_pl, 0, mlxsw_sp_sfd_rec_policy(dynamic), mlxsw_reg_sfd_uc_lag_pack(sfd_pl, 0, mlxsw_sp_sfd_rec_policy(dynamic),
mac, fid, MLXSW_REG_SFD_REC_ACTION_NOP, 0, mac, fid, MLXSW_REG_SFD_REC_ACTION_NOP,
lag_id); lag_vid, lag_id);
err = mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(sfd), sfd_pl); err = mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(sfd), sfd_pl);
kfree(sfd_pl); kfree(sfd_pl);
...@@ -614,6 +614,7 @@ mlxsw_sp_port_fdb_static_add(struct mlxsw_sp_port *mlxsw_sp_port, ...@@ -614,6 +614,7 @@ mlxsw_sp_port_fdb_static_add(struct mlxsw_sp_port *mlxsw_sp_port,
struct switchdev_trans *trans) struct switchdev_trans *trans)
{ {
u16 fid = fdb->vid; u16 fid = fdb->vid;
u16 lag_vid = 0;
if (switchdev_trans_ph_prepare(trans)) if (switchdev_trans_ph_prepare(trans))
return 0; return 0;
...@@ -622,6 +623,7 @@ mlxsw_sp_port_fdb_static_add(struct mlxsw_sp_port *mlxsw_sp_port, ...@@ -622,6 +623,7 @@ mlxsw_sp_port_fdb_static_add(struct mlxsw_sp_port *mlxsw_sp_port,
u16 vfid = mlxsw_sp_vport_vfid_get(mlxsw_sp_port); u16 vfid = mlxsw_sp_vport_vfid_get(mlxsw_sp_port);
fid = mlxsw_sp_vfid_to_fid(vfid); fid = mlxsw_sp_vfid_to_fid(vfid);
lag_vid = mlxsw_sp_vport_vid_get(mlxsw_sp_port);
} }
if (!fid) if (!fid)
...@@ -633,7 +635,8 @@ mlxsw_sp_port_fdb_static_add(struct mlxsw_sp_port *mlxsw_sp_port, ...@@ -633,7 +635,8 @@ mlxsw_sp_port_fdb_static_add(struct mlxsw_sp_port *mlxsw_sp_port,
else else
return mlxsw_sp_port_fdb_uc_lag_op(mlxsw_sp_port->mlxsw_sp, return mlxsw_sp_port_fdb_uc_lag_op(mlxsw_sp_port->mlxsw_sp,
mlxsw_sp_port->lag_id, mlxsw_sp_port->lag_id,
fdb->addr, fid, true, false); fdb->addr, fid, lag_vid,
true, false);
} }
static int mlxsw_sp_port_obj_add(struct net_device *dev, static int mlxsw_sp_port_obj_add(struct net_device *dev,
...@@ -756,11 +759,13 @@ mlxsw_sp_port_fdb_static_del(struct mlxsw_sp_port *mlxsw_sp_port, ...@@ -756,11 +759,13 @@ mlxsw_sp_port_fdb_static_del(struct mlxsw_sp_port *mlxsw_sp_port,
const struct switchdev_obj_port_fdb *fdb) const struct switchdev_obj_port_fdb *fdb)
{ {
u16 fid = fdb->vid; u16 fid = fdb->vid;
u16 lag_vid = 0;
if (mlxsw_sp_port_is_vport(mlxsw_sp_port)) { if (mlxsw_sp_port_is_vport(mlxsw_sp_port)) {
u16 vfid = mlxsw_sp_vport_vfid_get(mlxsw_sp_port); u16 vfid = mlxsw_sp_vport_vfid_get(mlxsw_sp_port);
fid = mlxsw_sp_vfid_to_fid(vfid); fid = mlxsw_sp_vfid_to_fid(vfid);
lag_vid = mlxsw_sp_vport_vid_get(mlxsw_sp_port);
} }
if (!mlxsw_sp_port->lagged) if (!mlxsw_sp_port->lagged)
...@@ -770,7 +775,7 @@ mlxsw_sp_port_fdb_static_del(struct mlxsw_sp_port *mlxsw_sp_port, ...@@ -770,7 +775,7 @@ mlxsw_sp_port_fdb_static_del(struct mlxsw_sp_port *mlxsw_sp_port,
else else
return mlxsw_sp_port_fdb_uc_lag_op(mlxsw_sp_port->mlxsw_sp, return mlxsw_sp_port_fdb_uc_lag_op(mlxsw_sp_port->mlxsw_sp,
mlxsw_sp_port->lag_id, mlxsw_sp_port->lag_id,
fdb->addr, fid, fdb->addr, fid, lag_vid,
false, false); false, false);
} }
...@@ -1039,6 +1044,7 @@ static void mlxsw_sp_fdb_notify_mac_lag_process(struct mlxsw_sp *mlxsw_sp, ...@@ -1039,6 +1044,7 @@ static void mlxsw_sp_fdb_notify_mac_lag_process(struct mlxsw_sp *mlxsw_sp,
{ {
struct mlxsw_sp_port *mlxsw_sp_port; struct mlxsw_sp_port *mlxsw_sp_port;
char mac[ETH_ALEN]; char mac[ETH_ALEN];
u16 lag_vid = 0;
u16 lag_id; u16 lag_id;
u16 vid, fid; u16 vid, fid;
int err; int err;
...@@ -1062,13 +1068,14 @@ static void mlxsw_sp_fdb_notify_mac_lag_process(struct mlxsw_sp *mlxsw_sp, ...@@ -1062,13 +1068,14 @@ static void mlxsw_sp_fdb_notify_mac_lag_process(struct mlxsw_sp *mlxsw_sp,
} }
vid = mlxsw_sp_vport_vid_get(mlxsw_sp_vport); vid = mlxsw_sp_vport_vid_get(mlxsw_sp_vport);
lag_vid = vid;
/* Override the physical port with the vPort. */ /* Override the physical port with the vPort. */
mlxsw_sp_port = mlxsw_sp_vport; mlxsw_sp_port = mlxsw_sp_vport;
} else { } else {
vid = fid; vid = fid;
} }
err = mlxsw_sp_port_fdb_uc_lag_op(mlxsw_sp, lag_id, mac, fid, err = mlxsw_sp_port_fdb_uc_lag_op(mlxsw_sp, lag_id, mac, fid, lag_vid,
adding && mlxsw_sp_port->learning, adding && mlxsw_sp_port->learning,
true); true);
if (err) { if (err) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment