summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIdo Schimmel <idosch@mellanox.com>2016-01-27 15:20:25 +0100
committerDavid S. Miller <davem@davemloft.net>2016-01-28 15:55:32 -0800
commit3f47f867814cdb08cd43d4b82f95bfde4a9ae579 (patch)
tree0ae9a28c0252e48ee0df1ae7ed9f30462253bd41
parent304f51584f4591789539c0d37fc359bc129a4ff0 (diff)
downloadlinux-stable-3f47f867814cdb08cd43d4b82f95bfde4a9ae579.tar.gz
linux-stable-3f47f867814cdb08cd43d4b82f95bfde4a9ae579.tar.bz2
linux-stable-3f47f867814cdb08cd43d4b82f95bfde4a9ae579.zip
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: 54a732018d8e ("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>
-rw-r--r--drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c
index 2b8b3745eaf0..f2ab7cd09cf3 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c
@@ -1052,6 +1052,7 @@ static int mlxsw_sp_port_fdb_dump(struct mlxsw_sp_port *mlxsw_sp_port,
struct net_device *orig_dev)
{
struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp;
+ struct mlxsw_sp_port *tmp;
u16 vport_fid = 0;
char *sfd_pl;
char mac[ETH_ALEN];
@@ -1113,8 +1114,9 @@ static int mlxsw_sp_port_fdb_dump(struct mlxsw_sp_port *mlxsw_sp_port,
case MLXSW_REG_SFD_REC_TYPE_UNICAST_LAG:
mlxsw_reg_sfd_uc_lag_unpack(sfd_pl, i,
mac, &fid, &lag_id);
- if (mlxsw_sp_port ==
- mlxsw_sp_lag_rep_port(mlxsw_sp, lag_id)) {
+ tmp = mlxsw_sp_lag_rep_port(mlxsw_sp, lag_id);
+ if (tmp && tmp->local_port ==
+ mlxsw_sp_port->local_port) {
/* LAG records can only point to LAG
* devices or VLAN devices on top.
*/