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 16F5641D3B; Wed, 22 Feb 2023 10:37:56 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 63E0842DAA; Wed, 22 Feb 2023 10:37:50 +0100 (CET) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2056.outbound.protection.outlook.com [40.107.94.56]) by mails.dpdk.org (Postfix) with ESMTP id A660942DA4 for ; Wed, 22 Feb 2023 10:37:49 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Thboiiiq8V09LRx7NtRlQpLI0F4g/FmONcHEmcsIse+oChGNa5bk1sgP3x3onQ1YZ5E/wfzCmQ0dO3xD0R6+Zj/RGQXxZQtqDgpKoGWCkjarnrnFpqECVu6Sh+oKfaVULCxcCtLj6BTBemHO3bXBk4mQI5X0+CSvzeUUn8tKCQF5h+fBOHwwnEoZAvB9d0uigmB8I+L+gFz37qFrMAA+GX8RfNOmkwiRtw7bQ4BeQWbMAnccpdhV+bHLRk2E96+RxJYEnVyxY1ThMQW2eCUL+85pDyZLQWMbNygEijGEmjMfOQJXQbFHr0i9UjnrsOnu7R2VLcQ1cLvuFPb5ihP2PA== 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=WHpWxzSGNW9QAyFYLPyA4Dlzk9b3yO658EYp1b4HzTMk2hlcBNpfgAvq0Q4gfiyy8N3G/Pzy3IpBHUacNWY7m7tQomfe0x0HacQVriiJDGRO2JMaGBhE6B+my+s1/Fn5t8st/kMfqwd4A9H6Tofjr4ZJZzxxppSVk1ak7YJqercKGfri8+cGSnjKBR9Z09qOcO3uEc0SFr8hczeBg3eyUkF51SgRK3GqjuPL/iOmy+Mj241MDuJP9ewrHGbq+uYLkzGcNCB09Fnv9BpWzkqPcd4Z2E9B47O4ufTqu9ZKjMO4aaMzCfRIbRubokL1ex3KPkprcwBYgf69F25yc5jKXA== 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=bAsDcviVNpL8hTUzndPNRIE5R9JEVKYpK81YVUtOOSvTsXk9YTmFfuCiRXDIVG/7Uac/V3jZI+AG336XEIMfjO/qPsrWWvOHenEXdQyRZX8PzSj9fkd6/Czqaa45UqXygx4K9Rtd9h/v7wsZl0ZZuX1r3AmbE+zONJPL8ntt3s1IWQ98u8VOQ4XxhC1Nj4kLs0nQ9DIiDVuhASvGIw0V7jwEBw8f+AhR80fQY1wyujl+iAgOlx77XkGznFgz8kioqMiw/e8E9RmF+bdOZSmV8Kp9/8RfMcc60fSP0gm3LHXbXjRlLBff2zm+MhsIfgRqs0aRn4tKycaIWuMhmD5Udg== Received: from DS7P222CA0004.NAMP222.PROD.OUTLOOK.COM (2603:10b6:8:2e::14) by CH2PR12MB4133.namprd12.prod.outlook.com (2603:10b6:610:7a::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.19; Wed, 22 Feb 2023 09:37:47 +0000 Received: from DS1PEPF0000E633.namprd02.prod.outlook.com (2603:10b6:8:2e:cafe::2b) by DS7P222CA0004.outlook.office365.com (2603:10b6:8:2e::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6111.21 via Frontend Transport; Wed, 22 Feb 2023 09:37:47 +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 DS1PEPF0000E633.mail.protection.outlook.com (10.167.17.137) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.14 via Frontend Transport; Wed, 22 Feb 2023 09:37:47 +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 01:37:35 -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 01:37:33 -0800 From: Rongwei Liu To: , , , , CC: Subject: [PATCH v2 2/6] net/mlx5: add IPv6 protocol as flex item input Date: Wed, 22 Feb 2023 11:37:11 +0200 Message-ID: <20230222093715.740279-3-rongweil@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20230222093715.740279-1-rongweil@nvidia.com> References: <20230215115251.3924578-7-rongweil@nvidia.com> <20230222093715.740279-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: DS1PEPF0000E633:EE_|CH2PR12MB4133:EE_ X-MS-Office365-Filtering-Correlation-Id: 3f4fb1b7-3882-4e83-e205-08db14b87544 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: fRZPa5i+GTZkFR/pzPUYOu9PKL7AzIlWjWxveAQCDjiGB2KPyHet3YjuPOz3r2zc3NZmC/5AyYRPYzsxn0pXluX/YsrJw33csC5hBZIv+1E3jjjh8dVom5jFd06ybh8sT3MoAHL7vtqQQXP2OOSl6kdRUr8NcpIPyrbEyaSBVr7jR0NBDPG1q9HeU7oUW4rblgJzs7+QF90SMLjJLHtpDHK3ld/2+XB52YZVSQQmddsBomipkWQ3fx4gFsuQrvN3zkFDmdFhyzFI3RDHQWt7sxi4QJswTgtneSxFyczvcAKQG63m9fKZ+852zeH8Rmy67w7BscoUSgRMjASn2ieghrszRibR+QIPOHgJxwNQuRtVGqvSVD1NemiJ0Q3l4JH0eVX8kuX5bcLv8byF0QJvwJ/Pje8lCTYj1D5VWCAiqLAlhg5nFKQGRi5Lr7kWn/TlZxFLpWIV3P6AskxtNFkTqh+fSW2pG5lEpieSwYpxFsOopRFGqguP5r+LwxVrSsmKTuKbScHNLfHGhywu+DM86rOIitZXyjB2SPrN7Rq7bJgUs0qZti21tYtMdcAr/wKO0IQLhHJX47yr8df7oRMZwod9p73pnzbYXMx6eV28l2RG6aW8yrEW08R86qGuNLACr9K5v5/sceWk8VOrKxFjbrmuNK8fsPlNR8ROGTXCvPMWAFKmEOJNbIzaRm4nD4/TkSby844HwgOsDhKTfuFHQQ== 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)(46966006)(40470700004)(40460700003)(5660300002)(8936002)(107886003)(41300700001)(2906002)(426003)(336012)(47076005)(2616005)(110136005)(7696005)(316002)(478600001)(4326008)(26005)(70206006)(16526019)(186003)(1076003)(6666004)(6286002)(8676002)(70586007)(82740400003)(356005)(55016003)(86362001)(40480700001)(36756003)(82310400005)(36860700001)(7636003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Feb 2023 09:37:47.5637 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3f4fb1b7-3882-4e83-e205-08db14b87544 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: DS1PEPF0000E633.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4133 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