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 3DDACA00C3 for ; Thu, 21 Apr 2022 22:37:18 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 36238410E1; Thu, 21 Apr 2022 22:37:18 +0200 (CEST) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2078.outbound.protection.outlook.com [40.107.223.78]) by mails.dpdk.org (Postfix) with ESMTP id D4AB140040; Thu, 21 Apr 2022 22:37:15 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Zqjl6AzkMfKMyMGVjhVeuBF/M2I9g5IzCF4PHb7cSdYGk/AlgY0ADofVvDaJi+/wpSFbfpGhK+6Sv+qJlakRU+CmzIJSwfIyaLIlUyl82Zy7aWNivTUibDTfTtoQ8rpumEXNmRMzkGr7sdwnCjIbjSAuvi5Xw+C3Ek+6dntG18V2xXxdgHRkL2rh5k+otMPDgz/8RcIzZcvcluhUnpIxd0jZ78y/jhzpN+ztSTGCTmfQqQzTjJGJU1yk2eNzXK4f7NyKRCm+n8dsQP1zgVGb8Qva1nB8s63Ko7ib0/hvI/y63XCFS9aW6uLyjY13oZWVY593221rEUvNNYr69325xw== 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=sO1DRcvW6WLuu0K/+Q+VBCAfnTrIs06j+vJEeefu+BQ=; b=Nzif+NnySXNPeoNf5TUNOr5rERb5Urf9BEMkNtIIGi8pJvxONYDcOQd/hMHFUJd9TWqnKJhWKaVE4HVIInyKBKuiW4tOpS4xBi3W/emd1HmZGgB/E+qv47YxX+HS3Myvb4ThuvUNfRT+Ewy7PtelF4uGWLICBZmCdqXkDV0lmGgN3mKcPVtThYxxI7MLrjbH9pJcyxoPHsOOMZ2KlAHEOYXxpsmSN3hkDecUZrS6ojLoLntSncGMSMFt0d/5br65BdiDOWm2P/5rebh2YjzR9QmYCHRwx8zWNM3zdRgHwUqpqTJSt+aMrOW/TpoHH6h/oSDwU8UmwM8ghSjDE+aezw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.235) 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=sO1DRcvW6WLuu0K/+Q+VBCAfnTrIs06j+vJEeefu+BQ=; b=LIU8FuP5VKAlXQHi4NyWrj6BAWf0Btrs792N9Wpb3WxDOtSVjGwbw9EU70dMH6V3CzZ4mWjL7g8dWx0BzqUV1IATmWNKZrqqgJFDOKNO4iU1DaHzabJbqK0swZOQjnaeAggfFOXmYNSw77PTm8xo0i5iaMfHX1vrmFCfazYhwjgZv/ur9fyre4K+HDdd1DhlmaMZk2+uN0TIOku4xcq5xCfPXqJMRtrc6D08oDBynZzFzNVj9mdW5vysJFw+qtqsFO/CQg5tIB+Qxn/+LrK2f8UJxfmOVcJxvJqhN4C+e2ajzbD1Fye1QASgmNd1bxBbIcCdrbLcwqzRP19xAm24nQ== Received: from BN9PR03CA0902.namprd03.prod.outlook.com (2603:10b6:408:107::7) by MN2PR12MB4013.namprd12.prod.outlook.com (2603:10b6:208:163::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5186.13; Thu, 21 Apr 2022 20:37:14 +0000 Received: from BN8NAM11FT065.eop-nam11.prod.protection.outlook.com (2603:10b6:408:107:cafe::6a) by BN9PR03CA0902.outlook.office365.com (2603:10b6:408:107::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5186.15 via Frontend Transport; Thu, 21 Apr 2022 20:37:14 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.235) 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.235 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.235; helo=mail.nvidia.com; Received: from mail.nvidia.com (12.22.5.235) by BN8NAM11FT065.mail.protection.outlook.com (10.13.177.63) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5186.14 via Frontend Transport; Thu, 21 Apr 2022 20:37:13 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL107.nvidia.com (10.27.9.16) with Microsoft SMTP Server (TLS) id 15.0.1497.32; Thu, 21 Apr 2022 20:37:13 +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.22; Thu, 21 Apr 2022 13:37:10 -0700 From: Dariusz Sosnowski To: Matan Azrad , Viacheslav Ovsiienko , Xiaoyu Min CC: , Raslan Darawsheh , Subject: [PATCH] net/mlx5: fix RSS hash types adjustment Date: Thu, 21 Apr 2022 20:36:56 +0000 Message-ID: <20220421203656.3252574-1-dsosnowski@nvidia.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6562a340-ffe9-4218-8d56-08da23d6b7c1 X-MS-TrafficTypeDiagnostic: MN2PR12MB4013: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: sbFpo1xuF1lVGbZkDDSvZoUaej1Ye+SEQjU3ax+sygKpCAjtVAaYoYjXbrvgRhkMJ6Os7PJrK3jY6iPih1KFeIJFdMQcgj8Ueeo5jtAdi08bzM8Cxnyg5yukOrxX3OwuTfYB+OyFOgtUmgrVi9qIjAvMKSNCpl4T5o3lmuRWNLlSRi8uIFGtltmep4lc4QUBLC/2qkOTCFGJOjgnDXcardRrpcPiln/FmHjH11JrVLNNg3C4ozrUj5JZ/R/M4GvqDpNUT9BcNLOqeKAB5r4bOfwCuFMMp5876uB48mGWcK4I7/cFlQQuJMRu8w1aAq0gKCi/WSdUaHoZJo8gSptJeGuvkHhtCWULtgAuWUGmvtN2pjW3r/knM1xZX6rY/2J+6hp1Vqhg8D8QI4TZEv2NqQ/l8ImCnZTvKwGI3RXd5XJj4uC25u6ovJnEe3tV8GshjXXeUumpr4wuS+ZVK2zlbiUQmvq9JpQ9+wDVdpIuIy3ofwWr/euM2TD7EHNHbfb9NiWTUieX29vEWjckq+eW9fe7/25lrH3/1Hq11OjMv7HDKM7flis+VGb/WQW67XD4UipJYdNkPnyrIsEzdVMdvmJ/Q2G0gnRAjj2W3QhGjNq4ElbfqAlA1Hq5fDErdjtmPaw6kplRBEVHbbnNt4SNVEMb/NmyJWGTpx+1T4+r64O7SVkCBschoIymgO6TopOZirHofHrGzFGjSbhZI4IH2g== X-Forefront-Antispam-Report: CIP:12.22.5.235; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(13230001)(4636009)(46966006)(40470700004)(36840700001)(36860700001)(2616005)(186003)(16526019)(47076005)(426003)(5660300002)(26005)(450100002)(70206006)(336012)(70586007)(82310400005)(6636002)(54906003)(110136005)(36756003)(1076003)(83380400001)(8676002)(6286002)(81166007)(86362001)(316002)(7696005)(4326008)(8936002)(2906002)(508600001)(55016003)(6666004)(40460700003)(356005)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Apr 2022 20:37:13.7360 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6562a340-ffe9-4218-8d56-08da23d6b7c1 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.235]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT065.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4013 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 When an indirect action was created with an RSS action configured to hash on both source and destination L3 addresses (or L4 ports), it caused shared hrxq to be configured to hash only on destination address (or port). This patch fixes this behavior by refining RSS types specified in configuration before calculating hash types used for hrxq. Refining RSS types removes *_SRC_ONLY and *_DST_ONLY flags if they are both set. Fixes: 212d17b6a650 ("net/mlx5: fix missing shared RSS hash types") Cc: jackmin@nvidia.com Cc: stable@dpdk.org Signed-off-by: Dariusz Sosnowski Acked-by: Viacheslav Ovsiienko --- drivers/net/mlx5/mlx5_flow_dv.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index 1e9bd63635..6e30e94d07 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -14792,8 +14792,8 @@ __flow_dv_action_rss_hrxqs_release(struct rte_eth_dev *dev, * MLX5_RSS_HASH_IPV4_DST_ONLY are mutually exclusive so they can share * same slot in mlx5_rss_hash_fields. * - * @param[in] rss_types - * RSS type. + * @param[in] orig_rss_types + * RSS type as provided in shared RSS action. * @param[in, out] hash_field * hash_field variable needed to be adjusted. * @@ -14801,9 +14801,11 @@ __flow_dv_action_rss_hrxqs_release(struct rte_eth_dev *dev, * void */ void -flow_dv_action_rss_l34_hash_adjust(uint64_t rss_types, +flow_dv_action_rss_l34_hash_adjust(uint64_t orig_rss_types, uint64_t *hash_field) { + uint64_t rss_types = rte_eth_rss_hf_refine(orig_rss_types); + switch (*hash_field & ~IBV_RX_HASH_INNER) { case MLX5_RSS_HASH_IPV4: if (rss_types & MLX5_IPV4_LAYER_TYPES) { -- 2.25.1