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 53A90A034C for ; Wed, 22 Jun 2022 19:56:02 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4CACB4069F; Wed, 22 Jun 2022 19:56:02 +0200 (CEST) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2064.outbound.protection.outlook.com [40.107.93.64]) by mails.dpdk.org (Postfix) with ESMTP id 189924069F for ; Wed, 22 Jun 2022 19:56:01 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Tbok9ocdwvtIpst6E9C+bG71lnTghqq++yrj9nKLsLhei88y1YTQI1lhy5vlb7uAdthTLaLVOuTh0UeSW4DI0Km73CtwSu04K/RIajk68dluetFuoVJQzXPxoieBj7O6JD8n9JgrofW3mxpnWRQtMYcVG8cYX9AQ3960KlvPvKQvLj+anEZMEote7c/0ZuNPVS0zMtu7BwxqdkX87FfRlOPvPtzMZLTjZ+2zXFaval6/+pwxWN8vcJqzYIfDKWkhLvSdQkH3MS2fmWNSyT2CbtztsVDIKW3NamL5y4xlgjFaFrPDLMb5sKQPj+mmFRy8lsXKlmHF/di06cPIalHOWA== 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=iUj0qhXof5CAx9Y2CQ/mOJdjzZP8B/kmsO04Fr+17IY=; b=Qf7625M9BvOlDg27u9T9DVTFwjqRZe/9nHlIU4PudF6YXbl56TBngTaPUmM3QsGjQPprscpA8o1fLWAeTJ9MKEq3wk2CCxv3CSk67xMts3D/P8ubavBlM6ioiKw1MzEsaRMCffwM7yjlcAOCCWfhDrjzSQUCta6HaZZv5pNO6Zihp8rGZPvyhqX0Y+poK896pGpeijZ7VKSTBThP+z8hWn5VM6OmZs+Mg56eY6yApnutsVM/CPuwDrqWq1W4hi/oHf8TE6nAfGGnHTe4yhXzkAJnPLbAj59xFpVrtITNNspDWQZnf5151tmiXsOkY08/uk00yM0eUPv7+higTez+hg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.234) 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=iUj0qhXof5CAx9Y2CQ/mOJdjzZP8B/kmsO04Fr+17IY=; b=fqqbJg+4wSiMCe/YxzlR4G8TNS58M/EB0zBghILTr7URp+9tvdS3A6Aom2jPYw+XlR+nFehg2C4yJgVaozIpLa/PlR2NABGNNz7wCB//ZYqT4US96V5VmrhdUylqtkCHpJWCM/iptqKM2tOAm8pBGc1RN0yTV3E5AYSV36VaGr3PuupGugvnNEh3EvH1WDR1A9oUFyXD23A2ZcDvJFUb3QsL1twhv2xMRScxzYkLs138iYr2XX9Izn3y8/3o6o52GgzA2xTfSgJYHdV6ESwAFQAtpFhorD9KZ9NbPSFR73KupIw8ZXBdTRZsI+XHDn3JNCMKUI4joBJb0HGAlt1j2g== Received: from MW4PR04CA0092.namprd04.prod.outlook.com (2603:10b6:303:83::7) by MN2PR12MB3598.namprd12.prod.outlook.com (2603:10b6:208:d1::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5353.22; Wed, 22 Jun 2022 17:55:59 +0000 Received: from CO1NAM11FT050.eop-nam11.prod.protection.outlook.com (2603:10b6:303:83:cafe::88) by MW4PR04CA0092.outlook.office365.com (2603:10b6:303:83::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5353.18 via Frontend Transport; Wed, 22 Jun 2022 17:55:58 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.234) 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.234 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.234; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (12.22.5.234) by CO1NAM11FT050.mail.protection.outlook.com (10.13.174.79) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5373.15 via Frontend Transport; Wed, 22 Jun 2022 17:55:58 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL101.nvidia.com (10.27.9.10) with Microsoft SMTP Server (TLS) id 15.0.1497.32; Wed, 22 Jun 2022 17:55:58 +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; Wed, 22 Jun 2022 10:55:56 -0700 From: Dariusz Sosnowski To: Matan Azrad , Viacheslav Ovsiienko CC: Subject: [PATCH 21.11] net/mlx5: fix RSS hash types adjustment Date: Wed, 22 Jun 2022 17:54:32 +0000 Message-ID: <20220622175432.1412085-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: rnnvmail203.nvidia.com (10.129.68.9) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e02553e1-e4e9-42fd-b09a-08da5478767d X-MS-TrafficTypeDiagnostic: MN2PR12MB3598: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: gxkeTtHke2p4LkEVMXr8K5nCi4pHeV7JR5V0V2ReuJ4rNLF0tultwYL2TJNPYaclxeX1kw0XUOvejUxHJOKAaSoyJb4PVA8fnbpPizVTsYlU867xbZRtT2jxSvrfTKyRRPlVbrbechecZq0VT9iaURS0Fc9duUPBFhxqM84As6Au4JdkLEf6wYPmJplsGq4WBMh22vVBYTz15thSTfVEpxloYPkvHvDRiJEKZyUzOPlp4CXBsgqrja/MUG3hjx3F+vlnAgk/QIBhJ3hLosbb5YoeV6Ca6ZPIAKRdosnIDWatgJfTNNi9cg1UrpfnJS57zBS4lGeY/k17cHEclroJXyOJd6u5OkELYicTobXCvOTWlKfaBp1L9PA68220FlJ6r8WWtPGtYdVAzN73BntsXl2AdyouR8wXIhnP15qKZFQtB9/UPbYPfTiJhtRMmmYwhDpF2pyRbSg3RupIKdXcgAT6tfmYk67M4a7lg8/90C3GbzdhQuAZiYobSoProjyVyCnGCO9S97wRiq7GFUmEPxUeSh77NTd47cK/+WzRS6ADrMOtahCHi6mhJ/o/T1uBM5zPZMMwQ6onssPTu85ennxS34OqUOs0YQktINqxlFa1tlDzBPrpcMvecKSdPP1YQhSHHqQSnLroWgrwfQj5mNOe//s0EpZs8p8lia3nYp5oPfESOvdBsSjRvx23pzIuc+I58irWiY+313Y2NjSwksUj1vi8YvCnTRTvHrBjVncb4O/L/FH0oXpn5Ha9an6C1cy/M3VNSPN4p28u3Jv18wGJGt1rksOHfezB7zJhd6c= X-Forefront-Antispam-Report: CIP:12.22.5.234; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(13230016)(4636009)(346002)(136003)(376002)(39860400002)(396003)(46966006)(36840700001)(40470700004)(7696005)(2906002)(5660300002)(356005)(82740400003)(41300700001)(82310400005)(83380400001)(40460700003)(86362001)(40480700001)(26005)(6286002)(81166007)(110136005)(186003)(478600001)(2616005)(316002)(16526019)(36756003)(70206006)(8676002)(426003)(47076005)(70586007)(336012)(55016003)(8936002)(6666004)(1076003)(36860700001)(6636002)(4326008)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jun 2022 17:55:58.6010 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e02553e1-e4e9-42fd-b09a-08da5478767d 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.234]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT050.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB3598 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 b24c79b324..b6f552bc62 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -14679,8 +14679,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. * @@ -14688,10 +14688,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: @@ -14793,7 +14793,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