From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 634AAA04AE; Tue, 5 May 2020 08:16:29 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0AF3F1D150; Tue, 5 May 2020 08:16:29 +0200 (CEST) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 306651C2FB for ; Tue, 5 May 2020 08:16:27 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE1 (envelope-from ophirmu@mellanox.com) with ESMTPS (AES256-SHA encrypted); 5 May 2020 09:16:26 +0300 Received: from localhost.localdomain (pegasus05.mtr.labs.mlnx [10.210.16.100]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 0456GQ5i005104; Tue, 5 May 2020 09:16:26 +0300 Received: from pegasus05.mtr.labs.mlnx (localhost [127.0.0.1]) by localhost.localdomain (8.14.7/8.14.7) with ESMTP id 0456GPtf016026; Tue, 5 May 2020 06:16:25 GMT Received: (from root@localhost) by pegasus05.mtr.labs.mlnx (8.14.7/8.14.7/Submit) id 0456GPRX016025; Tue, 5 May 2020 06:16:25 GMT From: Ophir Munk To: dev@dpdk.org Cc: Ophir Munk , Raslan Darawsheh , Matan Azrad Date: Tue, 5 May 2020 06:16:07 +0000 Message-Id: <20200505061607.15978-1-ophirmu@mellanox.com> X-Mailer: git-send-email 2.8.4 In-Reply-To: <20200504063851.25030-1-ophirmu@mellanox.com> References: <20200504063851.25030-1-ophirmu@mellanox.com> Subject: [dpdk-dev] [PATCH v2] net/mlx5: fix resetting verbs hash fields 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 flow_verbs_translate() function accumulates hash fields while iterating through the flow items (SRC_IPV4, DST_IPV4, SRC_IPV6, DST_IPV6, SRC_PORT_TCP, DST_PORT_TCP, SRC_PORT_UDP, DST_PORT_UDP). Before this commit the dev_flow handle structure was reused in each new flow_verbs_translate() call, however the dev_flow->hash_fields variable was not reset before each call. As a result hash_fields from previous calls remained present in the current flow which lead to invalid combinations (e.g. simultaneous IPv4 and IPv6 specs). This scenario happens for example in the next flows sequence, when running in verbs mode (dv_flow_en=0). flow create 0 ingress group 0 pattern eth / ipv4 / end flow create 0 ingress group 0 pattern eth / ipv6 / end The fix is to reset dev_flow->hash_fields in flow_verbs_prepare(). Fixes: e7bfa3596a0a ("net/mlx5: separate the flow handle resource") Signed-off-by: Ophir Munk --- drivers/net/mlx5/mlx5_flow_verbs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/mlx5/mlx5_flow_verbs.c b/drivers/net/mlx5/mlx5_flow_verbs.c index 7efd97f..4659f0a 100644 --- a/drivers/net/mlx5/mlx5_flow_verbs.c +++ b/drivers/net/mlx5/mlx5_flow_verbs.c @@ -1539,6 +1539,7 @@ flow_verbs_prepare(struct rte_eth_dev *dev, dev_flow->verbs.size = 0; dev_flow->verbs.attr.num_of_specs = 0; dev_flow->ingress = attr->ingress; + dev_flow->hash_fields = 0; /* Need to set transfer attribute: not supported in Verbs mode. */ return dev_flow; } -- 2.8.4