From: Marat Khalili <marat.khalili@huawei.com>
To: David Marchand <david.marchand@redhat.com>,
Bruce Richardson <bruce.richardson@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
"hkalra@marvell.com" <hkalra@marvell.com>,
Chenbo Xia <chenbox@nvidia.com>,
Nipun Gupta <nipun.gupta@amd.com>,
"Tetsuya Mukawa" <mtetsuyah@gmail.com>
Subject: RE: [RFC 1/4] bus/pci: fix check on interrupt FD for FreeBSD
Date: Thu, 23 Jul 2026 14:31:23 +0000 [thread overview]
Message-ID: <1ece3c764a64471ab966dd324bc19d76@huawei.com> (raw)
In-Reply-To: <CAJFAV8wqcNPWffRmFLcUNcSL4KD3T0v5v-kjLX886BqFiV4XWQ@mail.gmail.com>
> > > --- a/drivers/bus/pci/bsd/pci.c
> > > +++ b/drivers/bus/pci/bsd/pci.c
> > > @@ -93,7 +93,7 @@ pci_uio_free_resource(struct rte_pci_device *dev,
> > > {
> > > rte_free(uio_res);
> > >
> > > - if (rte_intr_fd_get(dev->intr_handle)) {
> > > + if (rte_intr_fd_get(dev->intr_handle) >= 0) {
> > > close(rte_intr_fd_get(dev->intr_handle));
> > > rte_intr_fd_set(dev->intr_handle, -1);
> > > rte_intr_type_set(dev->intr_handle, RTE_INTR_HANDLE_UNKNOWN);
> >
> > Unlikely that we actually have fd as 0 for this call, but change is
> > technically correct.
>
> Yes, this is why I did not Cc: stable.
> Thanks.
Just trying to understand what's going on here out of curiosity.
Zero fd is valid and negative (typically -1) indicating error is a standard
logic in Linux, but here intr_handle->fd is zero-filled by
rte_intr_instance_alloc, so its initial state is 0 instead of -1. Do we have
reasons to believe that something always sets fd to non-zero value before
pci_uio_free_resource is called? Should rte_intr_instance_alloc set it to -1?
next prev parent reply other threads:[~2026-07-23 14:31 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-23 13:19 [RFC 0/4] Interrupts API update David Marchand
2026-07-23 13:19 ` [RFC 1/4] bus/pci: fix check on interrupt FD for FreeBSD David Marchand
2026-07-23 13:35 ` Bruce Richardson
2026-07-23 13:54 ` David Marchand
2026-07-23 14:31 ` Marat Khalili [this message]
2026-07-23 14:38 ` Bruce Richardson
2026-07-23 14:46 ` Marat Khalili
2026-07-23 13:19 ` [RFC 2/4] vdpa/mlx5: fix check on err interrupt FD David Marchand
2026-07-23 13:19 ` [RFC 3/4] interrupts: mark file descriptors invalid on allocation David Marchand
2026-07-23 13:19 ` [RFC 4/4] interrupts: close interrupt FDs David Marchand
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=1ece3c764a64471ab966dd324bc19d76@huawei.com \
--to=marat.khalili@huawei.com \
--cc=bruce.richardson@intel.com \
--cc=chenbox@nvidia.com \
--cc=david.marchand@redhat.com \
--cc=dev@dpdk.org \
--cc=hkalra@marvell.com \
--cc=mtetsuyah@gmail.com \
--cc=nipun.gupta@amd.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