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 085F0A0545 for ; Mon, 20 Jun 2022 12:38:59 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EEE0740150; Mon, 20 Jun 2022 12:38:58 +0200 (CEST) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2040.outbound.protection.outlook.com [40.107.236.40]) by mails.dpdk.org (Postfix) with ESMTP id 19CF040150 for ; Mon, 20 Jun 2022 12:38:58 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cja0Mmuy7guG9kYVZTrG2tYvGQMTIKHtnrZU3O5cySZbulX9EsVs9eR8W3irD2yokKD6+l5YxHE6//dSS4BGmlfdsmhMm4CsasxzeQiR+0sMrH+prWCv9Os0HtkjNsIfPRvn8HIzemrr/YgSu3MikuwPGyrePFpkxjC2JUYOD8nlMHtiRKUuCblZNiZWhZU9JyS3HOVmSakn1tupGmOC6dAmkZD+TFMXGsClGmYzMvGbjmNFFnGsXaPR4zAy8U6Hs5BGClSI4sn3b20u17hysFzo6iUoUgfhqgh3QjiP4c87UsEb1Gbc+UG3x34+OUEZqaI+5B8zGURiFIhcD/FwYg== 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=/iU1Ou5xjc7n19twscKW6amEQQsCdp/RZvfCsAA0a6A=; b=CD0xGZnm8AI9gayM+qv+DrMbAWWFu1+qiXIKV9mXqXgAHoAPDevAa29yR4bMcP+YSgd1QN6kAMbJTrLivTQ3ZnIUe0ZjhaqwbAiFXtwmYveVBjLaQMbmovF5TxPEngJRN0qU4BYFcjabLr+ExRqAku33vVf/FKouJWsVEMb4JaDus8GQUqKKNMo8/AgO3dO9qYxUZSv1CB590cH5hYqZ2usBARqBXir0wo4Z8uGfK1DWT4keCvStkM6WRUaRR4Eb/+s+ETb/t1W1giZScIjnqDTw30FeGeNBrI1vbEsby/Uexd1y9I9LofOwdK0MqtpK2LlYPwc+pNdQq2Niqyo80A== 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=/iU1Ou5xjc7n19twscKW6amEQQsCdp/RZvfCsAA0a6A=; b=eMEpUMoEO8xMucB8Vep6Pgwpaalru4qGD2elXJJEaWKccYm8aZxkCyqeHJXaZYlsnqhAVDhdXTfUbA7kOis96driung3bKqTwhuLZJzFeRmHqa8Yl084g6oGj+tVclYqntslyGMLCqV9eCHOffQwg+ACis6p6UrwzdDNGIuuV7EF7r37BAbsgB6P5bvMU4OfDlFnE1geFKxjkVFapwcJhFg6MSI2zeD1rYIXMTaI+eNEP/aSzwN/lCio8zQipUBgNEgFcrV9utDJYsw8KMiLNBdN0EOnqy8gxjMoqrOJ2/065GmsXtBnKBAkUh+sa9gW6nNfif9lJFNF3ROiqC9r6g== Received: from BN6PR16CA0030.namprd16.prod.outlook.com (2603:10b6:405:14::16) by DM6PR12MB3148.namprd12.prod.outlook.com (2603:10b6:5:11c::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5353.16; Mon, 20 Jun 2022 10:38:56 +0000 Received: from BN8NAM11FT052.eop-nam11.prod.protection.outlook.com (2603:10b6:405:14:cafe::34) by BN6PR16CA0030.outlook.office365.com (2603:10b6:405:14::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5353.22 via Frontend Transport; Mon, 20 Jun 2022 10:38:56 +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; pr=C Received: from mail.nvidia.com (12.22.5.238) by BN8NAM11FT052.mail.protection.outlook.com (10.13.177.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5353.14 via Frontend Transport; Mon, 20 Jun 2022 10:38:55 +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.32; Mon, 20 Jun 2022 10:38:55 +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; Mon, 20 Jun 2022 03:38:53 -0700 From: Dariusz Sosnowski To: Matan Azrad , Viacheslav Ovsiienko CC: Subject: [PATCH 20.11] net/mlx5: fix RSS hash types adjustment Date: Mon, 20 Jun 2022 10:37:28 +0000 Message-ID: <20220620103728.1219189-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: 09f2744e-0d73-4b07-62af-08da52a913b7 X-MS-TrafficTypeDiagnostic: DM6PR12MB3148: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: 61rF2pI8Zt5UDUyGcb+he8x4qT2+/kWWQhUPfInwgd07YjGJkOhzuZLvkWNEdI0rMhg7KWgEW0ssO7ZQnlqDqLdWWr38YP8Nw62G/BJRLazIkJ9I43QunLt7WITJUzBvbIrTsVT0eV1AjZmnh4jKCsinnMkK+wtbpd7F2zTpHEBsTDRAJfp5FtwkXCnAZik9XO0phzZ+hEAXJ68hjxzIK0x4P4J2vwKQW+INC/56QBpm2Vz2aSKXzVpt1WFETp03RKq5YX/DqWLGm+jbrUkK2UN0HZRiChNDRYeP5BLZXRBTN2kb5xs6S8Oo3lhlfiUbbtXiFq745InA+EoVzKjXpOG7uacVtfye7smawW8Ws9GtSTtMwMG7YiZp/nDxedLGL33bzrutziDB4r8S6qWid1MQohsC6aJZzyEcDu8dHlSLC9neCvY/8kEQmkpysi4zanbRjwL0G/K4pkmoZrMhkOshUeoJRKuEnW+qBcdJz3ZmLHkv1ukzgMUHbs4yvbS7/d1ZC9yymn4nE9dUomwJzlIzsvEZxRvU941XF3Yxkqkks2r06UezdnqRRhKLA3NSf7Dkb7q3zbr8hQzRv5/iYGdElTE8HPz5f4xfEH5ic+BvHno5EoS5mfRiKcEdfU1u8/a28LEpgGZ+NbAMGv2hD/v07jwT8AIO5vIgthA0X7HbVqEwkquCXUQKqKIPgzidmCQZhs0uqjjbEtwRHOi06XQJ/OMNb4EHwfeqU+8irtsulJbmXHxb3MuSI6yFM5CP X-Forefront-Antispam-Report: CIP:12.22.5.238; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(13230016)(4636009)(136003)(376002)(39860400002)(346002)(396003)(40470700004)(46966006)(36840700001)(478600001)(5660300002)(8936002)(8676002)(26005)(336012)(426003)(2616005)(6286002)(7696005)(1076003)(47076005)(6636002)(186003)(16526019)(41300700001)(110136005)(82740400003)(81166007)(356005)(316002)(55016003)(40480700001)(40460700003)(86362001)(83380400001)(82310400005)(36756003)(70586007)(70206006)(4326008)(2906002)(36860700001)(6666004)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jun 2022 10:38:55.8363 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 09f2744e-0d73-4b07-62af-08da52a913b7 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: BN8NAM11FT052.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB3148 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 [ upstream commit d2fa2632a4a17b491f9a15834d9e13c6a6e5a1b9 ] 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: stable@dpdk.org Signed-off-by: Dariusz Sosnowski Acked-by: Viacheslav Ovsiienko --- drivers/net/mlx5/mlx5_flow_dv.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index aa22e85f6a..c1505b69e6 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -11567,8 +11567,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 - * Pointer to the shared action RSS conf. + * @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. * @@ -11576,10 +11576,10 @@ __flow_dv_action_rss_hrxqs_release(struct rte_eth_dev *dev, * void */ static void -__flow_dv_action_rss_l34_hash_adjust(struct mlx5_shared_action_rss *rss, +__flow_dv_action_rss_l34_hash_adjust(uint64_t orig_rss_types, uint64_t *hash_field) { - uint64_t rss_types = rss->origin.types; + uint64_t rss_types = rte_eth_rss_hf_refine(orig_rss_types); switch (*hash_field & ~IBV_RX_HASH_INNER) { case MLX5_RSS_HASH_IPV4: @@ -11680,7 +11680,8 @@ __flow_dv_action_rss_setup(struct rte_eth_dev *dev, uint64_t hash_fields = mlx5_rss_hash_fields[i]; int tunnel = 0; - __flow_dv_action_rss_l34_hash_adjust(shared_rss, &hash_fields); + __flow_dv_action_rss_l34_hash_adjust(shared_rss->origin.types, + &hash_fields); if (shared_rss->origin.level > 1) { hash_fields |= IBV_RX_HASH_INNER; tunnel = 1; -- 2.25.1