diff options
author | Or Gerlitz <ogerlitz@mellanox.com> | 2018-08-08 18:48:07 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-08-08 22:07:37 -0400 |
commit | 816f670623692b5da2787f278cbfdb331ed29b8a (patch) | |
tree | 4857bc0a0eb41dee7e99380157f2522dc94d8357 | |
parent | b13f9c6364373a1b9f71e9846dc4fb199296f926 (diff) |
net/mlx5e: Properly check if hairpin is possible between two functions
The current check relies on function BDF addresses and can get
us wrong e.g when two VFs are assigned into a VM and the PCI
v-address is set by the hypervisor.
Fixes: 5c65c564c962 ('net/mlx5e: Support offloading TC NIC hairpin flows')
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Reported-by: Alaa Hleihel <alaa@mellanox.com>
Tested-by: Alaa Hleihel <alaa@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c index 3a2c4e548226..dfbcda0d0e08 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | |||
@@ -1970,15 +1970,15 @@ static bool actions_match_supported(struct mlx5e_priv *priv, | |||
1970 | static bool same_hw_devs(struct mlx5e_priv *priv, struct mlx5e_priv *peer_priv) | 1970 | static bool same_hw_devs(struct mlx5e_priv *priv, struct mlx5e_priv *peer_priv) |
1971 | { | 1971 | { |
1972 | struct mlx5_core_dev *fmdev, *pmdev; | 1972 | struct mlx5_core_dev *fmdev, *pmdev; |
1973 | u16 func_id, peer_id; | 1973 | u64 fsystem_guid, psystem_guid; |
1974 | 1974 | ||
1975 | fmdev = priv->mdev; | 1975 | fmdev = priv->mdev; |
1976 | pmdev = peer_priv->mdev; | 1976 | pmdev = peer_priv->mdev; |
1977 | 1977 | ||
1978 | func_id = (u16)((fmdev->pdev->bus->number << 8) | PCI_SLOT(fmdev->pdev->devfn)); | 1978 | mlx5_query_nic_vport_system_image_guid(fmdev, &fsystem_guid); |
1979 | peer_id = (u16)((pmdev->pdev->bus->number << 8) | PCI_SLOT(pmdev->pdev->devfn)); | 1979 | mlx5_query_nic_vport_system_image_guid(pmdev, &psystem_guid); |
1980 | 1980 | ||
1981 | return (func_id == peer_id); | 1981 | return (fsystem_guid == psystem_guid); |
1982 | } | 1982 | } |
1983 | 1983 | ||
1984 | static int parse_tc_nic_actions(struct mlx5e_priv *priv, struct tcf_exts *exts, | 1984 | static int parse_tc_nic_actions(struct mlx5e_priv *priv, struct tcf_exts *exts, |