From patchwork Thu Nov 14 08:56:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Slava Ovsiienko X-Patchwork-Id: 62996 X-Patchwork-Delegate: rasland@nvidia.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 41E0FA04C2; Thu, 14 Nov 2019 09:56:43 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A1A822BC8; Thu, 14 Nov 2019 09:56:42 +0100 (CET) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id AE5B22BA8 for ; Thu, 14 Nov 2019 09:56:40 +0100 (CET) Received: from Internal Mail-Server by MTLPINE1 (envelope-from viacheslavo@mellanox.com) with ESMTPS (AES256-SHA encrypted); 14 Nov 2019 10:56:39 +0200 Received: from pegasus12.mtr.labs.mlnx (pegasus12.mtr.labs.mlnx [10.210.17.40]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id xAE8ud7m030078; Thu, 14 Nov 2019 10:56:39 +0200 Received: from pegasus12.mtr.labs.mlnx (localhost [127.0.0.1]) by pegasus12.mtr.labs.mlnx (8.14.7/8.14.7) with ESMTP id xAE8udt3022654; Thu, 14 Nov 2019 08:56:39 GMT Received: (from viacheslavo@localhost) by pegasus12.mtr.labs.mlnx (8.14.7/8.14.7/Submit) id xAE8udgg022652; Thu, 14 Nov 2019 08:56:39 GMT X-Authentication-Warning: pegasus12.mtr.labs.mlnx: viacheslavo set sender to viacheslavo@mellanox.com using -f From: Viacheslav Ovsiienko To: dev@dpdk.org Cc: matan@mellanox.com, rasland@mellanox.com, orika@mellanox.com Date: Thu, 14 Nov 2019 08:56:36 +0000 Message-Id: <1573721796-22614-1-git-send-email-viacheslavo@mellanox.com> X-Mailer: git-send-email 1.8.3.1 Subject: [dpdk-dev] [PATCH] net/mlx5: fix vport id value in port id action X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 2094e18..5a0cd09 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -6532,7 +6532,8 @@ struct field_modify_info modify_tcp[] = { 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;