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 80771A0032 for ; Sun, 14 Nov 2021 16:36:42 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F2252410DC; Sun, 14 Nov 2021 16:36:41 +0100 (CET) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1anam02on2074.outbound.protection.outlook.com [40.107.96.74]) by mails.dpdk.org (Postfix) with ESMTP id D053B410DC; Sun, 14 Nov 2021 16:36:40 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=N1YRPzBxpkVR2LQQ5u8QYsdwLMXKWxCN6xAx6JBtvNcwOVPPnN9ibHGJIvOwrF09YyJWhDcXn42gjbUHQKZSIf/nmsrM69EAwAQwU0IgnU3KIeS4SQptxKzCMMRZ07X6Z7UkWdtUa1f70s6UgA5qmbnguqcLLEV9ZXeVlHQ0+7KuSDGsZiKtcBcuQVODR3Q3ZNsfYqRswVOwg7M6+g26wnDf9UU4CV6ums/uifENcERnJcTNcjgfLFHzqaTn4SFVAo1jhe8pKvZSWJlwYrWJ6znfl9n3KQyc233EOD6QiV29gruUz7MEQ5yBkrs960IaYyXu4ZepZvuMslyzJ3ishg== 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=feJip2VdmeDGJNBogWxW/wsLaY2E8RQk3uf07k6tk/U=; b=haJWMrQj4hcZ/OgtgyUrLzUxbo3UEMvpTyUq5HkWazQC579rfZsKXuyikuV5fJdF3vYJi9lNQGpBmlxI1DYeFmCFYjbVDcinpCckUKLPvseiauG8OButLz200NbGBnRBJyRebtNKkjlYriP1Yx5sm5+yAb79l+rL97MtJStaEVblxOdXjwp0H7pRtKbmxj8iKxYsoQXdIHnXu1JnDRWX6GpvZgl/fjCPnq1UkX0cuCocZM0t9ymmOJ3PsJw0HxgJGManA1nXcaLkrU6o8lGTNN+w32FMHQnMiVN+UmqX/KVjftyYJoEwS81loiRDPvfIwzOZhL7dqIwhrwOhZQj01w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=quarantine sp=quarantine 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=feJip2VdmeDGJNBogWxW/wsLaY2E8RQk3uf07k6tk/U=; b=MBDAhZCW0R4C5gvSUmjs0Qs9lk2jKgpxtCNYrLszZTTpOlnylZAqKT1GWSjyrWqYAaMvDZcsZlHUo5yCp/u+kzWwt2g/7WfOh/HucCXA4mcy/dLBItiADLEVH5jbYKos8ipldl+SF1Mf2XPlaFAwifHHIrs+sN6Q/OlRDvhB8u7IRRVoVyZf1JN2LHswydGszzgju4uF0a7dnuMHtgBBj0XPTtWwV1Hkl6N+lAtoxC2jF4Zy6Ih2Pt5dnceiguVhUg4QtIrzSsPRUGIpS0YCUlHcecEfHVT5OZIgQOe9KOzVzixoHrig52cybbKyRc8eAFn1a83haPhTAvMok8zG1A== Received: from DM6PR05CA0063.namprd05.prod.outlook.com (2603:10b6:5:335::32) by SN6PR12MB2656.namprd12.prod.outlook.com (2603:10b6:805:67::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4690.15; Sun, 14 Nov 2021 15:36:39 +0000 Received: from DM6NAM11FT021.eop-nam11.prod.protection.outlook.com (2603:10b6:5:335:cafe::81) by DM6PR05CA0063.outlook.office365.com (2603:10b6:5:335::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4713.14 via Frontend Transport; Sun, 14 Nov 2021 15:36:38 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) 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.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by DM6NAM11FT021.mail.protection.outlook.com (10.13.173.76) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4690.15 via Frontend Transport; Sun, 14 Nov 2021 15:36:38 +0000 Received: from nvidia.com (172.20.187.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Sun, 14 Nov 2021 15:36:33 +0000 From: Gregory Etelson To: , CC: , , , "Viacheslav Ovsiienko" Subject: [PATCH 2/5] net/mlx5: add Ethernet header to GENEVE RSS expansion Date: Sun, 14 Nov 2021 17:36:13 +0200 Message-ID: <20211114153617.25085-2-getelson@nvidia.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211114153617.25085-1-getelson@nvidia.com> References: <20211114153617.25085-1-getelson@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.5] X-ClientProxiedBy: HQMAIL111.nvidia.com (172.20.187.18) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ceac3e3c-22d5-4cc9-c627-08d9a7848c5a X-MS-TrafficTypeDiagnostic: SN6PR12MB2656: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:669; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: k0Z8nljgreRE9g2Ur6qdrf+VwkTXjjbrAH9pQf0Ja5YYx20X2KecU8WAP70Lov8+4q15AS67dFP3jaDrOHhZq5D6yUqK+NnKwiGEVfIZeP9pzDTKI53mb2OPK5wuY5ugDLQOBhNp0Xj8CgOM5Bg4dQEnkYC24YX0eMAaHfyMJ+4JkA9uaGxwOnoy56KBApKukt8hlmSfHhjoAgLWRt1v3sdex4f5x8mEijKepvj2v6ueEHWhdvVMAs7XVNzFMGpQXIq44SphMXgwYrLeAWaIz9NjMyjTprOfe6ckg7HQelYtM/U+Libg+gVLxHk+dJY0uGv88WQ20WlkniPGUGR22K/uWLYGEeYiFrQDcpSrC52U9i+PkGIwH3+t/ETwlaznrR7j+SJM+0SczH3sWkWYeeNZXLAifTktl3Fe0/MWG+5pbuTKD2diu94SOtI7AZs5St1isOOXyWqlDKfQyXPM9tB+1RVRCLaBWPk+1s3JW5YFblLamoNdpLI89k7JtXGoVnBVC9tyjTEwsuM1kwjZNf5H7zPQmEhLnRRSDhgS/WMM/SU+bcWNT8QHCrNpyb1PhPRS1Uhfq/tNjoq5cubg7J2Rr7OEYKGt2GRgpl9/ZvJk4AZDCr6atV9jxutKdHsct7bw4uJkInD0zlPGs+sLdo2Tjap2CHaE7iFuK5q83OHNJEnf0SVOvGy8ZpWbrzev X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(36840700001)(46966006)(508600001)(426003)(82310400003)(186003)(4326008)(2906002)(107886003)(356005)(1076003)(6286002)(86362001)(55016002)(2616005)(16526019)(7049001)(83380400001)(47076005)(6666004)(70206006)(36756003)(7696005)(316002)(5660300002)(36860700001)(336012)(7636003)(8936002)(110136005)(54906003)(8676002)(70586007)(26005)(450100002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Nov 2021 15:36:38.0777 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ceac3e3c-22d5-4cc9-c627-08d9a7848c5a X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT021.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR12MB2656 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org RFC-8926 allows inner Ethernet header after GENEVE tunnel. Current GENEVE RSS expansion created IPv4 and IPv6 paths only. The patch adds Ethernet to RSS expansion scheme. Cc: stable@dpdk.org Signed-off-by: Gregory Etelson --- drivers/net/mlx5/mlx5_flow.c | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index f657980737..205fe19cdd 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -258,6 +258,29 @@ mlx5_flow_expand_rss_item_complete(const struct rte_flow_item *item) else ret = RTE_FLOW_ITEM_TYPE_END; break; + case RTE_FLOW_ITEM_TYPE_GENEVE: + ether_type_m = item->mask ? + ((const struct rte_flow_item_geneve *) + (item->mask))->protocol : + rte_flow_item_geneve_mask.protocol; + ether_type = ((const struct rte_flow_item_geneve *) + (item->spec))->protocol; + ether_type_m = rte_be_to_cpu_16(ether_type_m); + ether_type = rte_be_to_cpu_16(ether_type); + switch (ether_type_m & ether_type) { + case RTE_ETHER_TYPE_TEB: + ret = RTE_FLOW_ITEM_TYPE_ETH; + break; + case RTE_ETHER_TYPE_IPV4: + ret = RTE_FLOW_ITEM_TYPE_IPV4; + break; + case RTE_ETHER_TYPE_IPV6: + ret = RTE_FLOW_ITEM_TYPE_IPV6; + break; + default: + ret = RTE_FLOW_ITEM_TYPE_END; + } + break; default: ret = RTE_FLOW_ITEM_TYPE_VOID; break; @@ -530,7 +553,8 @@ enum mlx5_expansion { MLX5_EXPANSION_IPV6_UDP, MLX5_EXPANSION_IPV6_TCP, MLX5_EXPANSION_IPV6_FRAG_EXT, - MLX5_EXPANSION_GTP + MLX5_EXPANSION_GTP, + MLX5_EXPANSION_GENEVE, }; /** Supported expansion of items. */ @@ -574,6 +598,7 @@ static const struct mlx5_flow_expand_node mlx5_support_expansion[] = { .next = MLX5_FLOW_EXPAND_RSS_NEXT(MLX5_EXPANSION_VXLAN, MLX5_EXPANSION_VXLAN_GPE, MLX5_EXPANSION_MPLS, + MLX5_EXPANSION_GENEVE, MLX5_EXPANSION_GTP), .type = RTE_FLOW_ITEM_TYPE_UDP, .rss_types = RTE_ETH_RSS_NONFRAG_IPV4_UDP, @@ -598,6 +623,7 @@ static const struct mlx5_flow_expand_node mlx5_support_expansion[] = { .next = MLX5_FLOW_EXPAND_RSS_NEXT(MLX5_EXPANSION_VXLAN, MLX5_EXPANSION_VXLAN_GPE, MLX5_EXPANSION_MPLS, + MLX5_EXPANSION_GENEVE, MLX5_EXPANSION_GTP), .type = RTE_FLOW_ITEM_TYPE_UDP, .rss_types = RTE_ETH_RSS_NONFRAG_IPV6_UDP, @@ -701,6 +727,12 @@ static const struct mlx5_flow_expand_node mlx5_support_expansion[] = { MLX5_EXPANSION_IPV6), .type = RTE_FLOW_ITEM_TYPE_GTP, }, + [MLX5_EXPANSION_GENEVE] = { + .next = MLX5_FLOW_EXPAND_RSS_NEXT(MLX5_EXPANSION_ETH, + MLX5_EXPANSION_IPV4, + MLX5_EXPANSION_IPV6), + .type = RTE_FLOW_ITEM_TYPE_GENEVE, + }, }; static struct rte_flow_action_handle * -- 2.33.1