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 1D6D9A034F for ; Wed, 10 Nov 2021 07:40:50 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 07F1240683; Wed, 10 Nov 2021 07:40:50 +0100 (CET) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2040.outbound.protection.outlook.com [40.107.237.40]) by mails.dpdk.org (Postfix) with ESMTP id 5555A40142 for ; Wed, 10 Nov 2021 07:40:48 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FxJP+xN0gFMwJSO+OgVOKSDSHsFW5SRiXiYS0VC9enQH+5+z2Rqd8I30s6vBqcxfZAJQ231GUkGcxlIQRfh/Uv+Yslzrv+qCrSxhyUj9RTRyC4RPpWatkOsJSEy1F0IvnwO1/3AjNusX/HklcPjofvxycI1Mm7TidOvd8/dRYNKI2ZaaEzvhDzLAoZtDr+0Ht9phwLwYdG9E3DuUjs900p93/SY8ItDdTgXXPls8UbJjNv90jqxK4SKOQeuPc5qNgmczN2S3AMF6OUBiW531blPjTmVGqYfa+rh81EtnCsKDV14KoOhxN8NGrZRHXM4f+KI1iWDZ+jvJi1Z7c6i6aQ== 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=3zDFtke7BVpWHUOsbd7FherJZCRfe+FTGedIS14ZNg4=; b=D9OYoJy4B/satdG7GMWUCog97FtTbAMofK1X22mKkpm6IOcYuP3AQY6zP2lZ3PVURmwzkQlX2bOm6f7uSrv5q68lLckd9K+D+4A29Lv9+enLYHCsmxGastcaE22AKhUpWApx8a/rsJXg+lYoIPMlUynxfFvQr9DDr2chJaMTOXJ2MuwJe0joiCSCapNw/cHLoN6T06mkWsifbG19zV7Sq53OcKK4n3Y7HxvXBaXtVvFi4oP2wRyLhiIUDtSUYjwb/qvoyZ6DhaWbhmFuMC9JccjU/43qg1yG9qOKx+URCINUvhaPUtQgQ2IBP9uCcw2GNFzXM7YhbgKYGmVO4lM6aA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=quarantine sp=quarantine 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=3zDFtke7BVpWHUOsbd7FherJZCRfe+FTGedIS14ZNg4=; b=Sj3hv2Qxwf6WGSJEmGWEmKNdiwDpSUoFgmuJQq6jiswOYNCM+clBFFfrKL3ygDgVisQiKKoo8Z5h08F8lzP8w5I9cMgOgAyU5FHnICHmBy79ZBvHFT7ofMYFrDoILqqb7X8t02YU/++RcwlgJjIeBamZaUW43SuSW2XhrpfpJAg9WpbEFDDG8rx8KW+V5+iWZMH42RUWwbRYYMzF9tytLEw0WcUjEkWiU+WD5lfmXGjf3rV7rJPzlVGoLwZ0dtglPt8O8Lx80tPrrqEgSRP1CJZ5jNygWFbwVExevZKgNQJB5FBUnPnKS1bSegc9OkeaPZEPff5VMIn5kYo1xBB6kA== Received: from DM6PR04CA0028.namprd04.prod.outlook.com (2603:10b6:5:334::33) by CO6PR12MB5441.namprd12.prod.outlook.com (2603:10b6:303:13b::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.13; Wed, 10 Nov 2021 06:40:46 +0000 Received: from DM6NAM11FT030.eop-nam11.prod.protection.outlook.com (2603:10b6:5:334:cafe::30) by DM6PR04CA0028.outlook.office365.com (2603:10b6:5:334::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.11 via Frontend Transport; Wed, 10 Nov 2021 06:40:46 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by DM6NAM11FT030.mail.protection.outlook.com (10.13.172.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4690.15 via Frontend Transport; Wed, 10 Nov 2021 06:40:46 +0000 Received: from nvidia.com (172.20.187.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Wed, 10 Nov 2021 06:40:44 +0000 From: Xueming Li To: Dmitry Kozlyuk CC: Luca Boccassi , Viacheslav Ovsiienko , dpdk stable Date: Wed, 10 Nov 2021 14:29:20 +0800 Message-ID: <20211110063216.2744012-77-xuemingl@nvidia.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211110063216.2744012-1-xuemingl@nvidia.com> References: <20211110063216.2744012-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.5] X-ClientProxiedBy: HQMAIL101.nvidia.com (172.20.187.10) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 671da989-babc-40d1-6270-08d9a41506ce X-MS-TrafficTypeDiagnostic: CO6PR12MB5441: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: wiTdUybWwMqfUpOrfUOhRbMajGjXgfbvewjvzCat+y2SvuduEf/9SFbzokBqueQVjIm+6ux3FjQmcynr5fCh7Bkko8r2ld0HV7hw6CvGKDXPy3CNxm1JVBC+KQKrXwXssWW7uNHmIAkicnc+fSXGAzklkVtivX1qO3ajOzopr8H7Roz7EEd5tzXREJTNz9As7zs1dHBKR9082Gj+C0C2otraEHu0qTfW3YaVVsFU9Pe3J/P3Uny22JdsiCcywsIIPJ126OJ4ty0wAKHqUofLzk7W2tGH9z1FaYtSEzqosM68fOmpq6nq9huPTtfOAQdz27SBgEbAn2AQU9H67xuqHqOC/D9QYeJ2ROqytxvAlyp7PliDbISr9ZZ3V65GKa1uVoX1V54sm9YnbtqdZR9EeI0UcIrFTpsGdDqsQ7qIRGCaTfVkYQsWbwRvLql7WiIyh06Sz+hfFnOQpZDpxIwtmVyMLG747tMgXTVdhyKy2J2ZIhBiF4OjbPNudBrz/Jy7jFpLWy9riIFlPh3Jijii6ismbALKVYSQCYxjEuso0rqj15LXa80YmaQZxzXZYRyc0NIKX72EcSTjqwKXP2tZLEM1N9LtkbWzX7zJ7J94s18vOVHH1IhLhbQSklGYsU7Qf9t78z3whjsVueTc93OI7jwxlASBhO9PueMFRcHHJGqF1ibppIKL7wIIpbjD2R9JvB1G8jcmoX0tZ34qFokmxQtdi49IuVZVkLyAoJa2i1ulXEK5XwMA/U6d8a5Gv8lrVBVrURbcjR1TwQQPuC7AqiYvgOdDXfV/aPsjEyDDuIIk+8zUnELhAVVMOBr5XsmsQryAmTELtdPf6MDo8V+iHw== X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(36840700001)(46966006)(37006003)(70206006)(4001150100001)(336012)(70586007)(55016002)(54906003)(508600001)(316002)(356005)(53546011)(7636003)(16526019)(2616005)(6666004)(83380400001)(426003)(36860700001)(8676002)(966005)(186003)(82310400003)(5660300002)(8936002)(1076003)(6286002)(86362001)(2906002)(4326008)(6862004)(26005)(7696005)(36756003)(6636002)(47076005); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Nov 2021 06:40:46.4003 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 671da989-babc-40d1-6270-08d9a41506ce X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT030.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR12MB5441 Subject: [dpdk-stable] patch 'net/mlx5: fix shared RSS destruction' has been queued to stable release 20.11.4 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 Sender: "stable" Hi, FYI, your patch has been queued to stable release 20.11.4 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/12/21. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/steevenlee/dpdk This queued commit can be viewed at: https://github.com/steevenlee/dpdk/commit/39f117c3b5eb3ee6e3fa7b0aff026222bcd191e3 Thanks. Xueming Li --- >From 39f117c3b5eb3ee6e3fa7b0aff026222bcd191e3 Mon Sep 17 00:00:00 2001 From: Dmitry Kozlyuk Date: Wed, 1 Sep 2021 11:07:52 +0300 Subject: [PATCH] net/mlx5: fix shared RSS destruction Cc: Xueming Li [ upstream commit f2f5879efb733460933dacf691887b22dfe9aa08 ] Shared RSS resources were released before checking that the shared RSS has no more references. If it had, the destruction was aborted, leaving the shared RSS in an invalid state where it could no longer be used. Move reference counter check before resource release. Fixes: d2046c09aa64 ("net/mlx5: support shared action for RSS") Signed-off-by: Dmitry Kozlyuk Acked-by: Viacheslav Ovsiienko --- drivers/net/mlx5/mlx5_flow_dv.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index 0b1a488edb..e8d4a006d4 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -11761,12 +11761,6 @@ __flow_dv_action_rss_release(struct rte_eth_dev *dev, uint32_t idx, return rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ACTION, NULL, "invalid shared action"); - remaining = __flow_dv_action_rss_hrxqs_release(dev, shared_rss); - if (remaining) - return rte_flow_error_set(error, EBUSY, - RTE_FLOW_ERROR_TYPE_ACTION, - NULL, - "shared rss hrxq has references"); if (!__atomic_compare_exchange_n(&shared_rss->refcnt, &old_refcnt, 0, 0, __ATOMIC_ACQUIRE, __ATOMIC_RELAXED)) @@ -11774,6 +11768,12 @@ __flow_dv_action_rss_release(struct rte_eth_dev *dev, uint32_t idx, RTE_FLOW_ERROR_TYPE_ACTION, NULL, "shared rss has references"); + remaining = __flow_dv_action_rss_hrxqs_release(dev, shared_rss); + if (remaining) + return rte_flow_error_set(error, EBUSY, + RTE_FLOW_ERROR_TYPE_ACTION, + NULL, + "shared rss hrxq has references"); queue = shared_rss->ind_tbl->queues; remaining = mlx5_ind_table_obj_release(dev, shared_rss->ind_tbl, true); if (remaining) -- 2.33.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-11-10 14:17:05.450499949 +0800 +++ 0076-net-mlx5-fix-shared-RSS-destruction.patch 2021-11-10 14:17:01.844079642 +0800 @@ -1 +1 @@ -From f2f5879efb733460933dacf691887b22dfe9aa08 Mon Sep 17 00:00:00 2001 +From 39f117c3b5eb3ee6e3fa7b0aff026222bcd191e3 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit f2f5879efb733460933dacf691887b22dfe9aa08 ] @@ -12 +14,0 @@ -Cc: stable@dpdk.org @@ -21 +23 @@ -index 626513ce56..15ca5cd2b4 100644 +index 0b1a488edb..e8d4a006d4 100644 @@ -24 +26 @@ -@@ -14761,12 +14761,6 @@ __flow_dv_action_rss_release(struct rte_eth_dev *dev, uint32_t idx, +@@ -11761,12 +11761,6 @@ __flow_dv_action_rss_release(struct rte_eth_dev *dev, uint32_t idx, @@ -37 +39 @@ -@@ -14774,6 +14768,12 @@ __flow_dv_action_rss_release(struct rte_eth_dev *dev, uint32_t idx, +@@ -11774,6 +11768,12 @@ __flow_dv_action_rss_release(struct rte_eth_dev *dev, uint32_t idx,