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 944A8A0353; Tue, 1 Mar 2022 16:19:25 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6BD3D426DE; Tue, 1 Mar 2022 16:19:25 +0100 (CET) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2078.outbound.protection.outlook.com [40.107.244.78]) by mails.dpdk.org (Postfix) with ESMTP id 083194067B; Tue, 1 Mar 2022 16:19:24 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DKqvb0SIUAV9rR52Q2uANktddCdFXwj7P2EnW6Sfo2OetpORTBpuXG0SSV73S0L5fNgfjxyINPJEWYzCm8itd7H/HaOgefiPHvCVnUE1mg99oeGBXacRCVNqrf6q8J053hhPtHjayD8oexoqmQv8c0HPlawXj6612ERY/fS3vIaFWcQtAAp+L4pjEG2Y5PwnMoHlcQtdHQ7Xmf41POSOev5Pl+R20lMFSo2lIWjEP2y32SQ4DivmFy58xF113wYasJqEHHkJGc6bN424uhy4UMtnZUPXZC8CF26zdX0qi4Dm4kzldmUne/ZUt6/fLqzBbUXY6xBDUpooFGgJbPsMRA== 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=D8U1G4wKwmrCHcdMAk6GOa7X5ndVBu+ObT9R2SphocM=; b=cIM52asiMjYnDcqQZPcX8sresE2hyZxcj2zrLFyEC/VBlnyaCX29UFozJwRY+L6yqnDKpIC99qVyTkLUD9KeB497FNAXr882oGUxVRQbdT2oe/MoCRt8D73f11T9wazQCyqz0FVGzeWbLCFlSIHZMwNj3DvDTDVRtXjKemvCwK879YM+7jEftJ17hPwhw1VkVxEsBz8GyJ0wBIiFq6Zhl8YvZ1s6zUKJC+ce3zb6dG2XUWntmX0nyRQG1a90hfBrWgjrbg4rM9Me9nDMxTXBaRP7j/VYLgEBZRyac9tplo28qTKO+ZDiJ4+IT2TUNIG1LHx4Mv31eaiICAYGwbUlMQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.236) 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=D8U1G4wKwmrCHcdMAk6GOa7X5ndVBu+ObT9R2SphocM=; b=OmWRHKT0kv5/C2/TsrFKoaBEjSIyPdQ7wO6XM/oAWEkQFERon28D1YxMxh0Om8+/tdtQtcEvSSFFjFR/Zd68USmkA1QSWGaS3In8cECdzdrogkfUHsLZ9EJgnVq6N84GCLmbZ2Syu0ZrqxM75Hom9s+CxmyRusfhjuOieqadJ/TmXMyZSuuZ45E6o9XqIwdnkPIYVnJzHhezo6iCFDdpGGCss03gzRq4BIx2fHGlR5sCjL0c9x/Vy9hH+omXRkh6URlhe4jhkdJRVUMaKpJQWCwSZ/9bfyZoBdUPCvswuMos5/ZNLj2SL2gGzUPPzzjShdm5GAUQzBtDJR1yBi9MRA== Received: from MWHPR15CA0040.namprd15.prod.outlook.com (2603:10b6:300:ad::26) by MN2PR12MB4550.namprd12.prod.outlook.com (2603:10b6:208:24e::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5017.24; Tue, 1 Mar 2022 15:19:21 +0000 Received: from CO1NAM11FT051.eop-nam11.prod.protection.outlook.com (2603:10b6:300:ad:cafe::78) by MWHPR15CA0040.outlook.office365.com (2603:10b6:300:ad::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5038.13 via Frontend Transport; Tue, 1 Mar 2022 15:19:21 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.236) 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 12.22.5.236 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.236; helo=mail.nvidia.com; Received: from mail.nvidia.com (12.22.5.236) by CO1NAM11FT051.mail.protection.outlook.com (10.13.174.114) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5017.22 via Frontend Transport; Tue, 1 Mar 2022 15:19:21 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL109.nvidia.com (10.27.9.19) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Tue, 1 Mar 2022 15:19:19 +0000 Received: from nvidia.com (10.126.231.35) 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.9; Tue, 1 Mar 2022 07:19:15 -0800 From: Gregory Etelson To: CC: , , , , Viacheslav Ovsiienko Subject: [PATCH 1/2] net/mlx5: fix next protocol RSS expansion Date: Tue, 1 Mar 2022 17:18:55 +0200 Message-ID: <20220301151856.17341-1-getelson@nvidia.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.126.231.35] 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-Office365-Filtering-Correlation-Id: 898783b9-d9ec-49ea-8f9b-08d9fb96dc6b X-MS-TrafficTypeDiagnostic: MN2PR12MB4550:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kS6dG1AN9rUCKBWTRrAgiE2SAMMn/Ji5I/pXvRjjBR43xyeRoqQzfIfrtjvA+c6NJtAhUjORjgMep1sOmZ/k1xScEBZZOqmUr3lyi5z36vEtPCNkYGP2RQop4l0Uuz1IrPAamHnZXoXEvbQO1w9E+VyYHp1exdckmKxKuu5CR1X8m86qy/3GW8uqfuuLJ9iHTfpPiWENYXEhwVWIedUjUUuDpbAH0n5cBCs8iVzGX1yLuxSSbSvXHa0CSgwf/BNcUTCKHqfHthFynPkh2B7o32frGhnFkjxCnKwRqnLCzUKVE0WiTWGmvZUSWu4oj+S2tMms/BIn59nl0Jqdu7vGp+6HRufYCIp6fPjBNxV4rdtouX6OdhtLSmQKp4EO7zKoAKN4pnsQv5tLrqo4xkkbaUqy4ezJ0paYz7NZeZNRpdyYXC4cnsUbqaMX0LuF5PHsJtzfQy1a1OhIB1BUCSRdXIeZ09jqL3OoRXfQlIogCky/zBKRHu3luvUpd0saDYZmbtQYo5R0OyLOHht5yP6/SmjeTMiZWQfW5sOOnznquhZPvxsYmplzngp1JYLwbsGnO3Kd+qaUSzimlqCgEg+qEVMj11G3evhsYk/J4BupDff0/nZrMqWZXUKjt3qQ58fAm949I3XcqnJ9vyto+1G810QapU8NyRwSEfSyGOhXiP4HPBufDrC+yklo2vKatlCkqdu8xYwICbLxCodBwq3eCg== X-Forefront-Antispam-Report: CIP:12.22.5.236; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(13230001)(4636009)(40470700004)(46966006)(36840700001)(2906002)(47076005)(36756003)(1076003)(70586007)(4326008)(426003)(356005)(107886003)(508600001)(8676002)(36860700001)(55016003)(8936002)(316002)(2616005)(336012)(81166007)(6916009)(450100002)(16526019)(6286002)(40460700003)(6666004)(54906003)(186003)(5660300002)(82310400004)(26005)(86362001)(7696005)(70206006)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Mar 2022 15:19:21.0244 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 898783b9-d9ec-49ea-8f9b-08d9fb96dc6b X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[12.22.5.236]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT051.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4550 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 RSS expansion scheme has 2 operational modes: default and specific. The default mode expands into all valid options for a given network layer. For example, Ethernet expands by default into VLAN, IPv4 and IPv6, L3 expands into TCP and UDP, etc. The specific mode expands according to flow item next protocol configuration provided by the item spec and mask parameters. There are 3 outcomes for the specific expansion: 1. Back to default – that is the case when result of (spec & mask) allows all possibilities. For example: eth type mask 0 type spec 0 2. No results – in that case item configuration has no valid expansion. For example: eth type mask 0xffff type spec 101 3. Direct - In that case flow item mask and spec configuration return valid expansion option. Example: eth type mask 0x0fff type spec 0x0800. Current PMD expands flow items with explicit spec and mask configuration into the Direct(3) or No results (2). Default expansions were handled as No results. Cc: stable@dpdk.org Fixes: f3f1f576f438 ("net/mlx5: fix RSS expansion with explicit next protocol") Signed-off-by: Gregory Etelson Acked-by: Matan Azrad --- drivers/net/mlx5/mlx5_flow.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index a690e2d337..0d774cfd19 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -175,6 +175,9 @@ mlx5_nsh_proto_to_item_type(uint8_t proto_spec, uint8_t proto_mask) enum rte_flow_item_type type; switch (proto_mask & proto_spec) { + case 0: + type = RTE_FLOW_ITEM_TYPE_VOID; + break; case RTE_VXLAN_GPE_TYPE_IPV4: type = RTE_FLOW_ITEM_TYPE_IPV4; break; @@ -196,6 +199,9 @@ mlx5_inet_proto_to_item_type(uint8_t proto_spec, uint8_t proto_mask) enum rte_flow_item_type type; switch (proto_mask & proto_spec) { + case 0: + type = RTE_FLOW_ITEM_TYPE_VOID; + break; case IPPROTO_UDP: type = RTE_FLOW_ITEM_TYPE_UDP; break; @@ -221,6 +227,9 @@ mlx5_ethertype_to_item_type(rte_be16_t type_spec, enum rte_flow_item_type type; switch (rte_be_to_cpu_16(type_spec & type_mask)) { + case 0: + type = RTE_FLOW_ITEM_TYPE_VOID; + break; case RTE_ETHER_TYPE_TEB: type = is_tunnel ? RTE_FLOW_ITEM_TYPE_ETH : RTE_FLOW_ITEM_TYPE_END; -- 2.34.1