[v1,2/2] net/mlx5: new method to get E-Switch manager vport ID
Checks
Commit Message
Currently the E-Switch manager vport ID is supposed to be default - 0
for standalone NICs, and 0xFFFE for the SmartNICs, and is deduced from
the device PCI ID.
This uses the new method that takes the value queried from firmware as
vport ID by default. If the new method is not provided (legacy
firmware), fallback to use the PCI id approach.
Fixes: a564038699f9 ("net/mlx5: support E-Switch manager egress traffic match")
Cc: stable@dpdk.org
Signed-off-by: Shun Hao <shunh@nvidia.com>
---
drivers/net/mlx5/mlx5_flow_dv.c | 4 ++++
1 file changed, 4 insertions(+)
@@ -97,6 +97,10 @@ static int16_t
flow_dv_get_esw_manager_vport_id(struct rte_eth_dev *dev)
{
struct mlx5_priv *priv = dev->data->dev_private;
+ struct mlx5_common_device *cdev = priv->sh->cdev;
+
+ if (cdev->config.hca_attr.esw_mgr_vport_id_valid)
+ return (int16_t)cdev->config.hca_attr.esw_mgr_vport_id;
if (priv->pci_dev == NULL)
return 0;