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 8F53FA034C; Wed, 21 Dec 2022 09:41:04 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8F1EF42D2B; Wed, 21 Dec 2022 09:40:48 +0100 (CET) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2057.outbound.protection.outlook.com [40.107.92.57]) by mails.dpdk.org (Postfix) with ESMTP id 186EF42D15 for ; Wed, 21 Dec 2022 09:40:45 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=e8RrntRCavD4baSae1k3+BaDHD+jQp5MZ0GczinSLqZAHrX1f5t57URR4uzobG9afTVdiGfeOXK+t3pcx9muGoZAEsrmYrWTjktJcq6pgALcGms6LlUOBb9mDlruzITQhYFp8f0RujI5w7gzO6W5xmJGlduOQfct6Zhv5S59NOCzxAIoFVrDPAY8rOI7/9W6oRSAqD+2Q1dhqCwXZyZGZxj1/TYXccphGx+Sgkxzwm4iT9Ls/BX0dW7/xBB2U328vUEmvHXDH2OtQg4wHg1JzG0PsRib0WF8T2F7syiVwHQWS0/rlFywuQr8YPkHiDMF2CY3M9UvnoIyrayp6/bA3g== 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=RMjYvKmKlFJNnoAiLCjx04DVezg7CjjAAy6yZ/O+KXwXuQcHV3faiJLskdOBE/e/PG1bkJNGbiRGo7NXGy0tzhPqfQY8zIZA79AuDkoYGwvhLDRnz7n3IoYF11NCjHruTjOvCdWLPe5U9NtwhCQm+sWKB83ibB4BvA6q6pdNxRgF2+hv0lrCeUN+if6oh2e4tZSQAXChSdcaoslXXn6vY95gNL9w9GawVfkf6JQQY0W1ERdAET/JWwJGdRqhPEQ3GNMJ0ts3WHvaHnJnzkXM5llUPMd9sAcAK+RIw4UyGgdORXN+7lt2nTqNzSdJr+oge/xLrq2YSVeeOFuqZ4JcBw== 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=H7PfzVM6YjvVEhhvUcUytx8EQcUPwmv5N7ydvO1S1PvANuhFGJHiXFnY7SAYS/Kr/auOMj82y+W5wwy29/1JmHxXOSEAMmLlK8TU+/aLq5naEA8HKkZd7MO8vhSpMmT+92DubywlCZBgeVNbstnkQIFQDCvzphQvItwG3/PJ3UAoO/+O/jBSXo6ZrocD0LLIKtZgas+EABFMLrkNxJoHQHUwmuN6vGfEihfoF7W3jKT4OqaWa1ATb4gVXAmvwDQC7gI0uLuzMA7DJF67zek+IlY847z7emx2KvSm28CsYBwnME+MzoeRXOZZpykpAZaXO1V6LA3pmY7v5hcLDr3cwA== Received: from BN8PR04CA0041.namprd04.prod.outlook.com (2603:10b6:408:d4::15) by SJ1PR12MB6100.namprd12.prod.outlook.com (2603:10b6:a03:45d::20) 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 08:40:43 +0000 Received: from BL02EPF00010208.namprd05.prod.outlook.com (2603:10b6:408:d4:cafe::aa) by BN8PR04CA0041.outlook.office365.com (2603:10b6:408:d4::15) 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 08:40:43 +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 BL02EPF00010208.mail.protection.outlook.com (10.167.241.199) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5944.8 via Frontend Transport; Wed, 21 Dec 2022 08:40:42 +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; Wed, 21 Dec 2022 00:40:30 -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; Wed, 21 Dec 2022 00:40:27 -0800 From: Rongwei Liu To: , , , CC: , Subject: [RFC 5/9] net/mlx5: add IPv6 protocol as flex item input Date: Wed, 21 Dec 2022 10:39:56 +0200 Message-ID: <20221221084000.3680015-6-rongweil@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20221221084000.3680015-1-rongweil@nvidia.com> References: <20221221084000.3680015-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: BL02EPF00010208:EE_|SJ1PR12MB6100:EE_ X-MS-Office365-Filtering-Correlation-Id: 88b24150-f89b-42aa-16e4-08dae32f0c02 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: OnZcPEXOi9h4I8v/1iZOxYWbcTG2tEr8mxKBsF0/U8pEEXKc/AdACUwAdCmwJdQeAvW16pMb48ZqOQsuUq+NYAY5RqJdp0HUTKePClIhx9FDQ4pxC7JTZnpKfN9MBvKIuOaBPVz6vJEhn+vYenDzvSZAdpyD37g2h1j6LaCkok6ADq4y0SfzLiDwfZZkX3oDlAZHokUlfRy4LDCVULy2h2HNpMZxkUe18xvy6AIzdkL9lxKsqZnUss/aUZOuP4X+Ej1XZ7AhOBwvno/80PP6q55lTvSoLQyAf3adWpNRWrcFMtdxwpb3B1BewGwrHIifXjuN8ECL+Da+Uh/iez55+ip/JXRVxqZUt6JCka7X4yCmWmGUeBKr6pSjmFtVokvO+Uv4vHrkhKkKT/Dt59C3Xplg/zJrLD1tern76AsQ68jLtk68VJ9JMzS1Ll5caZmrwps5EJkhcgQYDbVTVg8O6a3U+YOUm7J6WraUynLjCXF/uPpVOzztLJbr8vOG9C5NZYevm0dYBfOMjTnGlXYqOZsaqIAIwUVFd1InM6QYs5JXZeKmdYC1JZ+1uDQyV7kXHUQgU8WfgiVYhiilrg/K3u9sNzrJErqeJdpz/44G9D11z0PYkCDpd+qsgGKoW9p1ZOAikh11xX8/NNQrfW8ztIh6pHKvqKzyIirRWV9+vi0lAjCXGxVeMacWPzx4tRtuArT+nIP+UvP2XF+cXFvDIQ== 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)(136003)(346002)(39860400002)(396003)(451199015)(36840700001)(40470700004)(46966006)(41300700001)(40480700001)(8936002)(4326008)(8676002)(5660300002)(70206006)(54906003)(70586007)(55016003)(7636003)(86362001)(356005)(316002)(110136005)(2906002)(426003)(47076005)(1076003)(336012)(2616005)(82740400003)(7696005)(16526019)(82310400005)(40460700003)(186003)(6286002)(107886003)(6666004)(36860700001)(36756003)(478600001)(26005); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Dec 2022 08:40:42.8746 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 88b24150-f89b-42aa-16e4-08dae32f0c02 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: BL02EPF00010208.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ1PR12MB6100 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