mirror of https://gitee.com/openkylin/linux.git
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: ac004b8321
("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>
This commit is contained in:
parent
c671972534
commit
dd3fddb827
|
@ -500,10 +500,7 @@ static int next_phys_dev(struct device *dev, const void *data)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* This function is called with two flows:
|
/* Must be called with intf_mutex held */
|
||||||
* 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.
|
|
||||||
*/
|
|
||||||
struct mlx5_core_dev *mlx5_get_next_phys_dev(struct mlx5_core_dev *dev)
|
struct mlx5_core_dev *mlx5_get_next_phys_dev(struct mlx5_core_dev *dev)
|
||||||
{
|
{
|
||||||
struct auxiliary_device *adev;
|
struct auxiliary_device *adev;
|
||||||
|
|
|
@ -2368,6 +2368,9 @@ static int mlx5_esw_offloads_devcom_event(int event,
|
||||||
|
|
||||||
switch (event) {
|
switch (event) {
|
||||||
case ESW_OFFLOADS_DEVCOM_PAIR:
|
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) !=
|
if (mlx5_eswitch_vport_match_metadata_enabled(esw) !=
|
||||||
mlx5_eswitch_vport_match_metadata_enabled(peer_esw))
|
mlx5_eswitch_vport_match_metadata_enabled(peer_esw))
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue