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 5CD9D45CE3 for ; Mon, 11 Nov 2024 07:30:33 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4B2844067A; Mon, 11 Nov 2024 07:30:33 +0100 (CET) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on2070.outbound.protection.outlook.com [40.107.96.70]) by mails.dpdk.org (Postfix) with ESMTP id B13164067A for ; Mon, 11 Nov 2024 07:30:31 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=m+OrdJLxK8oDscP7uyhgxsWbwJksMk0GffUz3VenR6eLCI1qB3eY/ufS3A7c6Ux3DE9C+Kfs0dvXZzvqopfdisPmT8/1FFovjL1IFUsEOkiSMC6NU2/bJZT/MEm7RVwTxzPIWH24y0Aq0rU6ucvzwOwvXOJTz7/MrTKrqIEphKIxkkd/iMzlBt7VkCHFHJoI3fmJ8cpSyl8YBvK9OSo9hgoZ4b+LlBILsWpME8GOaLAndo88wSnBueGLrCJw9n0zgvCvmzexOuKcIbcWzAsZohWuzS8pmKuzh9MUzJhdn/ajUx+C6aTP1VxKY4HY/MZNS4yWRbATqeoLPXbKEG0Oow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=HkRsrjc1Gar4Y/MMWIwNJq8B4U/lrcz3UvR4Hi2CeMU=; b=HrAH6TuhJ6No0emjNTyUqFd46/Uvx8fK/Bqg/Mre2xcw4z5nMbsfCzER45+ZnZnLIk/G7iFY677cbsXesae8RZWtm82/cKnyRjtz8pZYD99NC/Lm9dV511Patb2KUuJEK6wfSCghQ63h+SPUfUdNcgs19mtAGDYtb32W9/3WP5SzxINU/WQtY0kbJ6jnIjlgZIA98zK4kwpyTkMDJDy3SPLGOGS0Q3azUaDrbTr509Fj3NRU07Vz8S5gXiGZYFI+aw2Kju52QdIP3BsaQD6uUdFTCUHBYjGx3uzFS43jDpeSvkl1iDrF+kXPLgWrVAS1tOpUkr99N/T+KC/zYjQbdw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=cisco.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 (0) 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=HkRsrjc1Gar4Y/MMWIwNJq8B4U/lrcz3UvR4Hi2CeMU=; b=ZF6KMPgaTj7gAQahsc6gLFtdFuJupd/AGq1eThzlYHRjyWIq4wAOqEX6spWg0lxLxhKA1vAdR3NOMGN6vA91Sh6SruJCn1t+U6WK+PGBWChqwmjtZGBWeO3j6Ndapxlj+ZrloQzHDtaChFsKwlzvii7eriX473ao+EqiqYDltoHm+GSlC8neAULNVEn8F23cK4UeNtboINKYIztaMzYyKAaUTaAohptrZ4KC0/6MN/AX3PRdxbxXRA9BgReWQZZahEwYIfQKmMgJIpv1Of+we5dWZM9VhebFGogbAabKrCLm1hzxDqybWsMt81Cg54ToOFauvyCpTIW7yttWT+2lYg== Received: from BL1PR13CA0106.namprd13.prod.outlook.com (2603:10b6:208:2b9::21) by IA1PR12MB7710.namprd12.prod.outlook.com (2603:10b6:208:422::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.28; Mon, 11 Nov 2024 06:30:26 +0000 Received: from BN2PEPF000055E0.namprd21.prod.outlook.com (2603:10b6:208:2b9:cafe::e0) by BL1PR13CA0106.outlook.office365.com (2603:10b6:208:2b9::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.14 via Frontend Transport; Mon, 11 Nov 2024 06:30:26 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) 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.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by BN2PEPF000055E0.mail.protection.outlook.com (10.167.245.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8182.1 via Frontend Transport; Mon, 11 Nov 2024 06:30:25 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Sun, 10 Nov 2024 22:30:10 -0800 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.1544.4; Sun, 10 Nov 2024 22:30:08 -0800 From: Xueming Li To: Malcolm Bumgardner CC: , Long Li , Stephen Hemminger , dpdk stable Subject: patch 'dev: fix callback lookup when unregistering device' has been queued to stable release 23.11.3 Date: Mon, 11 Nov 2024 14:26:56 +0800 Message-ID: <20241111062847.216344-11-xuemingl@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241111062847.216344-1-xuemingl@nvidia.com> References: <20241111062847.216344-1-xuemingl@nvidia.com> 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-TrafficTypeDiagnostic: BN2PEPF000055E0:EE_|IA1PR12MB7710:EE_ X-MS-Office365-Filtering-Correlation-Id: 09e19af8-c72f-40c0-c6d5-08dd021a5430 X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|36860700013|376014|82310400026|1800799024; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?qfw/Ua3B/Ir7MKgncnt6MnQhHjuCF47cvPp7o9IvS8w4Yy591MkwxWwHHySo?= =?us-ascii?Q?7OiSnS3wFoQ4VUOtDcRFKsRo68y/7ZEmbPU1eol7DJ9//eXGZl3p2cZn7yEl?= =?us-ascii?Q?HrtfCJ6ObDR64KhMhbQrYTyq3nE+ZDCuMOwotoH173p7NFeh7e8PtlI2I7Ih?= =?us-ascii?Q?71Zrf6S0yJebUNRiiEAOSWkZdxWdzQq0M7gy8U9nA65kDj5NmKtc15IcuY0H?= =?us-ascii?Q?b08S+4Cn+MGf0cxT+Fkdn0xAoEgpfQB30BzNQuuafBcwTqrxuoXNnCyNyif2?= =?us-ascii?Q?PwozaWMBRXMTd4pvldrKb/Q8dRHVaDYOJD0VNaLv0ymdG/hyUuA1iEi5ZLq6?= =?us-ascii?Q?L/3mbQ0/ZeVibOgL6jiLMmAkhQkcL0BvJN0sG3iE3yD7z/R+MrVkDPrq6eF7?= =?us-ascii?Q?nma23Z9pZVrjFGJyMNqVCpd8vdoKlt0/X3ebdaJneKetdDEPdCXH86PwdHkf?= =?us-ascii?Q?Yy8Styw3kFrlE5xNPx2VnoUs1tk/06LEzXB/6dtsxio/iQG0KpEReO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IT7CJuXcEQfSLmqZj6zgljIhwRHJQ=3D=3D?= X-Forefront-Antispam-Report: CIP:216.228.117.160; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge1.nvidia.com; CAT:NONE; SFS:(13230040)(36860700013)(376014)(82310400026)(1800799024); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Nov 2024 06:30:25.9491 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 09e19af8-c72f-40c0-c6d5-08dd021a5430 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.160]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN2PEPF000055E0.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB7710 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 23.11.3 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/30/24. 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=23.11-staging This queued commit can be viewed at: https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=310058b8699eb2833fe0b8093a355f29fcea1b67 Thanks. Xueming Li --- >From 310058b8699eb2833fe0b8093a355f29fcea1b67 Mon Sep 17 00:00:00 2001 From: Malcolm Bumgardner Date: Thu, 18 Jul 2024 12:37:28 -0700 Subject: [PATCH] dev: fix callback lookup when unregistering device Cc: Xueming Li [ upstream commit 66fd2cc2e47c69ee57f0fe32558e55b085c2e32d ] In the device event unregister code, it unconditionally removes all callbacks which are registered with device_name set to NULL. This results in many callbacks incorrectly removed. Fix this by only removing callbacks with matching cb_fn and cb_arg. Fixes: a753e53d517b ("eal: add device event monitor framework") Signed-off-by: Malcolm Bumgardner Signed-off-by: Long Li Reviewed-by: Stephen Hemminger --- .mailmap | 1 + lib/eal/common/eal_common_dev.c | 13 +++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.mailmap b/.mailmap index 7aa2c27226..4b8a131d55 100644 --- a/.mailmap +++ b/.mailmap @@ -860,6 +860,7 @@ Mahesh Adulla Mahipal Challa Mah Yock Gen Mairtin o Loingsigh +Malcolm Bumgardner Mallesham Jatharakonda Mallesh Koujalagi Malvika Gupta diff --git a/lib/eal/common/eal_common_dev.c b/lib/eal/common/eal_common_dev.c index 614ef6c9fc..bc53b2e28d 100644 --- a/lib/eal/common/eal_common_dev.c +++ b/lib/eal/common/eal_common_dev.c @@ -550,16 +550,17 @@ rte_dev_event_callback_unregister(const char *device_name, next = TAILQ_NEXT(event_cb, next); if (device_name != NULL && event_cb->dev_name != NULL) { - if (!strcmp(event_cb->dev_name, device_name)) { - if (event_cb->cb_fn != cb_fn || - (cb_arg != (void *)-1 && - event_cb->cb_arg != cb_arg)) - continue; - } + if (strcmp(event_cb->dev_name, device_name)) + continue; } else if (device_name != NULL) { continue; } + /* Remove only matching callback with arg */ + if (event_cb->cb_fn != cb_fn || + (cb_arg != (void *)-1 && event_cb->cb_arg != cb_arg)) + continue; + /* * if this callback is not executing right now, * then remove it. -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-11-11 14:23:05.948838523 +0800 +++ 0010-dev-fix-callback-lookup-when-unregistering-device.patch 2024-11-11 14:23:05.022192842 +0800 @@ -1 +1 @@ -From 66fd2cc2e47c69ee57f0fe32558e55b085c2e32d Mon Sep 17 00:00:00 2001 +From 310058b8699eb2833fe0b8093a355f29fcea1b67 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 66fd2cc2e47c69ee57f0fe32558e55b085c2e32d ] @@ -13 +15,0 @@ -Cc: stable@dpdk.org @@ -24 +26 @@ -index a66da3c8cb..8004772125 100644 +index 7aa2c27226..4b8a131d55 100644 @@ -27,2 +29,2 @@ -@@ -886,6 +886,7 @@ Mahipal Challa - Mahmoud Maatuq +@@ -860,6 +860,7 @@ Mahesh Adulla + Mahipal Challa @@ -36 +38 @@ -index a99252b02f..70aa04dcd9 100644 +index 614ef6c9fc..bc53b2e28d 100644