Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3f47f867 authored by Ido Schimmel's avatar Ido Schimmel Committed by David S. Miller
Browse files

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: 54a73201 ("mlxsw: spectrum: Adjust switchdev ops for VLAN devices")
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 304f5158
Loading
Loading
Loading
Loading
+4 −2
Original line number Original line Diff line number Diff line
@@ -1052,6 +1052,7 @@ static int mlxsw_sp_port_fdb_dump(struct mlxsw_sp_port *mlxsw_sp_port,
				  struct net_device *orig_dev)
				  struct net_device *orig_dev)
{
{
	struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp;
	struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp;
	struct mlxsw_sp_port *tmp;
	u16 vport_fid = 0;
	u16 vport_fid = 0;
	char *sfd_pl;
	char *sfd_pl;
	char mac[ETH_ALEN];
	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:
			case MLXSW_REG_SFD_REC_TYPE_UNICAST_LAG:
				mlxsw_reg_sfd_uc_lag_unpack(sfd_pl, i,
				mlxsw_reg_sfd_uc_lag_unpack(sfd_pl, i,
							    mac, &fid, &lag_id);
							    mac, &fid, &lag_id);
				if (mlxsw_sp_port ==
				tmp = mlxsw_sp_lag_rep_port(mlxsw_sp, lag_id);
				    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
					/* LAG records can only point to LAG
					 * devices or VLAN devices on top.
					 * devices or VLAN devices on top.
					 */
					 */