From: Stephen Hemminger <stephen@networkplumber.org>
To: David Marchand <david.marchand@redhat.com>
Cc: dev@dpdk.org, Bruce Richardson <bruce.richardson@intel.com>,
Robin Jarry <rjarry@redhat.com>, Parav Pandit <parav@nvidia.com>,
Xueming Li <xuemingl@nvidia.com>,
Nipun Gupta <nipun.gupta@amd.com>,
Nikhil Agarwal <nikhil.agarwal@amd.com>,
Hemant Agrawal <hemant.agrawal@nxp.com>,
Sachin Saxena <sachin.saxena@nxp.com>,
Chenbo Xia <chenbox@nvidia.com>,
Tomasz Duszynski <tduszynski@marvell.com>,
Chengwen Feng <fengchengwen@huawei.com>,
Long Li <longli@microsoft.com>, Wei Hu <weh@microsoft.com>,
Kevin Laatz <kevin.laatz@intel.com>
Subject: Re: [PATCH 6/8] bus: factorize device selection
Date: Tue, 24 Mar 2026 09:12:33 -0700 [thread overview]
Message-ID: <20260324091233.52e9babb@phoenix.local> (raw)
In-Reply-To: <20260323105306.1531689-7-david.marchand@redhat.com>
On Mon, 23 Mar 2026 11:53:00 +0100
David Marchand <david.marchand@redhat.com> wrote:
> All buses (thankfully) implement the same logic when it comes to
> selecting the devices to probe based on -a/-b options.
> As we want to adjust how devices are selected, provide a common helper
> in EAL and use it in the buses.
>
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> Reviewed-by: Robin Jarry <rjarry@redhat.com>
> ---
> Changes since RFC v2:
> - changed API to query about a device name and hide the devargs meaning
> in the common code,
AI review found some issues in this one:
**Error**: In `drivers/dma/idxd/idxd_bus.c`, the refactored
`is_for_this_process_use` has a logic error. The old code could set
`retval` to 0 when a device was blocked:
```c
/* Old - retval could be set to 0 */
if (dsa_bus.bus.conf.scan_mode == RTE_BUS_SCAN_ALLOWLIST)
retval = rte_bus_find_devargs(...) != NULL;
else
retval = rte_bus_find_devargs(...) == NULL;
```
The new code only ever sets `retval = 1`, never clearing it:
```c
/* New - retval is never set to 0 */
if (retval && !rte_bus_is_ignored_device(&dsa_bus.bus, dev->device.name))
retval = 1;
```
If a device should be ignored (blocked or not on the allow list),
`rte_bus_is_ignored_device` returns true, the condition is false, and
`retval` stays 1 from the earlier name-matching check. Blocked devices
will incorrectly pass through.
Suggested fix:
```c
if (retval)
retval = !rte_bus_is_ignored_device(&dsa_bus.bus, dev->device.name);
```
next prev parent reply other threads:[~2026-03-24 16:12 UTC|newest]
Thread overview: 67+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-23 10:52 [PATCH 0/8] Rework device probing David Marchand
2026-03-23 10:52 ` [PATCH 1/8] devtools: check packet forwarding in null test David Marchand
2026-03-23 10:52 ` [PATCH 2/8] bus/fslmc: fix bus cleanup David Marchand
2026-03-23 16:59 ` Kevin Traynor
2026-03-26 8:22 ` David Marchand
2026-03-26 8:49 ` Kevin Traynor
2026-03-24 5:15 ` Hemant Agrawal
2026-03-24 5:15 ` Hemant Agrawal
2026-03-23 10:52 ` [PATCH 3/8] drivers/bus: require probe function for NXP drivers David Marchand
2026-03-23 16:59 ` Kevin Traynor
2026-03-24 5:15 ` Hemant Agrawal
2026-03-23 10:52 ` [PATCH 4/8] drivers: cleanup devargs lookup in bus scan David Marchand
2026-03-24 5:16 ` Hemant Agrawal
2026-03-24 14:13 ` Kevin Traynor
2026-03-24 16:10 ` Stephen Hemminger
2026-03-23 10:52 ` [PATCH 5/8] bus: factorize devargs lookup David Marchand
2026-03-24 14:16 ` Kevin Traynor
2026-03-24 16:11 ` Stephen Hemminger
2026-03-23 10:53 ` [PATCH 6/8] bus: factorize device selection David Marchand
2026-03-24 14:15 ` Kevin Traynor
2026-03-26 8:48 ` David Marchand
2026-03-24 16:12 ` Stephen Hemminger [this message]
2026-03-23 10:53 ` [PATCH 7/8] bus: remove per bus scan mode David Marchand
2026-03-24 16:02 ` Kevin Traynor
2026-03-24 16:27 ` Kevin Traynor
2026-03-26 8:54 ` David Marchand
2026-03-23 10:53 ` [PATCH 8/8] eal: configure initial device probing David Marchand
2026-03-25 10:57 ` Kevin Traynor
2026-03-24 5:17 ` [PATCH 0/8] Rework " Hemant Agrawal
2026-03-25 15:22 ` Maxime Leroy
2026-03-26 10:24 ` [PATCH v2 0/7] " David Marchand
2026-03-26 10:24 ` [PATCH v2 1/7] devtools: check packet forwarding in null test David Marchand
2026-03-26 10:24 ` [PATCH v2 2/7] bus/fslmc: fix bus cleanup David Marchand
2026-03-26 11:50 ` Kevin Traynor
2026-03-26 10:24 ` [PATCH v2 3/7] drivers/bus: require probe function for NXP drivers David Marchand
2026-03-26 10:24 ` [PATCH v2 4/7] drivers: cleanup devargs lookup in bus scan David Marchand
2026-03-28 3:13 ` fengchengwen
2026-03-26 10:24 ` [PATCH v2 5/7] bus: factorize devargs lookup David Marchand
2026-03-26 11:51 ` Kevin Traynor
2026-03-28 3:33 ` fengchengwen
2026-04-03 14:22 ` David Marchand
2026-03-26 10:24 ` [PATCH v2 6/7] bus: factorize device selection David Marchand
2026-03-26 11:52 ` Kevin Traynor
2026-03-28 3:38 ` fengchengwen
2026-03-26 10:24 ` [PATCH v2 7/7] eal: configure initial device probing David Marchand
2026-03-28 4:00 ` fengchengwen
2026-04-03 14:25 ` David Marchand
2026-04-07 11:52 ` [PATCH v3 0/7] Rework " David Marchand
2026-04-07 11:52 ` [PATCH v3 1/7] devtools: check packet forwarding in null test David Marchand
2026-04-07 11:52 ` [PATCH v3 2/7] bus/fslmc: fix bus cleanup David Marchand
2026-04-07 11:52 ` [PATCH v3 3/7] drivers/bus: require probe function for NXP drivers David Marchand
2026-04-07 11:52 ` [PATCH v3 4/7] drivers/bus: cleanup devargs lookup in scan David Marchand
2026-04-07 11:52 ` [PATCH v3 5/7] bus: factorize devargs lookup David Marchand
2026-04-08 1:18 ` fengchengwen
2026-04-07 11:52 ` [PATCH v3 6/7] bus: factorize device selection David Marchand
2026-04-07 11:52 ` [PATCH v3 7/7] eal: configure initial device probing David Marchand
2026-04-08 1:44 ` fengchengwen
2026-04-07 11:58 ` [PATCH v3 0/7] Rework " David Marchand
2026-04-07 15:12 ` Stephen Hemminger
2026-04-10 14:34 ` Morten Brørup
2026-04-10 15:16 ` Kevin Traynor
2026-04-10 17:37 ` Stephen Hemminger
2026-04-10 21:13 ` [EXTERNAL] " Long Li
2026-04-10 22:50 ` Stephen Hemminger
2026-04-11 7:30 ` Morten Brørup
2026-04-11 10:10 ` David Marchand
2026-04-11 10:23 ` 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=20260324091233.52e9babb@phoenix.local \
--to=stephen@networkplumber.org \
--cc=bruce.richardson@intel.com \
--cc=chenbox@nvidia.com \
--cc=david.marchand@redhat.com \
--cc=dev@dpdk.org \
--cc=fengchengwen@huawei.com \
--cc=hemant.agrawal@nxp.com \
--cc=kevin.laatz@intel.com \
--cc=longli@microsoft.com \
--cc=nikhil.agarwal@amd.com \
--cc=nipun.gupta@amd.com \
--cc=parav@nvidia.com \
--cc=rjarry@redhat.com \
--cc=sachin.saxena@nxp.com \
--cc=tduszynski@marvell.com \
--cc=weh@microsoft.com \
--cc=xuemingl@nvidia.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