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 570F2A04AF; Mon, 4 May 2020 08:39:07 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D573D1D40B; Mon, 4 May 2020 08:39:06 +0200 (CEST) Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-eopbgr140054.outbound.protection.outlook.com [40.107.14.54]) by dpdk.org (Postfix) with ESMTP id 8683E1F28 for ; Mon, 4 May 2020 08:39:05 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=I6ricp9mD8cT5y/y4vhWvIlbK3yOrtHPWKqlEolLDCjmHLlQG7EcwRQ/tkGAycdAVIYe9YxC3CVlxuIa89RYRHAbKfcbt/Ah1FTiMcIpytcg+ZIIq/3EE0MTZq/mwo69ZIWV7Dsg02iV7qPhkRpERIpni+2Q6daCQ/K4udVGqRCKGFzBtPDRO4JVAQ3GNPlJCKZKCGtz2BwqELB9bNZyK+flFaWZ0VtdO2RBmdybihYWWd2uqfF+cC3EL5pNKU4M5KxyLqxFNUvv2Do/BwKf+YSFelpv0VKy7ywAU6jpyf/45m/cxwTpfpfo3VL50iNJadP3dYJw+p92wgsbtJKrjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=36YRxBGaToSiH8fU+MiXeJ3dHuywDyu4sKLw2vIq/0I=; b=NJigvWbHlyCCKZOJhvO9JjYMhjvGkQt5j+eudjYVIpUMMK3j4EDX4+vgn6X6disncpAnlf6qYFpt+VRZgm0Bgls4gKhPkYSduqiMBfK9ETxpLwE5QkCyn3bngwaoHOXf3xQ900RNg6lhE2Mhhe8JhApP8VBUOD0UjgBsDxCL+WlUHW2bRPQVREJgKeO6wZKx4cT1xYfmxD2RgPxAQE8jSG8fXBKHgDx5aSCMNkbbL1w6wc4v9meU4Ey7OF6fVw8rhXesYrQJfrmYfab6Yd7Q3+FVgFvEutGVxnn+WC/NTfefeeHNUYXVPEQLiQKaP/x2wvw8egJGCli8XCTCbFKpqw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=36YRxBGaToSiH8fU+MiXeJ3dHuywDyu4sKLw2vIq/0I=; b=ng7TsfyJMd/tOA4AlYeSuG4oPnicxEnmMrB0VwTeiCMjj7jDIN/rIcGpklrsVr71dhrdOX0GzMXUJGqgAANtHhI/r2dBRIhVCVZB457mcobWxkkeOY2KBHWurRw+erWP8vr10o5QRW1FAp2ZnG+HvtYq+iN8Hr+ZDi5iH5k37NA= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=mellanox.com; Received: from AM0PR05MB4209.eurprd05.prod.outlook.com (2603:10a6:208:61::22) by AM0PR05MB5202.eurprd05.prod.outlook.com (2603:10a6:208:f3::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.19; Mon, 4 May 2020 06:39:03 +0000 Received: from AM0PR05MB4209.eurprd05.prod.outlook.com ([fe80::1068:89a9:41d3:b14a]) by AM0PR05MB4209.eurprd05.prod.outlook.com ([fe80::1068:89a9:41d3:b14a%3]) with mapi id 15.20.2958.029; Mon, 4 May 2020 06:39:03 +0000 From: Ophir Munk To: dev@dpdk.org, Raslan Darawsheh Cc: Ophir Munk Date: Mon, 4 May 2020 06:38:51 +0000 Message-Id: <20200504063851.25030-1-ophirmu@mellanox.com> X-Mailer: git-send-email 2.8.4 Content-Type: text/plain X-ClientProxiedBy: PR0P264CA0116.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:19::32) To AM0PR05MB4209.eurprd05.prod.outlook.com (2603:10a6:208:61::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from mellanox.com (37.142.13.130) by PR0P264CA0116.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:19::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.19 via Frontend Transport; Mon, 4 May 2020 06:39:02 +0000 X-Mailer: git-send-email 2.8.4 X-Originating-IP: [37.142.13.130] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 78819be3-8324-4a5e-7e49-08d7eff5d5f0 X-MS-TrafficTypeDiagnostic: AM0PR05MB5202:|AM0PR05MB5202: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtFwd X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1079; X-Forefront-PRVS: 03932714EB X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: D6BhhsmDbrqxzTdQ8C5TvQiQYEO7XMWNPstpJLr62VXFbZqIa7oeAl0bMK56abUYmN7flhXg4DRvme1+uKpr6Hr2bmUQW6ZtNmcDu5nJzy/iYJH01mKg8iijm5p08W/clyP3BMPp9qLEOKYf3c6ga43mRaqCQMB8TMsZ/BP/zSTQeTuKjnan1mH5w+PJgNm6iF1erRxgYKTlidpdZQ0OgMqbN6PATBdIJ6aezUyNmYCpSpG3XgP4eeF9FA2Pde5TvTow16VMzdhtL3xO7Kd3gQhlvPf2hRDNSsqXa3jZlaXh5UR3NEi5VlLDLaCFqwZUfUfuH1139tu7h2+pFFFBVjVPZCXwt2RkP6Xn2KKkYaNkOocSAjgwzDVCv8EpzK3oByF8dPW0HUXVBwsYJwpTgu3/FTVYlheVdyY5iOhhuUsfMLsO04dULLkl6s2/JPDO X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM0PR05MB4209.eurprd05.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(366004)(346002)(39860400002)(376002)(396003)(136003)(66476007)(8886007)(8936002)(6666004)(66556008)(86362001)(36756003)(8676002)(956004)(4326008)(186003)(6862004)(26005)(5660300002)(16526019)(2616005)(107886003)(52116002)(7696005)(316002)(478600001)(37006003)(55016002)(6636002)(66946007)(1076003)(2906002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: JhAuTK2z9lVZhlcQMy9PBU2oQ+/bNaiBJJMoUjVEIXd+pVnl32jdEh8SZ9mq8h3WAblhtmPjUBauNJjzffM1V2ru3pTUziYS8Wdq8pNwRfTYd5jMjHiX2x/NIgLNe/354m1/0wvdqCsRKL0g0nYB2GdfkvPwnhtP3zPa/YvnEDdjgNcw3x3b12bSlOYbRWV/uR5rmGm4ffjydrUb/Op8EYsfRQ7xuMCjPeForF4oPdRVqsmPUXh/b39vakVdapBEQOCF8nLgjbKrcn/9dJsKn6MYzdEJVBXabx/gOit9Q0GYwtfVOBjW2LuMWGHnAwUGf8P42D1V9qYKm0vh2PAS52h+8XT13EK9yD6DSO2cjF3opMFWmgCti1niSMYniVfHJmfsIll6KuemDIqSVySiQFpOe2+PkXYB3FwHA0BFA5VUOHAIERICd0hezJlj/buK15Isi5iKdGcVS0IIoMNp1vkFzVDjKUHnNbroynjO1ZMA4nrqaGQgC7ytMa4Uf7XgnyyMIOeJY0cKuGagXsbEJZnWQKiKDdEF6eai/Nb9594JdcBRzNXDRslBUFOs96FzXMW3uJv0A1RDZak5WDcsD7r06g5RTNLfWQHF4mZ+wQnBRk0hc2uCXkt6ko0hHVE7AZllUof7Gj5SjyyTezt7qwE2OdVx6KyLBXFCDolBcDQWWE83x/EJf5aKMYyzncwASjX5CQNnKwhGauO6LtgjdwlyYnjCn7c7TbG+f3dahojDGLwNoJElfAvgP0Mr1/tSSy2RNpQRo97OiZM6F5Eo/W1btZpHF11yN0cEYyTsZPw= X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 78819be3-8324-4a5e-7e49-08d7eff5d5f0 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 May 2020 06:39:03.3587 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: dj5dom+vyUJ3OuoQ1Mjc8CgMyod1ygaiXhvcR2t0mzwlZK0x1oTZfO7MxwqO1I1sGw0g62W5NQQn9W59G282+g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR05MB5202 Subject: [dpdk-dev] [PATCH v1] 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_translate() for each new call. 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..d9aec49 100644 --- a/drivers/net/mlx5/mlx5_flow_verbs.c +++ b/drivers/net/mlx5/mlx5_flow_verbs.c @@ -1628,6 +1628,7 @@ flow_verbs_translate(struct rte_eth_dev *dev, } } dev_flow->act_flags = action_flags; + dev_flow->hash_fields = 0; for (; items->type != RTE_FLOW_ITEM_TYPE_END; items++) { int tunnel = !!(item_flags & MLX5_FLOW_LAYER_TUNNEL); -- 2.8.4