Skip to content

Commit 3f47f86

Browse files
idoschdavem330
authored andcommitted
mlxsw: spectrum: Compare local ports instead of pointers
When dumping the FDB we can't compare the actual pointers of the ports structs, as it's possible the struct represents a vPort instead of the underlying physical port. Solve this by comparing the local port number instead, as it's shared between the physical ports and all the vPorts on top of him. Fixes: 54a7320 ("mlxsw: spectrum: Adjust switchdev ops for VLAN devices") Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 304f515 commit 3f47f86

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1052,6 +1052,7 @@ static int mlxsw_sp_port_fdb_dump(struct mlxsw_sp_port *mlxsw_sp_port,
10521052
struct net_device *orig_dev)
10531053
{
10541054
struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp;
1055+
struct mlxsw_sp_port *tmp;
10551056
u16 vport_fid = 0;
10561057
char *sfd_pl;
10571058
char mac[ETH_ALEN];
@@ -1113,8 +1114,9 @@ static int mlxsw_sp_port_fdb_dump(struct mlxsw_sp_port *mlxsw_sp_port,
11131114
case MLXSW_REG_SFD_REC_TYPE_UNICAST_LAG:
11141115
mlxsw_reg_sfd_uc_lag_unpack(sfd_pl, i,
11151116
mac, &fid, &lag_id);
1116-
if (mlxsw_sp_port ==
1117-
mlxsw_sp_lag_rep_port(mlxsw_sp, lag_id)) {
1117+
tmp = mlxsw_sp_lag_rep_port(mlxsw_sp, lag_id);
1118+
if (tmp && tmp->local_port ==
1119+
mlxsw_sp_port->local_port) {
11181120
/* LAG records can only point to LAG
11191121
* devices or VLAN devices on top.
11201122
*/

0 commit comments

Comments
 (0)