From: "Renyong Wan" <wanry@yunsilicon.com>
To: <dev@dpdk.org>
Cc: <thomas@monjalon.net>, <stephen@networkplumber.org>,
<qianr@yunsilicon.com>, <nana@yunsilicon.com>,
<zhangxx@yunsilicon.com>, <xudw@yunsilicon.com>,
<jacky@yunsilicon.com>, <weihg@yunsilicon.com>
Subject: [PATCH 1/2] net/xsc: improve interrupt uninstall
Date: Tue, 16 Sep 2025 18:08:51 +0800 [thread overview]
Message-ID: <20250916100850.226649-2-wanry@yunsilicon.com> (raw)
In-Reply-To: <20250916100850.226649-1-wanry@yunsilicon.com>
Use synchronous callback unregister to ensure no callbacks
are running after interrupt uninstallation. This improves
stability and prevents potential use-after-free issues during
device teardown.
Signed-off-by: Rong Qian <qianr@yunsilicon.com>
Signed-off-by: Renyong Wan <wanry@yunsilicon.com>
---
drivers/net/xsc/xsc_vfio.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/net/xsc/xsc_vfio.c b/drivers/net/xsc/xsc_vfio.c
index c233728c5f..cda21aa3f4 100644
--- a/drivers/net/xsc/xsc_vfio.c
+++ b/drivers/net/xsc/xsc_vfio.c
@@ -1113,11 +1113,11 @@ xsc_vfio_intr_handler_install(struct xsc_dev *xdev, rte_intr_callback_fn cb, voi
static int
xsc_vfio_intr_handler_uninstall(struct xsc_dev *xdev)
{
- if (rte_intr_fd_get(xdev->pci_dev->intr_handle) >= 0)
- rte_intr_callback_unregister(xdev->pci_dev->intr_handle,
- xdev->intr_cb, xdev->intr_cb_arg);
-
- rte_intr_instance_free(xdev->intr_handle);
+ if (rte_intr_fd_get(xdev->pci_dev->intr_handle) >= 0) {
+ rte_intr_disable(xdev->pci_dev->intr_handle);
+ rte_intr_callback_unregister_sync(xdev->pci_dev->intr_handle,
+ xdev->intr_cb, xdev->intr_cb_arg);
+ }
return 0;
}
--
2.25.1
next prev parent reply other threads:[~2025-09-16 10:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-16 10:08 [PATCH 0/2] net/xsc: PMD improvements Renyong Wan
2025-09-16 10:08 ` Renyong Wan [this message]
2025-09-16 10:08 ` [PATCH 2/2] net/xsc: support compressed PCI BAR Renyong Wan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250916100850.226649-2-wanry@yunsilicon.com \
--to=wanry@yunsilicon.com \
--cc=dev@dpdk.org \
--cc=jacky@yunsilicon.com \
--cc=nana@yunsilicon.com \
--cc=qianr@yunsilicon.com \
--cc=stephen@networkplumber.org \
--cc=thomas@monjalon.net \
--cc=weihg@yunsilicon.com \
--cc=xudw@yunsilicon.com \
--cc=zhangxx@yunsilicon.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).