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 9568241B81; Mon, 30 Jan 2023 14:21:09 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5B6E742D3A; Mon, 30 Jan 2023 14:20:48 +0100 (CET) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2044.outbound.protection.outlook.com [40.107.92.44]) by mails.dpdk.org (Postfix) with ESMTP id 1F7CE42D2C for ; Mon, 30 Jan 2023 14:20:45 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Rw1zXmmMTOBHOO0jAeD0hAfEF351EWCDvbj66FZoXP/2Y7Tn8JmSseyN8YsJVfJWioL7s1aLwtUuu4kRVoW/DdaYSWGfU2a7Ndmtr8KI//6QUaxWNGaETqsE5I2JH4X+C3YdS4HGV+zDSxAhx7G0Rl2ALOWXY/P3vWpso/ywpcRqIOsh0YKk6sP8GD6lGlNuqaLFBsbVRoW3s3LzDRHuw1qK43r534xIKCF81yqHYgpeKEaA5N1XV8+KDyE8mN56kR6VTGI63U62s+PcgL399gomlNHYeTtq/uAKnbrlh6b/ety7onn1hUJNnyAr8wrk2PVZ5Lf/gRZwa4gr/Tr5aw== 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=I0/k2CaAk1ms3u64m2vQMfnTPcmafinfocIV9iX2hb7PZO5RntUvsvUWKo3LLkzWI7h1NbawqDFihjKJF1LyZdNwJa0PGAKRKNXNaCEipu2QVU8rT7/mAQ/kLrqSx3cxo1GpcOOEgQqiEG2uWwy4rYPeDjakBHMAVo1n/64VtFEZCQ2pIVIGcEJcf6JUjluUPaqVOCrRxE9KF2WMTC5aesKx4annC8pb9wCKkSE4ywJZ5CljC+E92KbNdzEhx4n2Kf0ZAP8u9LGrTcDVUaHM9uGeLavlqD5tP8wSh381jipLzGRGBnP4h/d4No2VE5NhM9P8f4rmfc/CmiEwK4Fmsg== 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=ZXu183HXTg5eqdV8ZePNE4vbtpmWgWYyCntQdgflV3u6cikVtfDc4UGYwJxznZQna6ZZeeR8RlPgt3BOtB5qB/WUk2JVSAskfr1Fa/u9rNcZoyY4Uvo/1Fd4cXxk+gJ9hcDqErWrXrDtl9BLaWCNOenZSB2/RQtiqRI7Elx9nenUsDl2gO/Rq0pB0LCSSzNUWN2o+5BLJyll5Pn8HT8e/wErgP8Nz6cky/7COjng/lwX/bdVlYvATUzeLF8KqyrQOeO0u04bue3piMug1yuO2MR3S4Dqjdckm7pprTdITp4aq9ZApo39BFZ9hwqMt97sPIRMZmdUYBEiHBOM9jcoxA== Received: from DM6PR02CA0044.namprd02.prod.outlook.com (2603:10b6:5:177::21) by PH7PR12MB7379.namprd12.prod.outlook.com (2603:10b6:510:20e::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.33; Mon, 30 Jan 2023 13:20:41 +0000 Received: from DM6NAM11FT049.eop-nam11.prod.protection.outlook.com (2603:10b6:5:177:cafe::6e) by DM6PR02CA0044.outlook.office365.com (2603:10b6:5:177::21) 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 13:20:41 +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 DM6NAM11FT049.mail.protection.outlook.com (10.13.172.188) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.22 via Frontend Transport; Mon, 30 Jan 2023 13:20:41 +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; Mon, 30 Jan 2023 05:20:26 -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; Mon, 30 Jan 2023 05:20:24 -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 15:19:53 +0200 Message-ID: <20230130132000.1715473-5-rongweil@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20230130132000.1715473-1-rongweil@nvidia.com> References: <3ba49f25-52d0-fe07-02e6-22a71e0fbe13@oktetlabs.ru> <20230130132000.1715473-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: 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: DM6NAM11FT049:EE_|PH7PR12MB7379:EE_ X-MS-Office365-Filtering-Correlation-Id: d340d4a5-cd3c-4acf-547c-08db02c4c939 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: uPD9JlZCK1+Ru+9P8M9u4o1ho9DWEJKrVnlEjHCwzxbT3Fn95p0FlhWS03sFidxT4rRwF1OAnc/MMDn3P48ZHTA8aj+zyuE1i0pKLsTqM3bgv0oobppwFMp0WBIR/GmGHUsAiwW1Ntr+reGiu71ratDVyTmj88sZlJspnFez3oHk+pYr/bIiEEhVHx0G9OchsZxlQWJ/Jq6VBOOxRxKnrd/BQmAx2VYOiHaeyO9lVyZUugPFUY/IihVXAZqSmoXg4oucm/cTuetpFy+BORrxAYkwObn0lNVX7pySEmzabA/rFGHiLa1Jw0XLrP+WzbzYvY7DjdltyJ0up+YCdTXr6eQ/RGgughJgUNiz+9RQoRlJpz6kLKeR2xzF3wk8K3xUpBgAS4cNlG/VWLEFOGDFneFbmFfJzmt1MUfc5cnyyeaOrydxJ77SJLKiGzbz+PF3Rmptl+KYqv9ivbUOmd1ScxboyXJTTO8I/MW8seypr6/Gu9MHBjvc8MqXP2UxALvrgyf/HVGX0L3kdtIvoGFaSjckNlOYa8G/o21+i8C0sy+t1jCBdMgLoITI3gnqx1R/g/p66mTFFNdfGQvHAog83fY7501696Uw654UgQOGQilgHLTrRMXo8LZCHuECGXpPFhaeXtHNY1wWXbAfwHW27Hxh81GqN9lfN+zKi67g2QWP2TOgyqT0i6ArAgM2BhNcdJMWvO7Vl6m2R7eGQvswCQ== 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)(376002)(346002)(136003)(396003)(39860400002)(451199018)(46966006)(40470700004)(36840700001)(186003)(478600001)(16526019)(26005)(8676002)(1076003)(107886003)(6666004)(7696005)(6286002)(4326008)(2616005)(70206006)(82740400003)(7636003)(336012)(70586007)(82310400005)(426003)(41300700001)(47076005)(8936002)(86362001)(36860700001)(40460700003)(36756003)(40480700001)(2906002)(5660300002)(110136005)(316002)(54906003)(356005)(55016003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jan 2023 13:20:41.4317 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d340d4a5-cd3c-4acf-547c-08db02c4c939 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: DM6NAM11FT049.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB7379 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