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 EB6F545BB6 for ; Wed, 23 Oct 2024 23:17:28 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E587140261; Wed, 23 Oct 2024 23:17:28 +0200 (CEST) Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) by mails.dpdk.org (Postfix) with ESMTP id 4F3BC40261 for ; Wed, 23 Oct 2024 23:17:27 +0200 (CEST) Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-42f6bec84b5so2204985e9.1 for ; Wed, 23 Oct 2024 14:17:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1729718247; x=1730323047; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=KEZ57Lk+SzxJ65zoTaPTvGzpmUY0mbHPTw4LVE1Ry2o=; b=Rg4KwRIy0n9iLlLL8+fWDdECvdFsVizqb9MoBtBJ6Gw1u600lDRAuB1fVvZBcstvdY Tiaj3s0cKkWW+LE7b8qdhpQBLc2dEI72lKZMMcSQPmnFei8bNRtNK5vcBDlXV0luHe97 Zme6dAxUMS/N9XMUSY6qk8lb/PNlzZJwX+MB6A1QcQUwx1sSJLW8GBiJCG6xehZJFzSR hmKx4a35ZUwa7btp+/j0xOtS07niQp9Am7ne/WkQq1COL1cFfU97ddYwHVxi0lGRf1up ro68onMBzeWJCFQMfmyChpePzjURfkdUVGHuyZtuSbBexnPEYHtU39LhUggsq58tIoGh Xfsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729718247; x=1730323047; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KEZ57Lk+SzxJ65zoTaPTvGzpmUY0mbHPTw4LVE1Ry2o=; b=R0dfXoARHTw3s/dDzU2Hgy9QRl6eSl6ACyVkm7Jq/+5JMmPHB1fddbdlEJ3TGs7j8J K3ktexjTdTNZEMhpACwpSf6He0zE/qF5W4PRl9qrn9VGTjpT6P1zUILTPicmWtKKVVNl MXacSuazl1qDB0C307YxPX8m3BvGhX78QO1jsS+diEaJXWDZrw4sZs41TDcnttemVv8K rJ7IIsMPPk+b0O671HelYgQ8mIb3JBnaZbLc3iRRWHQMRMEUzTcBJCDt63U3wldi2m1g EReeg3pRo6N9e9d9R4QtXWXUE1VDnv74sQBayruQMf+EQjy7cWgczvrB6oYYqnrkUilT LmNw== X-Forwarded-Encrypted: i=1; AJvYcCXvazvV498oaKmOIkIDKxpkTzKyW9h6N20Y/y+diYZlG9x9Ch0evX4JxeIRvPMRmPRshSeASxw=@dpdk.org X-Gm-Message-State: AOJu0YyZiL4H4hcEM00P+JEgu025HrLjEZfIjLXACoU2nsxMx3r5Bcif YS9D7C7Vh3xoC9eYPG21/H71enVpVla+ap/8U/oOL5f+xPR/5fZ08uz/1Q== X-Google-Smtp-Source: AGHT+IHjVOMMf5rX2E4hrstEfTr2xDVphF3dHAx7i19JVb6NOXYFjzVt/uJn2TTyRXIQ/+sFXD4Oeg== X-Received: by 2002:a5d:47aa:0:b0:37c:ce58:5a1a with SMTP id ffacd0b85a97d-37efcf960d5mr2616513f8f.54.1729718246753; Wed, 23 Oct 2024 14:17:26 -0700 (PDT) Received: from localhost ([2a01:4b00:d036:ae00:21cd:def0:a01d:d2aa]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37ee0a583edsm9727800f8f.49.2024.10.23.14.17.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Oct 2024 14:17:26 -0700 (PDT) From: luca.boccassi@gmail.com 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 22.11.7 Date: Wed, 23 Oct 2024 22:15:46 +0100 Message-ID: <20241023211704.1216956-6-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241023211704.1216956-1-luca.boccassi@gmail.com> References: <20241023211704.1216956-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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.7 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 10/25/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/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/66228c9ae76ca68940b1e9b4bb46bd587447c365 Thanks. Luca Boccassi --- >From 66228c9ae76ca68940b1e9b4bb46bd587447c365 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 0a91d70e4c..80d6d50ba9 100644 --- a/.mailmap +++ b/.mailmap @@ -823,6 +823,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.45.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-10-23 22:16:40.785278188 +0100 +++ 0006-dev-fix-callback-lookup-when-unregistering-device.patch 2024-10-23 22:16:40.435940252 +0100 @@ -1 +1 @@ -From 66fd2cc2e47c69ee57f0fe32558e55b085c2e32d Mon Sep 17 00:00:00 2001 +From 66228c9ae76ca68940b1e9b4bb46bd587447c365 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 0a91d70e4c..80d6d50ba9 100644 @@ -27,2 +28,2 @@ -@@ -886,6 +886,7 @@ Mahipal Challa - Mahmoud Maatuq +@@ -823,6 +823,7 @@ Mahesh Adulla + Mahipal Challa @@ -36 +37 @@ -index a99252b02f..70aa04dcd9 100644 +index 614ef6c9fc..bc53b2e28d 100644