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 0256441CA5; Wed, 15 Feb 2023 12:53:31 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7CE2B4302E; Wed, 15 Feb 2023 12:53:24 +0100 (CET) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2088.outbound.protection.outlook.com [40.107.93.88]) by mails.dpdk.org (Postfix) with ESMTP id 4A1374302E for ; Wed, 15 Feb 2023 12:53:22 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GgXCZYJldeQJXk5p0A+qpyPgQHmI0/rE0y+SzCzvB8USymGb+P9wC5PIeC+Iei5sk2Sa4Wge2PTxM8gmxNAgLU3+i1W6i/tZTz3UGET43OjHSdnF2YbaAI9teXHdTE1M1XtdJVnzQxf5eKktETi5NTecTXt5NWUdSWLWavX5tnvxP4AhVoOwO9gUExxVB0qdtFSFH+zo+k/DSjLWihMDQmYkH9kG2q0akblEIAeZAhYso4JasQHJTb5E7yEUfdyWGM1ScnrB1sS4H3myxZoSoCML9/33vGctB0cI64qrXyu2IhRmv9gPyMq4g0m7SYWXvjLeROxlS8z3TSWGKhCjKA== 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=f9LDM+Roui/0/79m8J8mGjT8H+7hOBj98hHgjqtvUnEK+poH9dmWsqfsj0GV++SkOlHwi/AMBVgLi1Yx3hbv3FT2ox+U80WZdVAQPFvMNEdv0vzHB6DA4zqs7qxcTgyxbmD4lFgGCUtMqGpDfzbuwvHTUJHX40qTcdqQskyADWj2LsBaEZm0sSrrHx1JlVXQus3QsxnuUn5ltFBPo/3aeHPQKwDeX9C1s+kCb9CnzN4t07IatGWz0MIF7Ba1CqRTouiYQftththGo0tlO6V5pYaLpRzXNa2Me0h1w2ELK07ChaKfv972ULcNx2CgNFW6T7HKnQIxEUKx+U1EZsjKYQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) 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=Zvr0rx4tlov99NZ5yyCgT+OjvZOgJMiBBI+6Dis5FOs7n847m1Da7TiEqtzI+3gszareZmBWcbCoLf60qypG147NOmLgD5DNftpccpW17UhEg49+DaQGWsjiRYGY/u0pF65UA5obWmcTaPz20GDBrdn0QxiyTbeI8U5/QiSNNgMMIWR4UlZDzyjWq86qBVoPFWu77qYvqu/TArvTDTJxJupNS7hgUP0P8QFrRyfxdV0YA1gUPKI0sgerSy0tj1fgcjIkscCGLkZNmm5EF/R7/zdCum6Id44kjtDHLy3iqtzfs5Fmpmh/H8WLtuJMhMGXvJrvF3J6Ju9S0su/63gffQ== Received: from DM5PR07CA0120.namprd07.prod.outlook.com (2603:10b6:4:ae::49) by CY8PR12MB7492.namprd12.prod.outlook.com (2603:10b6:930:93::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.22; Wed, 15 Feb 2023 11:53:20 +0000 Received: from DM6NAM11FT099.eop-nam11.prod.protection.outlook.com (2603:10b6:4:ae:cafe::8c) by DM5PR07CA0120.outlook.office365.com (2603:10b6:4:ae::49) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.26 via Frontend Transport; Wed, 15 Feb 2023 11:53:20 +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 DM6NAM11FT099.mail.protection.outlook.com (10.13.172.241) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6111.12 via Frontend Transport; Wed, 15 Feb 2023 11:53:20 +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; Wed, 15 Feb 2023 03:53:11 -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, 15 Feb 2023 03:53:09 -0800 From: Rongwei Liu To: , , , , CC: Subject: [PATCH v1 2/6] net/mlx5: add IPv6 protocol as flex item input Date: Wed, 15 Feb 2023 13:52:47 +0200 Message-ID: <20230215115251.3924578-3-rongweil@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20230215115251.3924578-1-rongweil@nvidia.com> References: <20230215115251.3924578-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: DM6NAM11FT099:EE_|CY8PR12MB7492:EE_ X-MS-Office365-Filtering-Correlation-Id: 823f7563-f01c-4324-b3e9-08db0f4b3bf3 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: szudm+V9BFQuErO3Tqvqecsu9SPSJY8oH6MLpEEQTNO02raph3L5FlTHJ96rpYDbKdCNlulw99FCIwFiap+79FSsMZm9Krp8zpKVbLXJsRPOXbL0F3BRuCJ1KUep58jjf/VSNgvseSuZ/CJF5q/V6oxbs4qyMdh1TI6P6/l8yR9IqbA3Q5DQUSGMocmZML472BaH5i01X/6BSBOXEtctfy4g69VqJ77RmsivVg4dgIf2pvu5vq09EYT/OrzEaYn1Wwn/UXmtnCcuQ8ztZpYj7S/++zdrg0g8ehYkKJ8rk3Ku90y+flG/WW0hPRKQU6yYCsK+A3IoL2O+fl3fJzVpowItPQPi25R1GoS2loB8GVqAcOMozkv/CRVjdQNIAGXFGnjCpR5dBWTXUgoPe2nK6AoMLLdJcy2Awv7Vsj5/5OSCL5jU+sYB/3cWmlAEOC/N7aKoofAanaHryItGiEf9LrUdrhOHUhuL6u+eirl3T4lZT+nmcl3pYRQFUPcID/raYyIXYJpcSNPIdClZRNa4zhNZM8QvnPcIfPzX1Ugwxh7tcclWq6b0ifr/sEWt0YrkEdtTGwr5Rk4XtXBCHuBQ2ygIuDaHgZG3mUUkK8y46Xm+yHfrWTCli7MksPmpmXujoa3RSKuAVk3TQ4QRaYchlhc4gzZYtwW4cggrxLhdkarUly4SLXi4X/KoaBDYyuiAANh9FzIe9sGE8wwrYdl8Nw== 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)(136003)(346002)(396003)(39860400002)(376002)(451199018)(36840700001)(46966006)(40470700004)(7636003)(82740400003)(7696005)(55016003)(82310400005)(107886003)(40480700001)(1076003)(47076005)(36756003)(40460700003)(336012)(26005)(426003)(478600001)(2616005)(6286002)(16526019)(6666004)(186003)(36860700001)(70206006)(8936002)(70586007)(86362001)(5660300002)(41300700001)(356005)(316002)(110136005)(8676002)(2906002)(4326008); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Feb 2023 11:53:20.4441 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 823f7563-f01c-4324-b3e9-08db0f4b3bf3 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: DM6NAM11FT099.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7492 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