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 B395F42403; Thu, 19 Jan 2023 05:59:57 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CDC2842D9A; Thu, 19 Jan 2023 05:59:20 +0100 (CET) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2067.outbound.protection.outlook.com [40.107.92.67]) by mails.dpdk.org (Postfix) with ESMTP id 9AE0742DA5 for ; Thu, 19 Jan 2023 05:59:19 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VsEZmneJoXIFq2Z4if4jcJz2NkuPdhVPGSLqPcWFMqY6LPuzdQrOw9LrUBCHfJhsvVgPD0QahpfRe7BTJGvvNi9C2KWRR9ReOSQubQiSYeCAKhSq6ErVkucppGmYnfqV3LuS5pAKlHJ2PloxakOeSiT+w86FSzLWEgxcFX5DYlxxAYWIusyAvMQN9QvsEU1+iGngTTQWLF/VKNoBJGblzSrcD7kRsNXful8b+P/DVAfG96JHUt+0XeMt+q1CyLUlmHVh2yNyDBYURu9F9N2LppLrba1pQ7F8DCB6xrGBUxPLo1AJM802CwczSYguIVAvpJmQM3vbNGO5ac79daxs4A== 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=MzlbwDEEjlqHEomjOJVASNlpiXJFBsWLFklTKLxusCTxfDhLLUg8Ta9OGIyzhQolEB6sHRoNsFwav2Jc90WG8r/SQxchnrUVT37rwuLO9eBfxMAXWB+OcIYIbRTaKB3yyk5jqYFz7q0q3ceZhVyiCtGga6osB2G4NRu8HDClECIV+rsNQ6mwY+DZXIdcVVtzm9o8fGCOUUj1+ovNK9EMn2dWn9q4jAqMxx/t7vn5ctywv80mg/REuCu3TrKVjXKgu9lgeoTTCcnbUVTmEPvk35daJP8TlFEb3Xjh9Z1KnQW+Wko/yK1PUrr7rYZE2SqHqdOm15upZ/07640Q6dP2nQ== 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=7/IeM5CqgMtCYyadWn86pLPijtsuLy0Evfp4ysHPU+8=; b=X9s9KJ1AG9I7ZH/I3FzgGn83A457I7oicrQq467CW/7trVFaGH26SdwFeWohPF/Xx1b7W2/sjVkCg/17uMCfQeNxrEl0T+SUuJD031OfCwSgCXVzg6rxAa9fBsp92Lrou6Pu7fOgL4MaTOcPuU5bUiJGTBzNqV6ZJrgFWszydjqNx9yovHaMeNnorD9ea60cGN5gmmI3UxYfVFsLLOsB08fsgyDS0SsKQC5f9SYEVmGtonOZzVQAkuG02acljIKBppnmurEU1G0lJTwFME0nSwOnaY3XULlHJ8QY2rPvuszl0lp2GI0fQdXz/qNiuyBIMCHjD7vUk6TjpKT28jVL4g== Received: from MW4PR04CA0166.namprd04.prod.outlook.com (2603:10b6:303:85::21) by SJ1PR12MB6028.namprd12.prod.outlook.com (2603:10b6:a03:489::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.25; Thu, 19 Jan 2023 04:59:00 +0000 Received: from CO1NAM11FT070.eop-nam11.prod.protection.outlook.com (2603:10b6:303:85:cafe::96) by MW4PR04CA0166.outlook.office365.com (2603:10b6:303:85::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.26 via Frontend Transport; Thu, 19 Jan 2023 04:58:59 +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 CO1NAM11FT070.mail.protection.outlook.com (10.13.175.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.13 via Frontend Transport; Thu, 19 Jan 2023 04:58:59 +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, 18 Jan 2023 20:58:49 -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, 18 Jan 2023 20:58:47 -0800 From: Rongwei Liu To: , , , CC: , Subject: [PATCH v2 04/11] net/mlx5: add IPv6 protocol as flex item input Date: Thu, 19 Jan 2023 06:58:17 +0200 Message-ID: <20230119045824.665663-5-rongweil@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20230119045824.665663-1-rongweil@nvidia.com> References: <20221221084000.3680015-2-rongweil@nvidia.com> <20230119045824.665663-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: CO1NAM11FT070:EE_|SJ1PR12MB6028:EE_ X-MS-Office365-Filtering-Correlation-Id: b6a046ba-b9fd-4b47-34bc-08daf9d9e052 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: otAyWNQccj2oSb8FIqcBTNBYeQH3eIHp/KYQ2pzPJIBBlejOqktOlKoOzSvtZi1JlrrjlKYv2tWsbc3AnhnRWyPma5GnUoqjBX2bKZoChG2KegyJRxJnWRj4HdFXQ5KX3BsxeR7tV/QPODmMhj1B3kP1+4hbVepVTr2WwHe0d1lAW3gxATe7AE4HcoSdSM5GC/y5fqA6HzzqkvEUC4lh6sOgg1WG/688E+07Tx8WADOKNVSkuu7g8/I1HM5i0TuXgIOkybuBdRxyLrBFenrtawgt+Py5/Iqw0hwqeM2I4UDVn2seZ5jyCZyOL+aESMFJU2Mupznb3F3R0NvmB77SjsUIMTqZxC34adZX7ktrrESgujqK7HLn63oLB7hn7CzeFqAO0C5GdNCZrPSSGafgrDSq2iP1Vk9bLPBudnM95YjTG27KAqu5ju3JfftxRPItHbeTUjMJ8eSSAzxhGFej3ATlOF/6yf2V08TgF5CLjsOEiC+fE/XrhXrhEuh6w4o5CW107fzHD+ZxAiv6tK/OEV01yP0JcWtb2XQE5gzJ094TMpdwMy6vDWvRGRKEBuWFis5UK8Ecvh4n+BRTABF0PhKyI3ogoUVBacjp8jZrRR4hKpKswiUBFtTytltXSiL+AUoxJrr0wa/ntWFb2u3Q8G6eUCLc2bP8vOQccGCRK4gIsYWAoWRl3h65ISjEFkFR0VNOfRpxEuwryejI17iXtA== 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)(396003)(346002)(39860400002)(451199015)(36840700001)(46966006)(40470700004)(8936002)(316002)(5660300002)(86362001)(107886003)(40460700003)(6666004)(36756003)(7696005)(478600001)(2906002)(82310400005)(2616005)(426003)(110136005)(54906003)(47076005)(336012)(55016003)(7636003)(1076003)(70206006)(70586007)(4326008)(8676002)(40480700001)(82740400003)(36860700001)(356005)(16526019)(186003)(6286002)(26005)(41300700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jan 2023 04:58:59.1956 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b6a046ba-b9fd-4b47-34bc-08daf9d9e052 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: CO1NAM11FT070.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ1PR12MB6028 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