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 D018FA034C; Wed, 21 Dec 2022 08:40:27 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 89BE742D2E; Wed, 21 Dec 2022 08:40:07 +0100 (CET) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2070.outbound.protection.outlook.com [40.107.220.70]) by mails.dpdk.org (Postfix) with ESMTP id 416E540684 for ; Wed, 21 Dec 2022 08:40:06 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IT95tILhVxJq/AhfYaysXB3ldNgw3BLeclhuUsHYle5L8AwPvJaXVHQfYL75ogJqLKLZUwaCaLHIOCEVQDvwVAfvLQhC+uQBhpJ1RrrAR1Fv1wAlMQ69OcKXycgx5ECaB4A573k5TSqnPsWJV1eoCzZYqPa3pZORN5aMPDXh4/380Z6uOPHva69YXTczkZM/HSOxNECj+J859gx+fHexW8XKm4amCjmelsc2L8TCdDzoiXzKykc5vyX48dpIA3xZlqiONPDIF/Z5c4nnp2LwALDDlhV7gd12kbxjgGfR4pJ+TmEkKpLdaAAglqJ9nVl4afpny0giQFpSNhNtBV6tXw== 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=rYsKWPVIg0uDRdZBRltxYOkyVeSCsDRHoF1tQjC1oTg=; b=dKWPCTWLTnRYhlgi5p6w191sQnrhiaIeyh9jmHDY+VApAtwcSfK3TI9KK5apSlrvL9CjfXtOfoWtMRIi32uKMcnN20quysp50gKVq82Yom+weP07xP+WR5DApsrcUQoVk22nXGK+LvGu+iJ8VmpYOIKLAGXOoo8xiJmyaujfFjJQot7EP+7ScmDa6Lyu5A38eU40HY+kFLtm1UrPHMxQemt7ngPCI+v/skWyI/C5h5yAfJzfOoCnNJGabTrBrSIaNNZBLMq3vsyp5PwgtmOE8ejXxWZ4hjUhvRYsQsvaQ6X48Il0Y1k8Tv3Mn680wwEprQIJnPe8b2ira6YYr+kXBQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=monjalon.net 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=rYsKWPVIg0uDRdZBRltxYOkyVeSCsDRHoF1tQjC1oTg=; b=fIoRcigvWhg4cTMQ/rMP0/eFDljRMq4RV3TYcMVaU+QKvVoWEyflzdIqRHzgKPt50nZeaL6HJ7EYoDCxlIRwjmUjc1gRJW4Ds/NdduC5L0kzC2lNvK9BTJWTLfRVXopuJXYzVnC84VfvgHwHKF2bCNmOATA+cOZ7PiyPjmE66nhFGc4W2Cif1gbdkyRmuhx73tqcD8/kXVuG5Aj5j1iDIkrDvczE3aL209SPGGWfJnOyLf4GG9wWVrEXB9qOKTaSRm8iZhhx4nX3DJzp3TE/C0Lsd2r8ZxfjrVStpJPx+eXMgF63nfRtkr8h2CrqQEJ1c43Orpt/2+mh5pL7aT30HA== Received: from BN9PR03CA0710.namprd03.prod.outlook.com (2603:10b6:408:ef::25) by BL0PR12MB4881.namprd12.prod.outlook.com (2603:10b6:208:1c7::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5924.16; Wed, 21 Dec 2022 07:40:03 +0000 Received: from BN8NAM11FT048.eop-nam11.prod.protection.outlook.com (2603:10b6:408:ef:cafe::2e) by BN9PR03CA0710.outlook.office365.com (2603:10b6:408:ef::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5924.21 via Frontend Transport; Wed, 21 Dec 2022 07:40:03 +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 BN8NAM11FT048.mail.protection.outlook.com (10.13.177.117) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5944.6 via Frontend Transport; Wed, 21 Dec 2022 07:40:02 +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.36; Tue, 20 Dec 2022 23:39:47 -0800 Received: from nvidia.com (10.126.231.37) 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.36; Tue, 20 Dec 2022 23:39:45 -0800 From: Rongwei Liu To: , , , CC: , Subject: [RFC 5/9] net/mlx5: add IPv6 protocol as flex item input Date: Wed, 21 Dec 2022 09:39:14 +0200 Message-ID: <20221221073918.3581151-6-rongweil@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20221221073918.3581151-1-rongweil@nvidia.com> References: <20221221073918.3581151-1-rongweil@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.231.37] X-ClientProxiedBy: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT048:EE_|BL0PR12MB4881:EE_ X-MS-Office365-Filtering-Correlation-Id: cce44479-ab6a-4ef7-f631-08dae3269269 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: 6ZCOLAOEh0yBTKGUwYuTr06rbx+6GNyCecEXaaoVIG7iSKK9MM1iK6Mg1NKg2D43jeVH9G6/X+Tm5tj4wgrKiynUpqwNi1pmaiOH6QP0ayjafu0zXDMzCD1617q+5KSGEl9V4+wrST7/g55E9e1PTyorY+R4w2UXOvoZ5wvdh5fHuJDu8pWKIdi9jGO0TC+tgoz31OskOytM+NjilvH9a61rYU8NilVpPSKI1SpozlZqRfKsXNCjzrZxm+1zI2b2uqJOtaM1DONqgWkSzwiFCOzhoW1VPnBUGo/dLomMJ05f0UuviW+DGdo3HHDtCvY1CIw6Lo7YAlwioC6b+HWU0uXckof4POJG6Yx4ybDTXA5PsRKU1KbfUu7A7qseIw9V8yRHb4r1P8hAKX/w01bvqZ6KwLkHB75jX8vPM/TlAYQ28v+L/vGP1wAjQPWNg3O57/ejrD7nzBJ00Go/qyWM5l7gdiQDEAHYsBcPK0PurmKLe6Ic5SYhawq0X5qkGCrsp0vNEmHo4XPOyjr7aAz0/ILShBN1e5GryPXZZpZjRf8q/DDwxdJ2yZBPDhEiNba6TN2MNYOXZuL22FffqfhlF1cCVorhSvtYV8b1yTbeygsfn4yIG3ltOyjwmDNvlim1GWCaXymZ17FMPHT2yVvDezuI3XZ8RrUZeLSYSGex1Yc= 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:(13230022)(4636009)(376002)(346002)(136003)(39860400002)(396003)(451199015)(46966006)(36840700001)(36756003)(110136005)(54906003)(316002)(82310400005)(55016003)(2906002)(336012)(36860700001)(16526019)(426003)(2616005)(86362001)(478600001)(1076003)(82740400003)(356005)(6666004)(47076005)(26005)(107886003)(7696005)(6286002)(7636003)(186003)(40480700001)(8676002)(5660300002)(41300700001)(4326008)(70586007)(8936002)(70206006); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Dec 2022 07:40:02.9151 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cce44479-ab6a-4ef7-f631-08dae3269269 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: BN8NAM11FT048.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR12MB4881 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 Support IPv6 protocol as new flex item input link. Signed-off-by: Rongwei Liu --- drivers/net/mlx5/mlx5_flow_flex.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/drivers/net/mlx5/mlx5_flow_flex.c b/drivers/net/mlx5/mlx5_flow_flex.c index fb08910ddb..bec07b13c1 100644 --- a/drivers/net/mlx5/mlx5_flow_flex.c +++ b/drivers/net/mlx5/mlx5_flow_flex.c @@ -1043,6 +1043,22 @@ mlx5_flex_arc_in_udp(const struct rte_flow_item *item, return rte_be_to_cpu_16(spec->hdr.dst_port); } +static int +mlx5_flex_arc_in_ipv6(const struct rte_flow_item *item, + struct rte_flow_error *error) +{ + const struct rte_flow_item_ipv6 *spec = item->spec; + const struct rte_flow_item_ipv6 *mask = item->mask; + struct rte_flow_item_ipv6 ip = { .hdr.proto = 0xff }; + + if (memcmp(mask, &ip, sizeof(struct rte_flow_item_ipv6))) { + return rte_flow_error_set + (error, EINVAL, RTE_FLOW_ERROR_TYPE_ITEM, item, + "invalid ipv6 item mask, full mask is desired"); + } + return spec->hdr.proto; +} + static int mlx5_flex_translate_arc_in(struct mlx5_hca_flex_attr *attr, const struct rte_flow_item_flex_conf *conf, @@ -1089,6 +1105,9 @@ mlx5_flex_translate_arc_in(struct mlx5_hca_flex_attr *attr, case RTE_FLOW_ITEM_TYPE_UDP: ret = mlx5_flex_arc_in_udp(rte_item, error); break; + case RTE_FLOW_ITEM_TYPE_IPV6: + ret = mlx5_flex_arc_in_ipv6(rte_item, error); + break; default: MLX5_ASSERT(false); return rte_flow_error_set -- 2.27.0