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 923F5424B9; Mon, 30 Jan 2023 05:54:04 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 930AF42D35; Mon, 30 Jan 2023 05:53:53 +0100 (CET) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2047.outbound.protection.outlook.com [40.107.223.47]) by mails.dpdk.org (Postfix) with ESMTP id 57DC5427E9 for ; Mon, 30 Jan 2023 05:53:50 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Yf7sIznfc418WK7B6N3i8HSmCw413F1x1mb9SGOGvW8XBANH/cPyrJiQVovZJuXkFNgGTld5T8Ut54FCip1sGQd9hOZlqkNgGpupG9RaqBoOJdi9njZgsNtE9OQMxHu2z6bRcDcBpEgAW97rT1KwBwYk7BCOCwMNUp47OKCPf7YQnAFvGIxSvhhdebaNKmU/snQyp1rUoLbxd3OJx0jY7dw4eLi8ZebvKwtr4+xO1CKkHF03hr98qlVCFiCoy5xsmsQFQRCaBO7sRTePZ+z3vpIIDz5RkCazze937gGzjX1DjplLjHmpH9Duc4HzR3uh0WZPcnAwAjE/9Onrp2lYog== 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=7/IeM5CqgMtCYyadWn86pLPijtsuLy0Evfp4ysHPU+8=; b=NOwNOm3NlMy0iAo9AxuEYnbNzErljO3GOgR652Fq6BBkiY30oPd3isnQP5R7lfM61rGRsgqGPzcwVWjVG555M9pwewnZ0bqZgIgCM8gKf5syeHjTKuTWUCuQILZoINdQeCpBVxEG6wM5Bg3E/63f9bpz2quLmWv56N2ONf77y4qktcZjcea/TwUMqzQqoh9LpkUw9k1UwSiPeqdvlqqsAujRpZHBbcEkePO35KRAH8CRKvvAP03PShcSyrpxbWjdxuwm/RYbYZxmGmWSsU09LE1m3cgQcV0JsJkO6ts0ZH4nOe+egzAR6Chp/CohNk2qVn9tcylSKxIbo3t54sbfpw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) 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=7/IeM5CqgMtCYyadWn86pLPijtsuLy0Evfp4ysHPU+8=; b=aHACn8kBOR2VHHTkUDoPQ8wipM9w0+p+Re0JszTgD5nSGYpRy8qd/x2rfGKg8edOaXIkfXBsh7rA5sdz8ZCJxvmDq9zZSX4RR7iNVMPaYSk+7RW68kxCIggJkO5rGKkRbpiNjBESNMI1SJ79Kr8HxIT0M5nT75Q3dQYnHNnvZ29lk2SCb11kY3OgtvmzOwpaiiHT6qqUalP7cbf/bnlr7gXATXoTLbxUIszucoi/5049Mrb6YHn5G6lPFbfOV4w4xHWZHV2SWdTptMZbCJtF0JY8YTBEoaItp2jxsGLIkJeLwTl/V1ctnIGFwXl/Fcj5Y6VBO1LGE1xj4DX+NatS2w== Received: from MW4P222CA0019.NAMP222.PROD.OUTLOOK.COM (2603:10b6:303:114::24) by DS0PR12MB6392.namprd12.prod.outlook.com (2603:10b6:8:cc::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.22; Mon, 30 Jan 2023 04:53:48 +0000 Received: from CO1NAM11FT012.eop-nam11.prod.protection.outlook.com (2603:10b6:303:114:cafe::51) by MW4P222CA0019.outlook.office365.com (2603:10b6:303:114::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.36 via Frontend Transport; Mon, 30 Jan 2023 04:53:48 +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 CO1NAM11FT012.mail.protection.outlook.com (10.13.175.192) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.21 via Frontend Transport; Mon, 30 Jan 2023 04:53:48 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) 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.36; Sun, 29 Jan 2023 20:53:33 -0800 Received: from nvidia.com (10.126.230.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; Sun, 29 Jan 2023 20:53:31 -0800 From: Rongwei Liu To: , , , CC: , Subject: [PATCH v3 04/11] net/mlx5: add IPv6 protocol as flex item input Date: Mon, 30 Jan 2023 06:52:55 +0200 Message-ID: <20230130045302.1560006-5-rongweil@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20230130045302.1560006-1-rongweil@nvidia.com> References: <3ba49f25-52d0-fe07-02e6-22a71e0fbe13@oktetlabs.ru> <20230130045302.1560006-1-rongweil@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.230.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: CO1NAM11FT012:EE_|DS0PR12MB6392:EE_ X-MS-Office365-Filtering-Correlation-Id: f8ed0b03-f088-4f8f-dbd1-08db027df988 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: jSTZwL9m9HwzP3xTK5DJ0yEeOqlE6gCyQFgVImfyIJiLztqVEuK5K8V/k7D4s/Vb//5A/tfKiC9NVglSFNN14H4SrRDcrolvzjywtUxgwpWQqmJECpf4cUA31Deo/7vdjQTPPX95wKowPMsvUBjCUSFaIomqOVvnfbKtv146nvLrAk7BpxNA00gufy7lz8sHug7sRfoDDBpcn1SILDsc3jlt+DMllQL0CdfThm+rK28R/sgoflim0x3KAPgtU9BnANAf/Pyz9Gz7QoZykNUR79+DaD/29uHbYAxUR4THbLSJPychRYC2+bhMs1foxoXWbj7Z6VoCsbN2id2rVv4JsdFS7laYGltefXdeDvPVFDC21T8oEDfMryRBxuMorB8EmLP6CZCgoy1MHmFAGkELCWPTDH1wOAcYwLNMrFMcCxT+oXX3syBnTyNFJ26hxjuPflU9bN7mDSzXITX14EqUlyqS6dVcjOwIETHiTdSOlAR8AjEJv0Okb0e2HArwzsNhVsaPQS3uPbE0VEj4U9HbiOU6sszDxzUm7zL5/QXjPH3FW6z93dZ6u7KKKeFN9jUbZXOu1AWH2I5RDDXNtoyRLTxDrEj5NLu8ZJKKi0rkCaY/yFtcoAD+Jqa7MI+O4B8SJSEGDS34hcU3MmZrNb8IWUo/XqmbwKHlZ348TYRKhaXKCC9g7KSQwniLK8GsdLyYl4MsfDk/6BiYDkrDMoM4ww== 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:(13230025)(4636009)(136003)(396003)(346002)(39860400002)(376002)(451199018)(40470700004)(46966006)(36840700001)(47076005)(1076003)(8676002)(86362001)(40460700003)(7696005)(36756003)(82310400005)(186003)(40480700001)(356005)(36860700001)(26005)(7636003)(16526019)(8936002)(426003)(2616005)(6286002)(336012)(5660300002)(110136005)(478600001)(55016003)(107886003)(6666004)(316002)(54906003)(41300700001)(82740400003)(70206006)(70586007)(2906002)(4326008); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jan 2023 04:53:48.2158 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f8ed0b03-f088-4f8f-dbd1-08db027df988 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: CO1NAM11FT012.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB6392 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 Acked-by: Viacheslav Ovsiienko --- 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