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 F250D41D8D for ; Mon, 27 Feb 2023 08:03:49 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EE4A240A84; Mon, 27 Feb 2023 08:03:49 +0100 (CET) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2073.outbound.protection.outlook.com [40.107.223.73]) by mails.dpdk.org (Postfix) with ESMTP id C72A840A84 for ; Mon, 27 Feb 2023 08:03:48 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=h9jWtuvVxvXHwc7HLzPd3/L+eTTkfE84Fq0IGUmdKZr/XRy5HQvT2MLIFvTrs80lz7BoheUdwCIDzmW8k17Qw5LLbrgoieQ4uiTB6mWvgdU+2s1+SlUU50nQGBBCQpixFX6Nl8mLcLP+192yHOqtLQrLJNjZuRd5gbSq64vWHS9Dq/CbxsPDqQ1weNtYIDG+DXeAxcU0pbwvTgFSYEDobTU/r0MBEky0WebN7zaGA2LsmUuh1NHskFXXYnqYHiTuycTVt35vzRxwiFwC2Qs7hOSq8G5Pc8nz5gB5TAipoEfL4j3rNhR2YBf1hP5TSPl3Zc1ONAba9rOmaCyCuVNFqA== 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=jJOeUsDDm+ZmpKhO5gBduC70tWb7839Ea9Xa3Kmvoec=; b=WuAQVObRSUNayAChL0jCHzR+JRdI0lr9+/Yi6lau0GqCKsn411yK8+ro8cPLBR7Sq+fJ4d00jSzitDCf7pP+YS7mzX4QSFTai23vMM1btdtGMFXIUoXI1blddpJQYp6UxW2vJ8OEeSznRbmuJeiITaYhIubXgl0Erv44S/gx75vzbl35wgFgbcgDqwRoSOBK9Gdi5tAVPQMuRWs5mxYATFJAoKs68xE5AsJcNP/TY3nF+ZQbV1jk1qslT2Y8uAim53MOCRu/PvAW7ZiGuuxd/IKJnYIDZocqFASZZWie/Qnepa4pEGEW2VK1bcL7eCD7GxPO6+TYtXtTAwOdhCRdUw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=redhat.com 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=jJOeUsDDm+ZmpKhO5gBduC70tWb7839Ea9Xa3Kmvoec=; b=AYD8AACpKEGyGHYP7mn9/TJFSGds6QWT9EScbuP2VK3DYJgnfWmI6LvO9W/hUvIh/7BAOpc9vdpZEVs8nWiFHw89Z/WI2rt1YNAb+zhZp7dRecjMdNugaX9uBTKdJoorc1kQPtOcXrkdT4UXu5XmVnW+cgfzvRffJ8TPy9fQnzFKCMFE/2W4RuWacXWmz3ZGE3IRNj2wkd0Ft8kaD9NpygI/E+Kteq4OgWa0mHfiQ4/77FNKXxunj4SxCr8IDYne373Nvgjev8B0GKcXnosTh0ze1IVfNiz/TIzLkkbwm5x8JkdVRpAoQF9qDXi8Y+xtYJg9E2ZmRchj9Zc0S6Z6hQ== Received: from DM6PR08CA0022.namprd08.prod.outlook.com (2603:10b6:5:80::35) by SN7PR12MB7955.namprd12.prod.outlook.com (2603:10b6:806:34d::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.24; Mon, 27 Feb 2023 07:03:47 +0000 Received: from DS1PEPF0000E64C.namprd02.prod.outlook.com (2603:10b6:5:80:cafe::4) by DM6PR08CA0022.outlook.office365.com (2603:10b6:5:80::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.29 via Frontend Transport; Mon, 27 Feb 2023 07:03:46 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) 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 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by DS1PEPF0000E64C.mail.protection.outlook.com (10.167.18.42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.12 via Frontend Transport; Mon, 27 Feb 2023 07:03:46 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Sun, 26 Feb 2023 23:03:40 -0800 Received: from nvidia.com (10.126.230.37) 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.37; Sun, 26 Feb 2023 23:03:37 -0800 From: Xueming Li To: David Marchand CC: Elena Agostini , dpdk stable Subject: patch 'gpudev: fix deadlocks when registering callback' has been queued to stable release 22.11.2 Date: Mon, 27 Feb 2023 14:58:51 +0800 Message-ID: <20230227070107.15664-23-xuemingl@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230227070107.15664-1-xuemingl@nvidia.com> References: <20230227062349.13764-1-xuemingl@nvidia.com> <20230227070107.15664-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.230.37] 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-TrafficTypeDiagnostic: DS1PEPF0000E64C:EE_|SN7PR12MB7955:EE_ X-MS-Office365-Filtering-Correlation-Id: 3c89bed5-ba8f-4f3e-8ab7-08db1890c563 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: rLubf5VtZMLuVZ+S8nvhJiiz/gCfY7VwzHID/HS1ZggF3hliDvTfbIGFGNarOmvqnZTzgHDOxhP9HSRDcBJq5LXWLQzLjJ616qI5H10GcWa2mUDQkzpW/KSdJErmR3ouU8B7XGj06bxeCHii58tqfbQuwXneox4qTxzZNbY5Q3RG7FEATk/85VYfxTjSoywR0ZAUEf8Y9ScbLV21kK+3w2ROPVJl9ID0MszH3xJLGtc3imRxSz82RM+geIHT1auTUB0yZIj/EaDloJEWVrZG+Yobabw4GVJXksiwCKk7QIFMOkWkhvizm4t/CP03RJlSoU/UgDkSEVxUFLTwhKMe+CuDbjnjAWnjyPCQyHWM9nN7qU3vsD8NUMex6Mn7yFCtNS5eZsRKRjsn351ZKkclkKSOrwy+c61QESAaMqwBcgWAyOxh6EFLaiYiE6yr5oUvVekuCG0OTXpPCsm+l2cRSSMg35jc/Mq49Ac818mI8+sldxTkSj/0xJsyB9C3NRrGnPpFYTCbSayYIEFn9rDuRTFScYeVzaDJoRT9lzNU/wWVcZ70sSzt2Wmqm9e86HK07KShspmviN/NnMJFCcuZFzFagActiZn5nuFD6T5QqsFeccPwAiSimc9hgUIXdLvhQ9Z84DE8ES+tbYew31K1w/cTClR3+iXTC3d0ZPuxf0rz5wVKesG8qujF1k1h2VFRDnvuOpiQ8srFbF44k6x2qM2ZED05hhkpTVvwYmw2e6K7BRJBRMOKy7AD8PO0N0yYNrfAaYubJlYlUN3ETwBJiXoQLRk2/l7EFoD/Odv4DP0= X-Forefront-Antispam-Report: CIP:216.228.117.161; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge2.nvidia.com; CAT:NONE; SFS:(13230025)(4636009)(396003)(39860400002)(346002)(136003)(376002)(451199018)(40470700004)(36840700001)(46966006)(5660300002)(47076005)(70586007)(70206006)(6286002)(8676002)(16526019)(6666004)(41300700001)(8936002)(6916009)(55016003)(4326008)(53546011)(7696005)(478600001)(966005)(54906003)(1076003)(82310400005)(83380400001)(40460700003)(2906002)(86362001)(36756003)(40480700001)(2616005)(336012)(186003)(26005)(426003)(356005)(316002)(7636003)(36860700001)(82740400003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Feb 2023 07:03:46.7643 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3c89bed5-ba8f-4f3e-8ab7-08db1890c563 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.161]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DS1PEPF0000E64C.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB7955 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 Hi, FYI, your patch has been queued to stable release 22.11.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 03/01/23. 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://git.dpdk.org/dpdk-stable/log/?h=22.11-staging This queued commit can be viewed at: https://git.dpdk.org/dpdk-stable/commit/?h=22.11-staging&id=b9a14f6737000ffc6badaf72e5da6ba2194e285c Thanks. Xueming Li --- >From b9a14f6737000ffc6badaf72e5da6ba2194e285c Mon Sep 17 00:00:00 2001 From: David Marchand Date: Tue, 3 Jan 2023 11:49:00 +0100 Subject: [PATCH] gpudev: fix deadlocks when registering callback Cc: Xueming Li [ upstream commit 75d75530072e95a56799f0a8af261fc2eaf564ab ] gpu_callback_lock was not released in some branches of the register helper. While at it, set rte_errno in one of those branches. Fixes: 18cb07563165 ("gpudev: add event notification") Signed-off-by: David Marchand Acked-by: Elena Agostini --- lib/gpudev/gpudev.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/gpudev/gpudev.c b/lib/gpudev/gpudev.c index 805719d00c..8f12abef23 100644 --- a/lib/gpudev/gpudev.c +++ b/lib/gpudev/gpudev.c @@ -408,6 +408,7 @@ rte_gpu_callback_register(int16_t dev_id, enum rte_gpu_event event, callback->function == function && callback->user_data == user_data) { GPU_LOG(INFO, "callback already registered"); + rte_rwlock_write_unlock(&gpu_callback_lock); return 0; } } @@ -415,7 +416,9 @@ rte_gpu_callback_register(int16_t dev_id, enum rte_gpu_event event, callback = malloc(sizeof(*callback)); if (callback == NULL) { GPU_LOG(ERR, "cannot allocate callback"); - return -ENOMEM; + rte_rwlock_write_unlock(&gpu_callback_lock); + rte_errno = ENOMEM; + return -rte_errno; } callback->function = function; callback->user_data = user_data; -- 2.25.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2023-02-27 14:08:41.726526900 +0800 +++ 0024-gpudev-fix-deadlocks-when-registering-callback.patch 2023-02-27 14:08:40.739237000 +0800 @@ -1 +1 @@ -From 75d75530072e95a56799f0a8af261fc2eaf564ab Mon Sep 17 00:00:00 2001 +From b9a14f6737000ffc6badaf72e5da6ba2194e285c Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 75d75530072e95a56799f0a8af261fc2eaf564ab ] @@ -11 +13,0 @@ -Cc: stable@dpdk.org