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 A6A34426E8; Sun, 8 Oct 2023 05:11:42 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3BE1B402F0; Sun, 8 Oct 2023 05:11:32 +0200 (CEST) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2044.outbound.protection.outlook.com [40.107.220.44]) by mails.dpdk.org (Postfix) with ESMTP id AEF6D402EE for ; Sun, 8 Oct 2023 05:11:30 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hfLLdz/iigP/PsLudDSg9BrBt5npr152YCdnxvf7uLkYhr6EJ1lqpyxhj6PlMZI9pZPFyATvHHMTl4WqoXdKFZb15HjcZ3V0euJ++t17A1G/759OoOuz1OMwuSOwdKSt7wwP3CNAF+twga1527q4iB3n1M6tN8u+i7tWiR250YqCm5yI7iP4PI6e0TbXv3/KWJPhlVwko7Qnkx8TYlABmy/2LBTzd5k5SNR5QjFdHlcbas/Oi2vDuaZGZnd3CBuGwHAwM1PtBs01QmrcsRBtsJiyY48heE4eKV6dt1isfpsMnGVwTJOnOVXpvJBjzXjJQT+iOudBOc8tbKimJ3mQmw== 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=BGDl/a6wKPFwcW68V0zlgNR4RcNxRjWOQBxOIpcgay/QHVbFerrRuY8kxaDFwHptngkM1PD61HE6mcMAo/Zvabu719kRhPBiAE4ogSR8sFEdjxsZSEPpAutSoQvVtSxMIibBo1Ezi7Xp817BZgFA21VtFE7YWmmwGla1LWZdYgK//6qK0cwiDyjD/3Q/Ani1RuvwTyNQQCxarJ3928vT1SSp60GsS+Wf7nsw9KCWBiYsr4o1tSuNEuJoHqECPzFIS62nq4G6d6C7Q7jv8Lm3rJJWHYNibRFVktmujjclQRbpT3g9biTiTA3FMDrwV2RBjhV5SCOueZ86wd7AM3xufw== 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=W8l5tjBEpF4Q0jSY7w9GsMN97RonFxj9X4+cjj8pY9k=; b=BlPhHMc34YUAirhdHM5NietDbvMUkjiX3nom6O8QZbMmQ+OhZ4UlHXT2McdDF26RuRcomKLBSDJwO6Dzfnhri9EmMAeZprRRUlaBY3xP0obY9mvzgX3tZQ0GGNLluZvBzysysJyFLQlCH78cYUue265CvcuNzzCXgttQ9xPTDdDdasn2w/4+pfCSDH+afg+7dBcBV5M9atXzSCPPR5aje8Y1LT6gf3ZE+YgS3sr3P2QxW3yDTHNKI/YnNNpeTgG4kZBa5xhW2WEsIa99TZ5d2dT+POw71EDvw9oYepgWTmUn1XCdt+UjavJsugU0hpg/suLTfUKiCtttcVYoEA++2Q== Received: from MW4P222CA0023.NAMP222.PROD.OUTLOOK.COM (2603:10b6:303:114::28) by CH2PR12MB4214.namprd12.prod.outlook.com (2603:10b6:610:aa::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.36; Sun, 8 Oct 2023 03:11:28 +0000 Received: from CO1PEPF000044EE.namprd05.prod.outlook.com (2603:10b6:303:114:cafe::80) by MW4P222CA0023.outlook.office365.com (2603:10b6:303:114::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.36 via Frontend Transport; Sun, 8 Oct 2023 03:11:28 +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 CO1PEPF000044EE.mail.protection.outlook.com (10.167.241.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; Sun, 8 Oct 2023 03:11:28 +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.41; Sat, 7 Oct 2023 20:11:16 -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.41; Sat, 7 Oct 2023 20:11:13 -0700 From: Haifei Luo To: CC: , , , , , Dariusz Sosnowski , Suanming Mou , Matan Azrad Subject: [PATCH v4 3/5] net/mlx5: enhance the validation for item VXLAN-GPE Date: Sun, 8 Oct 2023 06:10:27 +0300 Message-ID: <20231008031029.30850-4-haifeil@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20231008031029.30850-1-haifeil@nvidia.com> References: <20230925080746.16438-1-haifeil@nvidia.com> <20231008031029.30850-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: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PEPF000044EE:EE_|CH2PR12MB4214:EE_ X-MS-Office365-Filtering-Correlation-Id: f8333948-a056-467e-4744-08dbc7ac4381 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: RVCql3FpEhTnK8/FzIXCIWD1BVQhGLIkJg4Tio/lwnzvtsI9phvKeucNAi1+GzR4trA/6Cm9LoseC15Qd5rdVB9LmpSfQIahoDoDQW6YckZ/vxFwuSEmEcAs7UwW97Ketr0vOAVlJLTzYidlmz8dT7P16h756IlRSYPtlnoyjveo1ankh/Y6EKpFx6OQuLmGxPXrQ3Pz0c5eZV553Rl91hEgdI4qPNzP0j8WhC8e7KPQFwm7oY0zjoMVCXEHSiuwRIGlcIpQETx5AdYzo+LbS2cp9x4D563EVzLsA301TY2EHap8jjWRmqZHErbcjq4VjEfZpZ1o+waWHgQpMccWTlUesW3WagM5Rs88DJWIzce+M1MQP2KcMeZv2vCfctXEGK/3ah8kiivusTf0o4IhWW1tw6vgdl1IbMwmUNvQs69KQRcpj5n+WLwdhg1n5vaXVbvLdhWKJjzZELjZ3TAfSJ7PsrQpl7fL5wUU9Va0bTlAK9/2KyMqaqHV6Dhbpi3SJfrZ9zUsI59R8X896SRTVQ93aSSVwFpUW/+0UvC2scfNT5ekSlyUQtxDQA0eoEBSAXXVyQH0byoH+sTnd/OuMNNeC3mIiUicJlxIWyOcbE80SHeHE1LJSyWLWT3ZnWD43BTbq4th2+HFmQ2HiNi5U/z/BXwHOKKrIiytStLrs05DYuKi+4Uz4Kr0eJAcM+nTOJBSQgKQ3YUt69TzZauyk476D6BNeRvUurgBHwWYAFZdpIjwHf2SQNdhyxiWXB5r 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:(13230031)(4636009)(39860400002)(136003)(396003)(346002)(376002)(230922051799003)(186009)(82310400011)(451199024)(1800799009)(64100799003)(46966006)(36840700001)(40470700004)(2906002)(40460700003)(16526019)(426003)(336012)(6286002)(26005)(2616005)(86362001)(107886003)(1076003)(6666004)(36756003)(7696005)(478600001)(36860700001)(47076005)(83380400001)(82740400003)(356005)(7636003)(55016003)(40480700001)(54906003)(70586007)(70206006)(6916009)(316002)(4326008)(41300700001)(5660300002)(8936002)(8676002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Oct 2023 03:11:28.2499 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f8333948-a056-467e-4744-08dbc7ac4381 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: CO1PEPF000044EE.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4214 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