Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 816f6706 authored by Or Gerlitz's avatar Or Gerlitz Committed by David S. Miller
Browse files

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: 5c65c564 ('net/mlx5e: Support offloading TC NIC hairpin flows')
Signed-off-by: default avatarOr Gerlitz <ogerlitz@mellanox.com>
Reported-by: default avatarAlaa Hleihel <alaa@mellanox.com>
Tested-by: default avatarAlaa Hleihel <alaa@mellanox.com>
Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b13f9c63
Loading
Loading
Loading
Loading
+4 −4
Original line number Original line Diff line number Diff line
@@ -1970,15 +1970,15 @@ static bool actions_match_supported(struct mlx5e_priv *priv,
static bool same_hw_devs(struct mlx5e_priv *priv, struct mlx5e_priv *peer_priv)
static bool same_hw_devs(struct mlx5e_priv *priv, struct mlx5e_priv *peer_priv)
{
{
	struct mlx5_core_dev *fmdev, *pmdev;
	struct mlx5_core_dev *fmdev, *pmdev;
	u16 func_id, peer_id;
	u64 fsystem_guid, psystem_guid;


	fmdev = priv->mdev;
	fmdev = priv->mdev;
	pmdev = peer_priv->mdev;
	pmdev = peer_priv->mdev;


	func_id = (u16)((fmdev->pdev->bus->number << 8) | PCI_SLOT(fmdev->pdev->devfn));
	mlx5_query_nic_vport_system_image_guid(fmdev, &fsystem_guid);
	peer_id = (u16)((pmdev->pdev->bus->number << 8) | PCI_SLOT(pmdev->pdev->devfn));
	mlx5_query_nic_vport_system_image_guid(pmdev, &psystem_guid);


	return (func_id == peer_id);
	return (fsystem_guid == psystem_guid);
}
}


static int parse_tc_nic_actions(struct mlx5e_priv *priv, struct tcf_exts *exts,
static int parse_tc_nic_actions(struct mlx5e_priv *priv, struct tcf_exts *exts,