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 4852442630; Mon, 25 Sep 2023 04:10:20 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 69155402E2; Mon, 25 Sep 2023 04:10:09 +0200 (CEST) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2054.outbound.protection.outlook.com [40.107.244.54]) by mails.dpdk.org (Postfix) with ESMTP id EC268402E2 for ; Mon, 25 Sep 2023 04:10:07 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IQlbuTqV5Fwsb3QPXgrTuUttu7Pnauq81NBzQNQr8Fw+wfz5g/Y8J/BApQBUyVgKmPyltx7v7cwYot/3oFOA/enEVhFEEF4wUIvCKOvZ2JOOfjGB2X+8ZoSW4X3y5C7+qtXDZemFZ8Rd/EHo11GYgVRlfMLxMqr1bl5MXhkU+n6W8lhvLE90r3yEcj/DVQul1usgV/PMppzso2oNxnXHCCptMZDqimufw5q1wrlrjFs8ytGr4H2pqdjNYgIEp2RJOFApMoCULq+Xv+VV47Lq0szXpm9ht8Vd902scMghRICkLDxkrXYFjZ38kUDrspa9MxD6NTsAgOAH4dYWHuQGgA== 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=bhRDc/jcsSEnLE2KZGAct6MlrlZz65c3zZWvPOdE/sM=; b=miP/pah1ZAvxPPbeM385MUK1mQzHIT9MMw8BaGotP+pfYoCsKGiRSp6MwkK2GVyCPLyJRaPHrhHSgHWQDqRPS0rSQYtpu0Q7shwOTBODcqLNlxzRp8eFMInFv5m/HoxTC4t4W0DXVrtcvgpy/ky07+y4K7KoCwM3oLwg2YmUX3QKATxVTAvYLkpo002lWB34pa0Pm7/GTmOyrtSi3EROkT0sLgHEOV5kNANfogiSxGdiGi7mFJZ2qQjN8MmBDY0c5VpCeAoXihCNklwev9b9RskZ9X4THqoT8W7q/4qToxNPenE7ZDh2r5irUFXPmZJn15d9fQ2yIYVSkwjv2N/sFA== 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=bhRDc/jcsSEnLE2KZGAct6MlrlZz65c3zZWvPOdE/sM=; b=XGXYha4LiTnPdyTayx76pK++FOE2z5BBwrsIBGAP1y6f4XN0TpK9/kzOqJ+mkzfNo1k0KM+E9k/9f6Sx5H1rzXQTNc12NjNuBIk2ktfHJi+l4WlEhEuC4V32Cx5QmehRz44EeNupxzZ7tl4zLWPs3Fx8ww8IRj8eb5BYkTnWas9q++4AxwWaGNuF/szhCdcXDbe8pfh++rJCJia96KSHKJPXDFOGNK8gG7O0L2cyclFvdE2ei27RrB2ZXgrUfO9W9F9Jbhi8vVUxQGbpwsUQ2t/FneDP1Cj3eHLeOuG03D26D72UEANYd7Fykvamt/Mq7i/Hu+9DWpdMfNebwkoglg== Received: from MWH0EPF00056D06.namprd21.prod.outlook.com (2603:10b6:30f:fff2:0:1:0:10) by DS0PR12MB8441.namprd12.prod.outlook.com (2603:10b6:8:123::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6792.28; Mon, 25 Sep 2023 02:10:05 +0000 Received: from MWH0EPF000971E8.namprd02.prod.outlook.com (2a01:111:f403:c903::1) by MWH0EPF00056D06.outlook.office365.com (2603:1036:d20::b) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.4 via Frontend Transport; Mon, 25 Sep 2023 02:10:05 +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 MWH0EPF000971E8.mail.protection.outlook.com (10.167.243.68) 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 02:10:05 +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; Sun, 24 Sep 2023 19:09:47 -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; Sun, 24 Sep 2023 19:09:44 -0700 From: Haifei Luo To: CC: , , , , , Dariusz Sosnowski , Matan Azrad , Suanming Mou Subject: [PATCH v2 3/5] net/mlx5: enhance the validation for item VXLAN-GPE Date: Mon, 25 Sep 2023 05:09:18 +0300 Message-ID: <20230925020921.4607-4-haifeil@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20230925020921.4607-1-haifeil@nvidia.com> References: <20230809074046.121807-1-haifeil@nvidia.com> <20230925020921.4607-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: rnnvmail203.nvidia.com (10.129.68.9) To rnnvmail202.nvidia.com (10.129.68.7) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWH0EPF000971E8:EE_|DS0PR12MB8441:EE_ X-MS-Office365-Filtering-Correlation-Id: 691230ef-4ae8-4057-fe56-08dbbd6c88f3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: bYTIoJD+J/RMuVtHsZ8m3o8V9OouhvaRzv9AgcSmPG/QaqukC9TVet8iAiws0ywhdVHg6SZ9hmPQx0sRKEPcYa3+/H0J12gB25uVs0lJemgj9QEL8qFmVVPiGTu6Ks4EIKuoAH9BLIBxUaTNWEFYQ5FjiJARR3ImdUfVSQ1YnUeNj/o0gPLqxLCkD18RsuW2J7GdQXi2QsJ/gjnPymkZ5D86yScXa3UQYVGpkB/HkczWTdl+bds7+suyzHk6X2hrujnTN2D5rXroHbHGQaYaCSG4bIY+P22i3NUrAsLz47GLQYo+Thj5/lR6ugoncIag9dsz3RbyQf89NuVPeDnBmCyfaCqiDsB/sAFsij2Mv3i3Bq+2XduzUZ31F/lMxofa/PD1OAjIqgMwAm2pl6nVYEH2v4lb08vO1m0szhefrO48NNbl6KjOFdSvdA3Ms8mYrP+gWrYkc6JtZnLyxuR1L6dj44g8+jNY81sh7CXw7Z5QWq9HijotkwdEXG6EBzg7BwcEkVoB9eAcSOVjE3MH1Gs/626nPdL/Ja7ok109Odh7a9/3BOXfAiaH74EKq250TXAFKGyvMSsaV2Alc0CvW7Fp46pDpD6V/euaupClGpkGmRnigWLybUfa1dcnkYzeODh+fN/B5IKqO8Q4vMrHvObIcAUZY40km1bnQFKxVdorAMiwi6dDKjUqtj4zpvafNOfrz/C2EA0mtMAxRfNElBUpa7cA61Q+ol51DZKAraeXq+bkUKtveP/yF6KkBdUT 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)(39860400002)(376002)(396003)(346002)(136003)(230922051799003)(451199024)(82310400011)(186009)(1800799009)(36840700001)(46966006)(40470700004)(26005)(6286002)(36860700001)(1076003)(107886003)(47076005)(7696005)(8936002)(336012)(2906002)(426003)(55016003)(83380400001)(5660300002)(7636003)(16526019)(70586007)(70206006)(6916009)(8676002)(316002)(40460700003)(41300700001)(40480700001)(2616005)(86362001)(4326008)(478600001)(54906003)(36756003)(6666004)(82740400003)(356005); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Sep 2023 02:10:05.3303 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 691230ef-4ae8-4057-fe56-08dbbd6c88f3 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: MWH0EPF000971E8.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB8441 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 --- 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