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 358F2A0C53; Wed, 1 Sep 2021 10:08:13 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EC5ED4013F; Wed, 1 Sep 2021 10:08:12 +0200 (CEST) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2064.outbound.protection.outlook.com [40.107.223.64]) by mails.dpdk.org (Postfix) with ESMTP id 58C3F40041; Wed, 1 Sep 2021 10:08:12 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=K7FVO6QzslUWpN2LDAjPvD5W9NyUH7zChDmDVkIVvLWtAq3gHJzR/cod5gPhl3nOgKdczreLtcrg+UAQauVsRTeLhey+Cr195YwGJNJf2uVaF+yKJItnmBe7FR21NzvUQyLfSxXu2ih29WqQVG0YZbNuZefPf5+1OWlzhifKjgOq1Y5jC986OnkbQRv1dcAe1Pt8G8ugz8hpAibvnbX9VSZpx3cMS+u6uabvJ5Ngk7YnA2m29yLjOYEMt8+vDKVmTMuRxU4sJRQPG90QjskwIfbFikTw6VuYUiFGXKs05/KE92zoXzEzxtySSm+hyT9HLTz/+PoO950qUdUyW2cWFg== 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-SenderADCheck; bh=hREZ4Fnalp3IH5bjaRhKqWb16iLjXI4UWXmrdRklhzk=; b=KIirhb/3Oi6j138j3QpIouO130+PTFd972Yihrmi7qu53EmqdRmbb+qmf5K+oPMh2HbylMT3tJm4HkTZKbzLKG8ESMRSMrqeB5dcwgLWXVaiokJTSoRvUtv3k6yWTeNnvB0yAQ6c+Gq9OkgZqnluJrPPnvkngn+072YA+xa7yibtgCU/vkiK5EQ5tWPA6iNP9SV9gzAvt8FubiyDU2O70yATrUIBCv1/vbg5tBr2mA5iTzs6uKL3DQLJRxLTDEzfKrxPNUGbyQ3YN1vUfdkkvagyNOhW1uzVnNC0IUGdyCJEfAI8e77wdq7/tMsu7QGwnY/UR4piKpzIJoJBZQdqlg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.32) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=quarantine sp=none 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=hREZ4Fnalp3IH5bjaRhKqWb16iLjXI4UWXmrdRklhzk=; b=c62Ef6qB6Uva87Xzekl+hhEq+GUKmyJilpFYX4gjFL8oY1Fppq1lDl2vDVy7MPr8db1SldDXd7UcjsSWJQ35o50gUM5v8+bRrt4WZgfbY5ZoNBL7a7hC4jX4rlq47bQlgGcSoXIS5z+lvEJZ//IAMAL+u/CewcTXcBkwruTl7JbCpF+AGg88wzwpyp7XvZK9emiKBLbCTU+qtuDqL9c4ZBPNspxXj4IlH8ItaIkHiIWjgZCWhF2rK4zSCFgMQZwzBG+GLgqKbTyERaY95c5KJ6Zo7nzCZNXljWLoSQ7uinyhxyEjiSYVLJQayDeiGKHQWpdhYJvhXUFbwe0EdN8thA== Received: from MWHPR18CA0036.namprd18.prod.outlook.com (2603:10b6:320:31::22) by MN2PR12MB3551.namprd12.prod.outlook.com (2603:10b6:208:104::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.23; Wed, 1 Sep 2021 08:08:10 +0000 Received: from CO1NAM11FT054.eop-nam11.prod.protection.outlook.com (2603:10b6:320:31:cafe::57) by MWHPR18CA0036.outlook.office365.com (2603:10b6:320:31::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4478.17 via Frontend Transport; Wed, 1 Sep 2021 08:08:10 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.32) 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.32 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.32; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.32) by CO1NAM11FT054.mail.protection.outlook.com (10.13.174.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4478.19 via Frontend Transport; Wed, 1 Sep 2021 08:08:10 +0000 Received: from DRHQMAIL107.nvidia.com (10.27.9.16) by HQMAIL109.nvidia.com (172.20.187.15) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 1 Sep 2021 01:08:09 -0700 Received: from nvidia.com (172.20.187.6) by DRHQMAIL107.nvidia.com (10.27.9.16) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 1 Sep 2021 08:08:07 +0000 From: Dmitry Kozlyuk To: CC: , , Viacheslav Ovsiienko , Matan Azrad , Shahaf Shuler Date: Wed, 1 Sep 2021 11:07:52 +0300 Message-ID: <20210901080752.3639647-1-dkozlyuk@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: [172.20.187.6] X-ClientProxiedBy: HQMAIL111.nvidia.com (172.20.187.18) To DRHQMAIL107.nvidia.com (10.27.9.16) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 073e581d-ce73-4606-165d-08d96d1fa373 X-MS-TrafficTypeDiagnostic: MN2PR12MB3551: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6108; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4O839P4lmT/t0o8a/v4XbeGfU6kbZfUzPM7mm7rh6CJz9RIxFnv8p1aUpTCKZPL2/NudWNQrlicpn5GR03gGQfuK60yyY0+vKsytg9uiqHuqp9FgTnPD3Cywcs9TzVdnhljJ0FB3NW2SJXzum6TksDTvEPwW+pgKVYm+GugClidIyG/12o/hyQo8qwy+sr6yybvJszrj5V4LEWzL89MPzd2ayZPXJfluP45amL2EAqJv+hWjhvOec5WEXnOI6IlwSne/y+g8dBwJSBakIU9SL3Ie+w+u+hPOGfgvn8erKTPoDkoRifVOD1hBW7qJx1+Ldql1oqOrZhUKwfCxP0B2ZbeP9SA0olsRI0DV3vqe2IeoHpJXUvz489bSps+Zb8isYPWRdwpIknaAkkDa65sT4RoshtsoBwCH+B3kUNHg3zKuNC++iLWoIlGMmAurC9rQzO7Xzj33ejKQo7+J6aX+W1pjGmBRqC8nzKTbm7TspZnA8iqXbseCU3GiIihl8POaJmP8Bs/jZ/y70AV0ZAocWh8B6pfN0VgMvdMRIZyvdTFyYkJefASe4XAMgQN6NSmV7cB5uyUSdT5Zovpzsu14dsxMFpLzt+V+UY4smnq/ptcHgNyk2f2ByC2rfDgmH0gpxJeQK/0/GHqoBAFv5gNrosSsr18AWaPsnZjKrHySqxQIrVBJVN13VAmac2lP4wg/ X-Forefront-Antispam-Report: CIP:216.228.112.32; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid01.nvidia.com; CAT:NONE; SFS:(4636009)(346002)(396003)(376002)(136003)(39860400002)(46966006)(36840700001)(54906003)(36756003)(1076003)(82310400003)(316002)(8676002)(36860700001)(356005)(7636003)(82740400003)(7696005)(8936002)(2906002)(70586007)(336012)(426003)(70206006)(5660300002)(83380400001)(2616005)(26005)(478600001)(47076005)(450100002)(4326008)(6286002)(107886003)(6916009)(16526019)(186003)(86362001)(6666004)(55016002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Sep 2021 08:08:10.1259 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 073e581d-ce73-4606-165d-08d96d1fa373 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.32]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT054.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB3551 Subject: [dpdk-dev] [PATCH] net/mlx5: fix shared RSS destruction 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 Sender: "dev" 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") Cc: andreyv@nvidia.com Cc: stable@dpdk.org 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 3f6f5dcfba..d59fa1c5f8 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -14742,12 +14742,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)) @@ -14755,6 +14749,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.25.1