Skip to content

Commit

Permalink
net/mlx5: E-Switch, handle devcom events only for ports on the same d…
Browse files Browse the repository at this point in the history
…evice

This is the same check as LAG mode checks if to enable lag.
This will fix adding peer miss rules if lag is not supported
and even an incorrect rules in socket direct mode.

Also fix the incorrect comment on mlx5_get_next_phys_dev() as flow #1
doesn't exists.

Fixes: ac004b8 ("net/mlx5e: E-Switch, Add peer miss rules")
Signed-off-by: Roi Dayan <roid@nvidia.com>
Reviewed-by: Maor Dickman <maord@nvidia.com>
Reviewed-by: Mark Bloch <mbloch@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
  • Loading branch information
roidayan authored and Saeed Mahameed committed Jul 27, 2021
1 parent c671972 commit dd3fddb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
5 changes: 1 addition & 4 deletions drivers/net/ethernet/mellanox/mlx5/core/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -500,10 +500,7 @@ static int next_phys_dev(struct device *dev, const void *data)
return 1;
}

/* This function is called with two flows:
* 1. During initialization of mlx5_core_dev and we don't need to lock it.
* 2. During LAG configure stage and caller holds &mlx5_intf_mutex.
*/
/* Must be called with intf_mutex held */
struct mlx5_core_dev *mlx5_get_next_phys_dev(struct mlx5_core_dev *dev)
{
struct auxiliary_device *adev;
Expand Down
3 changes: 3 additions & 0 deletions drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
Original file line number Diff line number Diff line change
Expand Up @@ -2368,6 +2368,9 @@ static int mlx5_esw_offloads_devcom_event(int event,

switch (event) {
case ESW_OFFLOADS_DEVCOM_PAIR:
if (mlx5_get_next_phys_dev(esw->dev) != peer_esw->dev)
break;

if (mlx5_eswitch_vport_match_metadata_enabled(esw) !=
mlx5_eswitch_vport_match_metadata_enabled(peer_esw))
break;
Expand Down

0 comments on commit dd3fddb

Please sign in to comment.