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
1970static bool same_hw_devs(struct mlx5e_priv *priv, struct mlx5e_priv *peer_priv)1970static 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
1984static int parse_tc_nic_actions(struct mlx5e_priv *priv, struct tcf_exts *exts,1984static int parse_tc_nic_actions(struct mlx5e_priv *priv, struct tcf_exts *exts,