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 5CAFA43016; Wed, 9 Aug 2023 09:41:45 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 89CE443277; Wed, 9 Aug 2023 09:41:41 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2085.outbound.protection.outlook.com [40.107.237.85]) by mails.dpdk.org (Postfix) with ESMTP id AF20443261 for ; Wed, 9 Aug 2023 09:41:38 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Qm+ONH+L708+nhPuDPMC+S4SLPvN5PEE5OolJIsmTGPKFxR0xjvqvIOhj1ZYPo9opD43DwqTvS4jFm5+LpCUPUkDb+0nmvl2CqpJm6LjX/P2W2KER1negZZiq2qUH/2UHB9Jk/ppDgTwYnFADKFasyMN0HkBvZcPrOIU9YE7azMH6GvI2T23tDYHvIUIm6dD5Q1JD6VlNHVGjD5JE0QfAR4jXsBiCTowXzaPappO5TpgO2PVeoQJ+OuwCFINLWQnSYi2di4h9Jhx+J9inoRRXq2jYce+Rg3eFQXxX+Ggv5TaFeKEvN5I1z0g00Pvf60AhPb1znsheY/j6UC6KoPtHQ== 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=T2XsRuslKduU2iW41i4OWlHqIsMoAKyXygOaWF5w9XE=; b=cjRC45no1DeZSzwnyAnWBDpqCFUvtgZ3xKRuuXlxOw1wYPrilzkcEA51MiY0bejn9n0aNDfUn1eU6x0qxgDhp+blBcxnt2QN14+a4Dx4SV5och6HhAMSIUaUaxesRv/eHDcnyZ8U9n12x18C6u2ui+sFNLjnqKQEeWwEDuIF5mqRhz44Jqr4sGnq3UDLBV1lD1DRRRXS1W65T3mVbrGiT8cKwmhWHJO+TM2p8AuQqIyMSeOl43iEQY+EpBTV60OFF8RGLFDLApGFmDVzKkEEWGUOdpuxUTfEmd+R0/NqzQAzhR6k8Fh3XAv2nSuFRPpVxWiAjlxO24TAiIwS6NtBFQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) 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=T2XsRuslKduU2iW41i4OWlHqIsMoAKyXygOaWF5w9XE=; b=VGB9i1EzrgPUG8845ah+RWOUOW75qd3tZWx1anrtQXDacAIAeMX0PzrZoGCwirA3XzktRmwj8wn+niav+W3Q6qToc2eUzLiedR/ux++p3Q5yqjfbEJ/oL2FUZQ5iqwNJUUIRO5D5d0labU6FOAtzuf/oFp4Se5MiSbCpHR3MBhud1gZC4SlhdncdbiVkKyBMh6A3WhjhM/kEnOP1oT2eZcUmQWqDRxyys7I1n1PpYuDBr8sDy37qOKC3N2yKZqqZqCEzLaSHmtMR4/xmDKHnnv3Eka2+l80+HUU7kad6WBQgcdpzGXw1mp1lCEPmOiFunJuBeLRhm+RSRAflvzlZew== Received: from DM6PR02CA0159.namprd02.prod.outlook.com (2603:10b6:5:332::26) by PH8PR12MB7302.namprd12.prod.outlook.com (2603:10b6:510:221::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.21; Wed, 9 Aug 2023 07:41:37 +0000 Received: from SN1PEPF0002636C.namprd02.prod.outlook.com (2603:10b6:5:332:cafe::39) by DM6PR02CA0159.outlook.office365.com (2603:10b6:5:332::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.28 via Frontend Transport; Wed, 9 Aug 2023 07:41:37 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) 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.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by SN1PEPF0002636C.mail.protection.outlook.com (10.167.241.137) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.19 via Frontend Transport; Wed, 9 Aug 2023 07:41:36 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Wed, 9 Aug 2023 00:41:23 -0700 Received: from nvidia.com (10.126.230.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Wed, 9 Aug 2023 00:41:20 -0700 From: Haifei Luo To: , , , , Suanming Mou CC: , , , , Subject: [PATCH 3/5] net/mlx5: enhance the validation for item VXLAN-GPE Date: Wed, 9 Aug 2023 10:40:44 +0300 Message-ID: <20230809074046.121807-4-haifeil@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20230809074046.121807-1-haifeil@nvidia.com> References: <20230809074046.121807-1-haifeil@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.230.35] X-ClientProxiedBy: rnnvmail203.nvidia.com (10.129.68.9) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF0002636C:EE_|PH8PR12MB7302:EE_ X-MS-Office365-Filtering-Correlation-Id: 699dc02f-87eb-4a35-f0b7-08db98ac0fbb X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: EY7myVMmSejaRfJk0acl5YiTaczluW45ZdMbljHdI1FGbAZbvKFoDnX6kGp7A4BUojw6peawmWlpBiW4Gss42ViVV1EOHNSkq3gBxKz0NGPe2Q4/qqPBEhqrpnEL0SdUSrOF1OuR8HQTAdvPpwJe2dCuBLgkgNWqJs7GHyFEs390eeQCVVYQ2fXMutq3AWkQ2tCrSLJXiGvWzgkM50vB7Cjgyyhw3JnpHJ83XtxH3kilr4dDVXsqvbA8i2s6WB393DKoSRJssSLAq+2vMVmshatDDpMS9FKDTV92oBcwWmuq7zlvH4bH5jPNg8nzBAHD4V0K3X0OW0F6awfOXylLqQ8Jdy+1n1kAwtK+mA1xT3SpxfWVY69nL5Luqw+1cH1KSbdrDm7w6Eqcp3FeYy4XeUlY2zDjdhT3Ly3Wb3YBghdWJt+fw903SGJ1cJhArZYRMTdWPv3ZQK16nKOplNMvcd7PTTvzSyTcKsjmU8Mkm5soQV9/EJCBYmWZh+ALIDTXU4kt0VZ5WMvgUXeurXwg3TCDXqnYNZDDbhAmkMVruxyQ6xuHIsUtm9gP0Y+Jz+8aVzrydI5IsmCajug+zFhshFm5DlSYZDoz4uOxDoyNnNrzbujc24nwb9UTFzfSZbVOei7H91WmkuezNqSs/asRMpFZkZz8pYetXxSEwdfn5U+wF18ydSQZ6QYrWJvVIe7LWDuo1QsvlqwD1wF5+Lqlvd69U+Rwe406a632itzjgvk= X-Forefront-Antispam-Report: CIP:216.228.117.160; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge1.nvidia.com; CAT:NONE; SFS:(13230028)(4636009)(136003)(39860400002)(376002)(396003)(346002)(451199021)(82310400008)(1800799006)(186006)(46966006)(36840700001)(40470700004)(41300700001)(316002)(7696005)(336012)(86362001)(70586007)(4326008)(6636002)(70206006)(5660300002)(8936002)(8676002)(36860700001)(82740400003)(7636003)(356005)(110136005)(54906003)(478600001)(6666004)(2906002)(107886003)(40460700003)(1076003)(26005)(83380400001)(40480700001)(36756003)(2616005)(426003)(55016003)(16526019)(47076005)(6286002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Aug 2023 07:41:36.7266 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 699dc02f-87eb-4a35-f0b7-08db98ac0fbb 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.160]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SN1PEPF0002636C.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR12MB7302 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 --- 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 e91eb636d0..7de6640ecd 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.34.1