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 2F3FBA0093; Fri, 14 Jan 2022 16:16:29 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B6E8B41152; Fri, 14 Jan 2022 16:16:28 +0100 (CET) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2075.outbound.protection.outlook.com [40.107.244.75]) by mails.dpdk.org (Postfix) with ESMTP id 806C840C35 for ; Fri, 14 Jan 2022 16:16:27 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RQkk8w/g9WJToGxi8DgzvYG3luUDvHb2ucPHFhR0lWGK3A+/NWlL4ch5esSuhBkNg/pcvSPYE+YvgbBW9txOGcXRaJ74lKVupzkWjFVq+3TKL3NEL143oLpJKm92PpVcJIUVQs2ZnZRccqWKQAwhqM49VgEmqKvObcKBi9l7r8jnyvW0+Oq853PcxtZZC32JayFzW/30zBrNnQuNXI4qKFlEjNPprZUVqY6LSWbqd0i1t2abTeavFQWq7yC8f2u0GNMCpxYFkMmjqvSt8CuHFIxn+tY/s3nszD2oYS2twoeRIpuPgtZqSWU0zsVKf0gX5kckYN+YuvYWuk5vwFasbg== 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=wTPiP6BFlUFUFc6P6Vp9aXQU4GXd2mBAHXVHnr60/ug=; b=LtnqFBCXZ9doarPzghuDLxzd6AihZKVficKuVxgYbwXTOnxsBf00vQ8WtsMq8RKTh49Xt0zi6VG4f1eAFPTabgyOT1O0wR+GHSu1+lh7RqQIIxEULC0YSvkX/WuoErt35nX26B19kW6cLH/6zaCJlyvZW0/ATt/GiGpgRgk7cdaVxqM8tnXkRyQWXn1chFFB6k18UsaBdYmCIXYxS0Ur2jOrAW/cUE/PIuEb0VIh2/rwvqT6GPcTYijFIkVzcbTajqcQuH4rd1i1MBa1hrh+qE4MjKB7BbGMRFVWK31LA9Wdxw2TevmdNlhs1d8NiQRVM79EBTOcGeeKZwJ81uEoNw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.238) 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=wTPiP6BFlUFUFc6P6Vp9aXQU4GXd2mBAHXVHnr60/ug=; b=A+fEhIs6sguJFf9Im7Q1sYb4Ty0/rhtg+ZSMPj6Bpl0q7yGMnQ6jHFCXZjxJ8al3/j6S4G4rEz16xpTSrU7ZTPCyzd+TUM4gdB/94S0/qPr4cc90r21Or5SvrxpLeEfTZrZSq3NhfFOZJYh3TE4Hsddst9k9x3aFVygvyI5ExLEsK8yf91tjYwUL9ph7uD1/dEfcbR6pjtaqLxW3KZhz8vswcyyZWvGr8Ay+2o/Ekjvk98/IcBUBVQsoIRA0gYin+uukf8zkdosuuvnPPhi7XpEgA08c3+YFJwIAJUKLo3nhbA4B7bCd/fEcqPiJtwKHtanGv9ck68Ol+9IirOfMkw== Received: from DS7PR05CA0023.namprd05.prod.outlook.com (2603:10b6:5:3b9::28) by BL0PR12MB4884.namprd12.prod.outlook.com (2603:10b6:208:1ca::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4888.9; Fri, 14 Jan 2022 15:16:23 +0000 Received: from DM6NAM11FT055.eop-nam11.prod.protection.outlook.com (2603:10b6:5:3b9:cafe::d2) by DS7PR05CA0023.outlook.office365.com (2603:10b6:5:3b9::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4909.2 via Frontend Transport; Fri, 14 Jan 2022 15:16:23 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.238) 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.238 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.238; helo=mail.nvidia.com; Received: from mail.nvidia.com (12.22.5.238) by DM6NAM11FT055.mail.protection.outlook.com (10.13.173.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4888.9 via Frontend Transport; Fri, 14 Jan 2022 15:16:23 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL105.nvidia.com (10.27.9.14) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Fri, 14 Jan 2022 15:16:22 +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_CBC_SHA384) id 15.2.986.9; Fri, 14 Jan 2022 07:16:20 -0800 From: Gregory Etelson To: CC: , , Viacheslav Ovsiienko , Matan Azrad Subject: [PATCH] net/mlx5: fix RSS expansion compilation Date: Fri, 14 Jan 2022 17:16:06 +0200 Message-ID: <20220114151606.25617-1-getelson@nvidia.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: HQMAIL101.nvidia.com (172.20.187.10) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6a00e9c0-a965-4942-1277-08d9d770d384 X-MS-TrafficTypeDiagnostic: BL0PR12MB4884:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6790; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: BQzXwUrlALkO0DZ0amMscbKvZ6QS8zaI9EvUjszj8RAoW/su3bSYWJNS/8Ads1yJDEyoYjrbOKKnzb4RdjD+gG23DhvQ4Zh0QMxq/ahM8wJSKFeYGX3uHUW7LkmOEvu44aHe9A3KKowWnIX+pqAWuVZSMCWj/s/POL2okIyroMyTyZEA1iO4IUtJtWu2nhWxMlno8IcBqlCg7I4zvs+BpOLlsjOqW7yiWzLdCmwM8ZBsDpfKHY/tzG8xbyt6++ujIiAS4y1nP6zxuN5soIcNsJPQL4vtSVRRyuDxxKNmTqFsOZkHWe/kHytNg+M444J+4csQIzan4ZW6pRp3NFtfCIoRHSZaqy2/CjWH69mnw3u8vs0NXbXjydN4xWUAMrWy7ib+dAjjd8G6Ix0CJqBi3SgyxnCGbSq83SHgHkfO7qBwMwLhoqUHccgSeJ0lu1Q9rdXJUlOXAh1pzV1uZ8IgkM11/mPLCNpnD17/n6XMPqGRcmCkwfrrXdhepp3cID0qVCOoZsjiW7MwtlTbO7fVcCN6GtPUH+XC7B6YlBrqtTfsLuLcxAhnWpdKWt1FzTBY0e+roUf+CguaOEo0BYIaTwcexn9lSNMD5kGwtwNkYW7ZzIYxKqIFrbWOlR1Bh0AT+sz4xs0CQk3L3glfr2BP7sARJ/QIiq40VEwwQnSu9SdqUQVQoNaSaG2C9OEoxYbbNoTfh4ulRAmEtjkFVg3ZxsdPzSn4hR+1HDE0wY4+a7qtxqFy5+vtMw4mTHXbpebmzf+dlFAyI/BKAzuOvNJgw1VUdX66p0SA90EFpzUZmDI= X-Forefront-Antispam-Report: CIP:12.22.5.238; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(4636009)(40470700002)(36840700001)(46966006)(4326008)(36756003)(508600001)(36860700001)(336012)(81166007)(47076005)(316002)(40460700001)(6916009)(82310400004)(55016003)(1076003)(6666004)(2906002)(8936002)(70586007)(70206006)(426003)(7696005)(5660300002)(2616005)(86362001)(186003)(16526019)(54906003)(107886003)(6286002)(8676002)(356005)(26005)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jan 2022 15:16:23.3186 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6a00e9c0-a965-4942-1277-08d9d770d384 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.238]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT055.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR12MB4884 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 For each item in flow rule pattern that can be expanded, RSS expansion scheme returns ether specific next item flow item type or RTE_FLOW_ITEM_TYPE_VOID or RTE_FLOW_ITEM_TYPE_END. RTE_FLOW_ITEM_TYPE_END means that expansion has completed. RTE_FLOW_ITEM_TYPE_VOID means that next flow item was not located yet and the procedure will continue. Current expansion scheme assigns RTE_FLOW_ITEM_TYPE_END for L2, L3 and L4 rule items that set next protocol value to 0 in flow item mask. The correct value in that case is RTE_FLOW_ITEM_TYPE_VOID. Fixes: 342a22ef3928 ("net/mlx5: fix RSS expansion with explicit next protocol") Signed-off-by: Gregory Etelson Acked-by: Viacheslav Ovsiienko --- drivers/net/mlx5/mlx5_flow.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index 4e2ff16e30..e067087272 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -261,18 +261,26 @@ mlx5_flow_expand_rss_item_complete(const struct rte_flow_item *item) switch (item->type) { case RTE_FLOW_ITEM_TYPE_ETH: MLX5_XSET_ITEM_MASK_SPEC(eth, type); + if (!mask) + return RTE_FLOW_ITEM_TYPE_VOID; ret = mlx5_ethertype_to_item_type(spec, mask, false); break; case RTE_FLOW_ITEM_TYPE_VLAN: MLX5_XSET_ITEM_MASK_SPEC(vlan, inner_type); + if (!mask) + return RTE_FLOW_ITEM_TYPE_VOID; ret = mlx5_ethertype_to_item_type(spec, mask, false); break; case RTE_FLOW_ITEM_TYPE_IPV4: MLX5_XSET_ITEM_MASK_SPEC(ipv4, hdr.next_proto_id); + if (!mask) + return RTE_FLOW_ITEM_TYPE_VOID; ret = mlx5_inet_proto_to_item_type(spec, mask); break; case RTE_FLOW_ITEM_TYPE_IPV6: MLX5_XSET_ITEM_MASK_SPEC(ipv6, hdr.proto); + if (!mask) + return RTE_FLOW_ITEM_TYPE_VOID; ret = mlx5_inet_proto_to_item_type(spec, mask); break; case RTE_FLOW_ITEM_TYPE_GENEVE: -- 2.34.1