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 24D5841D50; Thu, 23 Feb 2023 13:49:33 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0A48B431FB; Thu, 23 Feb 2023 13:49:30 +0100 (CET) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2048.outbound.protection.outlook.com [40.107.237.48]) by mails.dpdk.org (Postfix) with ESMTP id 8469D431FB for ; Thu, 23 Feb 2023 13:49:28 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SFuPW9UirPX2fahUnwidmK/Th8AKIsgwUXfi/o1aOwOjl4/fK3Prsd/45rGmTxcVbjemjd2v3/3kq2lam2sgG1HWx65eMJwg7RTkQE3YwQOrPayQ4qFgillEray4lLHOnQCBzNArvyp9OE9GkqH6V15NS+9W8GNt2TRBk58RlIrNc3bVkD3BmkRvMml+fOOPID6lL/8vmztlu9nnHISmGutRd0hcZHifqFNgPtn0qpzvQmGypFnvEn3p0BwjBGdCtxOkGHNDPg2r1hvZIOIPfOv2GXm51bCdeW3gQdWWtG79bABr+Le6rTQqD7f/U6YCTnQcUGjiUtYYSS2TCi6AvQ== 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=N6xe7jg8Z1xqQkWQg8+Sk+rS9g1TCXNd6gRsjzlIthUmhb5Hp4G7029fMZWabjKqEjomDvGwsFP17xuAGVYwgobYm2VTmVIc+bK3oRFMSObu0QQGZZC1D5gOb5u4kutpR5AsKTU5SWSCy7VGRHGGTYKsi2DAn0Y6lbjM7JLqKakXuDJywKmP+GP2TQ6ebXTqilDQwDFc2mB6X8GpR4nNuhSvxWPoftSkCH1SobJvZIh5122R8PYEl62ZP+09D7Uccpkfqo9UdQ0YNzU4ky/iJoxL2sY1sVXHTEscDDWFOu4pITH7g1XzYcutEMcASXd2mncxhVhfjIj8jgHG5E0SHQ== 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=qq2uHiZXs3JWrxdaRJzWz0y6ODynezR6es4s8rFdqYtMbdSfPFqliL3ZhgGRPGUzIn8o2JXvXaJuiPkcxdugBRNFqLLNZDODjRPwuO/Z9UGtwlglSaqiXnPx+YmYyRA4PGtmjGWj46vr2aHA8ff/Dz+e7d59srC/ftyahlCjnwQPHiixsM8bPaefiOvqW/il6IRIAZNYfIm7s7gLEMJ8lYFWgg2xZq9S7aoWPz09ei3u7P36RvnpZ4SiWpQUWlT4MpryG1NPEPVtbULrvQvSwxcBQ1WU9FJT51n7/Nauq89Wi1B2eym6YHFpwSWlner0bIVS5gR6XF/708lnvczSTw== Received: from DM6PR03CA0049.namprd03.prod.outlook.com (2603:10b6:5:100::26) by PH0PR12MB7077.namprd12.prod.outlook.com (2603:10b6:510:21d::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.21; Thu, 23 Feb 2023 12:49:26 +0000 Received: from DM6NAM11FT008.eop-nam11.prod.protection.outlook.com (2603:10b6:5:100:cafe::87) by DM6PR03CA0049.outlook.office365.com (2603:10b6:5:100::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.19 via Frontend Transport; Thu, 23 Feb 2023 12:49:26 +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 DM6NAM11FT008.mail.protection.outlook.com (10.13.172.85) 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 12:49:26 +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; Thu, 23 Feb 2023 04:49:16 -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; Thu, 23 Feb 2023 04:49:14 -0800 From: Rongwei Liu To: , , , , CC: Subject: [PATCH v4 2/6] net/mlx5: add IPv6 protocol as flex item input Date: Thu, 23 Feb 2023 14:48:54 +0200 Message-ID: <20230223124858.1042097-3-rongweil@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20230223124858.1042097-1-rongweil@nvidia.com> References: <34229594.ATrlOLLGV9@thomas> <20230223124858.1042097-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: DM6NAM11FT008:EE_|PH0PR12MB7077:EE_ X-MS-Office365-Filtering-Correlation-Id: 4248dd14-0ff2-4256-82ef-08db159c6558 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: pM4nIcQ9jRzL62ctinKhKnDH5frO/YcLoX99j1m/hfm5G0+EIyn2UEewfhUFAy2TOWcb3X/2uj7GcQuommEcNgWGR680hw6CkSf2ggbye/TPYrYCa8Dhptn8Nl04PPyuNLUOBdOjT6K/kDhDqOnhAmZhawJ7wdb0Cwt/WaP8XeDxSAzukqA/RmcMbt1Gr9Wkh7jN4Rx53NRY6lYy640jY+uSHCFBpf8NgLQel2psj55OMoFKwuchjL6A2GFp9WKVPnuhtdrD9X3lxB6BoUEfqv0BcDvP6VOuNYnFtI0EAwDIbfEEgUU4DlMImGQPABNfk7GtJmQ+brsMVWzGSCN7oasEPrANTws+QDsWExRK4dTeEZBFKFFXUuMt1ctg4FvmH6ZzXn7+F/A1Dsp7NubGbAMkyozT5jepGlqv0gfHZTCAM3xZRih3A0RGkn+d0udZbtxptNGa3LkExu96RivrO6y2CBxWVShDhCV3/5pQXrpcUYgBG/6GiX5muL/thSd/vHZwhjdGVXmAY5O9hoYGbrB7PWNstVV2G9jvVzjuPJ097nMBbMxec02A+jJZjznDsOwOrVBCswF3uKXhCP/akHZtJgs5dwHEt/mSXJnNzjT/sNFq8VzGJx4DCUZjUNUr/snL541blG1Y2PD2SOkXtwRQBnJa8ReeTRBmb3X+b2yNznok+/DYa5sYgwtwZyKBU6Ckj27xatzK/I2zRPititPf6mlv89hvw6zaYaPV81s= 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)(136003)(39860400002)(346002)(376002)(396003)(451199018)(40470700004)(46966006)(36840700001)(40460700003)(6666004)(70586007)(70206006)(110136005)(316002)(8676002)(8936002)(34020700004)(5660300002)(4326008)(41300700001)(1076003)(107886003)(2616005)(16526019)(6286002)(426003)(186003)(47076005)(26005)(478600001)(7696005)(336012)(356005)(40480700001)(36756003)(82310400005)(55016003)(86362001)(82740400003)(36860700001)(2906002)(7636003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Feb 2023 12:49:26.1031 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4248dd14-0ff2-4256-82ef-08db159c6558 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: DM6NAM11FT008.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR12MB7077 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