From 99eafd1b7a8d5bca32dd4381f2f6cd3840b204bb Mon Sep 17 00:00:00 2001 From: Viacheslav Ovsiienko Date: Thu, 14 Nov 2019 08:56:36 +0000 Subject: [PATCH] net/mlx5: fix vport id in port id action The kernel driver (starting from OFED 4.7.3.1.3) uses the upper half of metadata register C0 to provide VHCA and vport id's. The mlx5 PMD should check the actual mask of register C0 and shift the vport id value for port actions appropriately. Fixes: f07341e7aed3 ("net/mlx5: update source and destination vport translations") Signed-off-by: Viacheslav Ovsiienko Acked-by: Matan Azrad --- drivers/net/mlx5/mlx5_flow_dv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index 2094e183b4..5a0cd09e2c 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -6532,7 +6532,8 @@ flow_dv_translate_action_port_id(struct rte_eth_dev *dev, NULL, "No eswitch info was found for port"); if (priv->vport_meta_mask) - *dst_port_id = priv->vport_meta_tag; + *dst_port_id = priv->vport_meta_tag >> + rte_bsf32(priv->vport_meta_mask); else *dst_port_id = priv->vport_id; return 0; -- 2.20.1