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 C138545DB9 for ; Wed, 27 Nov 2024 18:19:41 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BAB5A4067E; Wed, 27 Nov 2024 18:19:41 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 02043402DE for ; Wed, 27 Nov 2024 18:19:39 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1732727979; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ptFkXvPAf2QnG4/btDMyg1Bs3cD7p14w64611PeZ1Wc=; b=ePTRYhOBZvrbCTgTm7gQdLbEvkWCkgQPMq995DFrjGlZdYh3EiVTqnL0gftqBvAuSstT4F LoApTzJJKPPIG4mYAZNX/VC+kuzEaENsCHlXpmRuOJ233/YLs7DD4U5fXSkgL9WcVGdKwb 8qTFOriaE/R45P5WZF4GpScukS/gEGs= Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-684-AtL-5A5dPBOHoH9wzGuPvA-1; Wed, 27 Nov 2024 12:19:37 -0500 X-MC-Unique: AtL-5A5dPBOHoH9wzGuPvA-1 X-Mimecast-MFC-AGG-ID: AtL-5A5dPBOHoH9wzGuPvA Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 7F08619560AB; Wed, 27 Nov 2024 17:19:36 +0000 (UTC) Received: from rh.redhat.com (unknown [10.39.192.52]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id C6384300019E; Wed, 27 Nov 2024 17:19:34 +0000 (UTC) From: Kevin Traynor 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 21.11.9 Date: Wed, 27 Nov 2024 17:17:13 +0000 Message-ID: <20241127171916.690404-6-ktraynor@redhat.com> In-Reply-To: <20241127171916.690404-1-ktraynor@redhat.com> References: <20241127171916.690404-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: gl3fGfnliG7N-S5Ld3-3RjV93HGNBY_fDnRt3DOoWeo_1732727976 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit content-type: text/plain; charset="US-ASCII"; x-default=true 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 21.11.9 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 12/02/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://github.com/kevintraynor/dpdk-stable This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable/commit/525bfcf6b4664eb6f7bee6935f679ec57d9ec804 Thanks. Kevin --- >From 525bfcf6b4664eb6f7bee6935f679ec57d9ec804 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 [ 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 d1b9f266b5..39f81c0e7d 100644 --- a/.mailmap +++ b/.mailmap @@ -823,4 +823,5 @@ Mahipal Challa Mah Yock Gen Mairtin o Loingsigh +Malcolm Bumgardner Mallesham Jatharakonda Mallesh Koujalagi diff --git a/lib/eal/common/eal_common_dev.c b/lib/eal/common/eal_common_dev.c index 07f285f862..80d6396462 100644 --- a/lib/eal/common/eal_common_dev.c +++ b/lib/eal/common/eal_common_dev.c @@ -513,14 +513,15 @@ rte_dev_event_callback_unregister(const char *device_name, 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, -- 2.47.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-11-27 17:17:38.534977001 +0000 +++ 0006-dev-fix-callback-lookup-when-unregistering-device.patch 2024-11-27 17:17:38.158269026 +0000 @@ -1 +1 @@ -From 66fd2cc2e47c69ee57f0fe32558e55b085c2e32d Mon Sep 17 00:00:00 2001 +From 525bfcf6b4664eb6f7bee6935f679ec57d9ec804 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 66fd2cc2e47c69ee57f0fe32558e55b085c2e32d ] + @@ -13 +14,0 @@ -Cc: stable@dpdk.org @@ -24 +25 @@ -index a66da3c8cb..8004772125 100644 +index d1b9f266b5..39f81c0e7d 100644 @@ -27 +28 @@ -@@ -887,4 +887,5 @@ Mahmoud Maatuq +@@ -823,4 +823,5 @@ Mahipal Challa @@ -34 +35 @@ -index a99252b02f..70aa04dcd9 100644 +index 07f285f862..80d6396462 100644 @@ -37 +38 @@ -@@ -551,14 +551,15 @@ rte_dev_event_callback_unregister(const char *device_name, +@@ -513,14 +513,15 @@ rte_dev_event_callback_unregister(const char *device_name,