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 4B3E641D49; Thu, 23 Feb 2023 08:07:18 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BBA9643050; Thu, 23 Feb 2023 08:07:11 +0100 (CET) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2040.outbound.protection.outlook.com [40.107.236.40]) by mails.dpdk.org (Postfix) with ESMTP id 71D4A43004 for ; Thu, 23 Feb 2023 08:07:08 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=f79Pn2WC2tfArEoTTa6DrkabDP2ZYd0ve/OyIUM/PsE5PJkJAiPwXmlAnc0OGhQefr6sjTnLFvX7dXKNvVY+wu+5sDX8VBOAA69y1oMIl5BoDo2A0pWv7PXzMjLf6SpdAG7LIA60K1Zr8IdJmiYkrAax3Nl2gUTw1eBaTjR3uZRWjON/XdShalP+M7C1G5XWAtJapmWz+CCQN6XLOhQr7+Jy5aHFuf/rw4BiIYUS6h45azCMTmqPRO+cze0/3iKYKAcsxgRNhoyWH5rPcFLZqbfm2JHaQ9SImRaFqFG+4Ye6Dj0VGk0/BO8zYtrNpwO5XGJcWLbePfyRB3a9bGlXJQ== 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=Zp3vqGI3qVcCsPxn+zscWx8Gns2dOgYkyVLKY2jsXw8=; b=DkqQ3Lojtmb4T+SgNGDiNfSNmFQDX3dkiRLuTrWv0TVbBGDjJvhf04iTNLfzBdOr86qxJVSc2ubkOnX3JDC+3Htmc0bKU9SdB4g6jEenjOR/kGk1e+BHaUA9Qfab2ndeSSEJuTLQvApVaBFsw3KlA+Lbb3mgqzGewcaNUwBWCt1KplBepWMF3I+H/Vs4EqKWvVlQ7m+joAgtaM6WtI7cSsw7I5ns8GjAIx23WBRSL55vXg4zIo6olgPZ6D8pmsMyJxwTKlxEUrD8f7secNgNgH5ejx/QCD2pK/06tkzACuTAk2LQkbQeZsmhSIsWtIH/Bo426F2sxsRWsBwCOneTWw== 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=Zp3vqGI3qVcCsPxn+zscWx8Gns2dOgYkyVLKY2jsXw8=; b=rMlZQhfbgG+mj6qBJ4bwpAlQZJ66O9Mv8JZj09hJFFAyJGGE3cfDO1kAngCo4KoaL1Hm6vg2ajiefcn4Rf8IZ1thEeyD8TKY8krjdCZjk/Hyej7wUMDXT89KABbTtp9i4mEaxGTuTm81403un/KeozA3yCjuwM5McDhl1rAr/TkTj/VruGrxRsOn7J3rb/iE6vlTZXLmZWdkZO8aXWb0nINxGG689k0p5btbItsMksNd1zmpkA4QbdM+iaDUrMGmMOGT01/lfbgNgtfebSgsiNpevgAiWhOoSyIQAKO7WZ3tiF4jHfee2z+JX4Z//64vPpqDfrsG9ZgRntdxuk7b4A== Received: from BN0PR04CA0202.namprd04.prod.outlook.com (2603:10b6:408:e9::27) by CH2PR12MB4953.namprd12.prod.outlook.com (2603:10b6:610:36::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.19; Thu, 23 Feb 2023 07:07:06 +0000 Received: from BN8NAM11FT074.eop-nam11.prod.protection.outlook.com (2603:10b6:408:e9:cafe::a9) by BN0PR04CA0202.outlook.office365.com (2603:10b6:408:e9::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.21 via Frontend Transport; Thu, 23 Feb 2023 07:07:06 +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 BN8NAM11FT074.mail.protection.outlook.com (10.13.176.154) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.21 via Frontend Transport; Thu, 23 Feb 2023 07:07:06 +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, 22 Feb 2023 23:06:53 -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; Wed, 22 Feb 2023 23:06:51 -0800 From: Rongwei Liu To: , , , , CC: Subject: [PATCH v3 2/7] net/mlx5: add IPv6 protocol as flex item input Date: Thu, 23 Feb 2023 09:06:28 +0200 Message-ID: <20230223070633.946328-3-rongweil@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20230223070633.946328-1-rongweil@nvidia.com> References: <20230215115251.3924578-7-rongweil@nvidia.com> <20230223070633.946328-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: rnnvmail203.nvidia.com (10.129.68.9) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT074:EE_|CH2PR12MB4953:EE_ X-MS-Office365-Filtering-Correlation-Id: dc64e072-4cb4-4969-0e6a-08db156c92ab 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: vl/73O2IqNG2iDjLjkg6quhS66ovWdh3lItJ1aZ5t+vRuhVOs1bP2OFG+WaKcohuUG6GNd4/VDU/BMJAuniE3P+zGad+sGS5Xl6NeXTb6cAPhCeLTcOLJ818LVMxC2xkvbIM1XX8OlPnb8qtZ6lwiIvuwhKrv2YBuHsCoAuaF8KVkUud/aLYUVdMgKTVJtHuFNzAvCMoqGKjdTqvskShl3n+wAVZKngMOS4Qb/8t0to3e4lEw5PAuH0X/Mpjzvl7W6wQpnrM8ZxM/Zrdm1x9YAGvUVvQr20gKiVv0wJCRFpnXvWq0+3Q5SfXu14ENuWRImGv74MzE26cbmViIR71MkLi/+Gdupcbqh9fQSa6043Pvx1rgyr/RbSTteWEUokvoHJBL+1fPCREj+/n3r/maHYgo4V75dtgAC3VjaWDZqDrFxbHSmxHCXBRtURHVEyuSvf8L7te0gCtLKVTlAf4R+uQw2/abIsvvqPdht3dWuPuHobTThPUJlUKWAIcIsuJ1qbm8pht7kZtAlfAbuzPd4l8sIeEm09SBVp8Mk1SB0QqFWO8sVWYk5nJNanxc3OKRV6CX04Q23rv8llI9+pljRUE8LVusJQ1IDDV8NWtNO+btZOdwbgmZObrImfMgeUiuCEtxV72PxeicVe7R0c+UGJ6eyCR2LnDT0lAiJZ/KxYFBJyGyn7fGYhL3HZ1zf5OUk8lNNhYpMgj9G6oXu8KXGwBQ1k4NPGhHBRKSa/MxG8= 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:(13230025)(4636009)(396003)(346002)(39860400002)(376002)(136003)(451199018)(36840700001)(40470700004)(46966006)(316002)(110136005)(47076005)(478600001)(426003)(7636003)(36756003)(82740400003)(2906002)(82310400005)(86362001)(356005)(40460700003)(70206006)(70586007)(4326008)(8676002)(55016003)(8936002)(41300700001)(40480700001)(5660300002)(34020700004)(36860700001)(2616005)(26005)(7696005)(186003)(1076003)(6666004)(107886003)(16526019)(336012)(6286002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Feb 2023 07:07:06.2361 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: dc64e072-4cb4-4969-0e6a-08db156c92ab 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: BN8NAM11FT074.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4953 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 35f2a9923d..24b7226ee6 100644 --- a/drivers/net/mlx5/mlx5_flow_flex.c +++ b/drivers/net/mlx5/mlx5_flow_flex.c @@ -1050,6 +1050,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, @@ -1096,6 +1112,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