From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4F92F42635; Mon, 25 Sep 2023 10:08:44 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 640A240A72; Mon, 25 Sep 2023 10:08:37 +0200 (CEST) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2042.outbound.protection.outlook.com [40.107.92.42]) by mails.dpdk.org (Postfix) with ESMTP id 9945E406A2 for ; Mon, 25 Sep 2023 10:08:34 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HLRkFN7ilEIMbXS2Ub7toU9J1nStTMD2Z7Fcs1SR8foUkFK3XlXXbAO+12Ysysmz+ZGI9xpRFH1vUIBdQqKb2VtlkWx6y9fIt5748FHegcAF5Y/O6z07mtoRq0WBEGtjKkNEq85AVMFuuwfZA4NfHF8MVRgkDQa6QTPlbMmlP2pKGGduO+pqmsax/4hodjiXywE7JAO3cXEw2B/JaWW9d7JJGqcXvKbGZRSwy5hfP+x9CUXEQOX+zezn6Q6aFZfKJujrGoPTjU4p4M/w8S7KciS6ZBjcAskYwH4hmUOhh3tsDV6VW/YOFGDKRxSFlYJCwdCXr6kFggBNw4jtWQ76Ow== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=W8l5tjBEpF4Q0jSY7w9GsMN97RonFxj9X4+cjj8pY9k=; b=oVGeWsZrop1iVHsqPk+GbTB7/L0PErXk32RkcT2URLiF3yVODfSa3d1SSRNKwfTryD6LCocPjES+4JiaQpTKfiJPllPuN4rgYarttJ1GXOM6hJjZy8/WawZ2wH3CQ95NUuu5PUuWksaXLnhU15GUh/ID0Pg85q2VRTSzKCT8nkf32pfkJRd0pcu3kvcXvMPTFWTGCxRZKkhGcaACOA0mgwyzRRl23LzbhnjQRS5G7T+i3VOGnYwYRZ9V5B1PO+2Lje8zqA8MosgEL+shoKQb0g6l5vBLQvBJCYlFGrREa+Wylb240a4nmFUyTBtEdFqJauR4EJh7F1CdIm0lU1UVkw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=W8l5tjBEpF4Q0jSY7w9GsMN97RonFxj9X4+cjj8pY9k=; b=YwWhhIQzSFsmfKQafY0BHBlycbfBQaOsKFIXYtjICmi7N4NOenzhYIahUzpzpkZSdSEYGN/mVJivZtbXqj182S/ufux9q0zXT95wm21vnLi3RaBWgoch9QwU0Ydkh8GEm0pduTPBVFa+gq3xW77z83pDcp6BAWPLKhH3o14mfqBNSM6v0SMBjQJ3w4LKylgiM65U5+McPXbGit+w88RgnTROdcdQ/OtaVvbfLvE93Sa5s1AlP0Q0HN6++0CImORpVSLCOBHL480OkkUgefIQBJ9Wzk291OxlMFESMoXlQ+BWzOUpx7mVFxZ+mLNL1wlNl9vUDI3QYuvqNVF+Ao9DKw== Received: from BYAPR11CA0037.namprd11.prod.outlook.com (2603:10b6:a03:80::14) by IA1PR12MB8359.namprd12.prod.outlook.com (2603:10b6:208:3fc::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6813.28; Mon, 25 Sep 2023 08:08:33 +0000 Received: from CO1PEPF000044F3.namprd05.prod.outlook.com (2603:10b6:a03:80:cafe::27) by BYAPR11CA0037.outlook.office365.com (2603:10b6:a03:80::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6792.35 via Frontend Transport; Mon, 25 Sep 2023 08:08:32 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by CO1PEPF000044F3.mail.protection.outlook.com (10.167.241.73) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.14 via Frontend Transport; Mon, 25 Sep 2023 08:08:31 +0000 Received: from rnnvmail202.nvidia.com (10.129.68.7) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Mon, 25 Sep 2023 01:08:17 -0700 Received: from nvidia.com (10.126.231.35) by rnnvmail202.nvidia.com (10.129.68.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Mon, 25 Sep 2023 01:08:14 -0700 From: Haifei Luo To: CC: , , , , , Dariusz Sosnowski , Suanming Mou , Matan Azrad Subject: [PATCH v3 3/5] net/mlx5: enhance the validation for item VXLAN-GPE Date: Mon, 25 Sep 2023 11:07:44 +0300 Message-ID: <20230925080746.16438-4-haifeil@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20230925080746.16438-1-haifeil@nvidia.com> References: <20230925020921.4607-1-haifeil@nvidia.com> <20230925080746.16438-1-haifeil@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail202.nvidia.com (10.129.68.7) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PEPF000044F3:EE_|IA1PR12MB8359:EE_ X-MS-Office365-Filtering-Correlation-Id: aa4f38f0-91a7-434d-154e-08dbbd9e9bde X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: GDY67jIsWf+ife16QFQXLwRG2WemD0wC4DBgBsjfDPE8VA7XFOKOKEppPXIg0riLSjhdvsY2JX+a1PFDIoX7V8CJj1tl3XjKVXbRtBUZq8mgjFyxcuxSYebcLCKtdFj7FnD5v+4gsqn6qwHkMTr1zvpkpHYkA9pboGQT2s+Dfukg9OzVAv4J2VVLrUuXN/iEnqEub3RmgjP/f9408U3ZyWwM8nyjKcc/ysdnYR4CPEDdkLV0bqaM96mP9eWddjYKiiPsgAy7QygcUnoGbiNEuobyXkTNYqW//TsKczTgeFbrj9egopNrhU6w14CSVi6jL7Min6LMf2lQlr1OIXtKyPQCdp6ZdSVDDlVs1u/E0lKTsP1v6CXgx3HQI70VzwckFiOq6zmJoNKcUCxdUVKD/VOjxpHd410FlLWI/oTQ79CLCei0IrBmjdRt0OrdEVmEmjQTRe0A1zYiSHUrc1oyl7WXnb27gjCtC0EhmDFToFDEXHhygthQK83IFxfHGkYq6rXEJjmoAJhxdok3D5mj1fTe+QoRSjqNJzsmosKgDxsQ7sQVR1jDn/fnqCcZ8N346Hv5On5BHQ244fYBKViEQpEAUq4op+5m4ieaUQ19dSqwyPJ+I/iaUxMak7GVw4EceIKge2fzp0J08p1ENyG8oewCu8Cnv13yP1aypy0JHxUu485tp8hXtcdLy8g9aRwp2Rl3XexoFa4GVjcKtvB1uMfzSIPbwJ+7sdnO8opQbpyGO7Rc7G9Zqap77NR0Ntbc X-Forefront-Antispam-Report: CIP:216.228.117.161; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge2.nvidia.com; CAT:NONE; SFS:(13230031)(4636009)(376002)(396003)(136003)(346002)(39850400004)(230922051799003)(451199024)(1800799009)(186009)(82310400011)(40470700004)(46966006)(36840700001)(41300700001)(55016003)(107886003)(2616005)(8936002)(1076003)(4326008)(8676002)(36860700001)(54906003)(70206006)(70586007)(6916009)(316002)(426003)(26005)(6286002)(16526019)(336012)(86362001)(2906002)(40460700003)(47076005)(356005)(7636003)(82740400003)(478600001)(40480700001)(83380400001)(6666004)(36756003)(5660300002)(7696005); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Sep 2023 08:08:31.9625 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: aa4f38f0-91a7-434d-154e-08dbbd9e9bde X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.161]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1PEPF000044F3.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB8359 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Enhance the validation so that configuring vxlan-gpe's next protocol as NSH is supported. 1. The spec's protocol can have value and nic_mask's protocol is 0xff. Signed-off-by: Haifei Luo Acked-by: Dariusz Sosnowski Acked-by: Suanming Mou --- drivers/net/mlx5/mlx5_flow.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index f7f8f54eb4..202e878ddf 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -3198,6 +3198,11 @@ mlx5_flow_validate_item_vxlan_gpe(const struct rte_flow_item *item, uint8_t vni[4]; } id = { .vlan_id = 0, }; + struct rte_flow_item_vxlan_gpe nic_mask = { + .vni = "\xff\xff\xff", + .protocol = 0xff, + }; + if (!priv->sh->config.l3_vxlan_en) return rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_ITEM, item, @@ -3221,18 +3226,12 @@ mlx5_flow_validate_item_vxlan_gpe(const struct rte_flow_item *item, mask = &rte_flow_item_vxlan_gpe_mask; ret = mlx5_flow_item_acceptable (item, (const uint8_t *)mask, - (const uint8_t *)&rte_flow_item_vxlan_gpe_mask, + (const uint8_t *)&nic_mask, sizeof(struct rte_flow_item_vxlan_gpe), MLX5_ITEM_RANGE_NOT_ACCEPTED, error); if (ret < 0) return ret; if (spec) { - if (spec->hdr.proto) - return rte_flow_error_set(error, ENOTSUP, - RTE_FLOW_ERROR_TYPE_ITEM, - item, - "VxLAN-GPE protocol" - " not supported"); memcpy(&id.vni[1], spec->hdr.vni, 3); memcpy(&id.vni[1], mask->hdr.vni, 3); } -- 2.27.0