Skip to content

Commit dd3fddb

Browse files
roidayanSaeed Mahameed
authored andcommitted
net/mlx5: E-Switch, handle devcom events only for ports on the same device
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 <[email protected]> Reviewed-by: Maor Dickman <[email protected]> Reviewed-by: Mark Bloch <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
1 parent c671972 commit dd3fddb

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

drivers/net/ethernet/mellanox/mlx5/core/dev.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -500,10 +500,7 @@ static int next_phys_dev(struct device *dev, const void *data)
500500
return 1;
501501
}
502502

503-
/* This function is called with two flows:
504-
* 1. During initialization of mlx5_core_dev and we don't need to lock it.
505-
* 2. During LAG configure stage and caller holds &mlx5_intf_mutex.
506-
*/
503+
/* Must be called with intf_mutex held */
507504
struct mlx5_core_dev *mlx5_get_next_phys_dev(struct mlx5_core_dev *dev)
508505
{
509506
struct auxiliary_device *adev;

drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2368,6 +2368,9 @@ static int mlx5_esw_offloads_devcom_event(int event,
23682368

23692369
switch (event) {
23702370
case ESW_OFFLOADS_DEVCOM_PAIR:
2371+
if (mlx5_get_next_phys_dev(esw->dev) != peer_esw->dev)
2372+
break;
2373+
23712374
if (mlx5_eswitch_vport_match_metadata_enabled(esw) !=
23722375
mlx5_eswitch_vport_match_metadata_enabled(peer_esw))
23732376
break;

0 commit comments

Comments
 (0)