History

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.

Or Gerlitz committed 8 years ago

Commit 816f6701 parent b13f9c61 file · +4 −4Browse files

Unified · Split

drivers/net/ethernet/mellanox/mlx5/core/en_tc.c+4−4
@@ -1970,15 +1970,15 @@ static bool actions_match_supported(struct mlx5e_priv *priv, · 1969 unmodified lines
19701970 static bool same_hw_devs(struct mlx5e_priv *priv, struct mlx5e_priv *peer_priv)
19711971 {
19721972 struct mlx5_core_dev *fmdev, *pmdev;
1973− u16 func_id, peer_id;
1973+ u64 fsystem_guid, psystem_guid;
19741974
19751975 fmdev = priv->mdev;
19761976 pmdev = peer_priv->mdev;
19771977
1978− func_id = (u16)((fmdev->pdev->bus->number << 8) | PCI_SLOT(fmdev->pdev->devfn));
1979− peer_id = (u16)((pmdev->pdev->bus->number << 8) | PCI_SLOT(pmdev->pdev->devfn));
1978+ mlx5_query_nic_vport_system_image_guid(fmdev, &fsystem_guid);
1979+ mlx5_query_nic_vport_system_image_guid(pmdev, &psystem_guid);
19801980
1981− return (func_id == peer_id);
1981+ return (fsystem_guid == psystem_guid);
19821982 }
19831983
19841984 static int parse_tc_nic_actions(struct mlx5e_priv *priv, struct tcf_exts *exts,