Re: [PATCH 4/8] drivers: cleanup devargs lookup in bus scan

Stephen Hemminger
2026-03-24T16:12:55Z

On Mon, 23 Mar 2026 11:52:58 +0100
David Marchand <david.marchand@redhat.com> wrote:

> Don't hardcode the bus names in the RTE_EAL_DEVARGS_FOREACH() calls.
> The bus name is set by code in EAL.
> Even if there is nothing broken, let's reuse the name from the bus object.
>
> And remove the now useless macros.
>
> Note: in the ifpga bus case, the call was using an incorrect macro
> (IFPGA_ARG_NAME instead of IFPGA_BUS_NAME), yet it was working fine
> as this macro is aligned with the ifpga bus name.
>
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>

AI review feedback:

Patch 4/8: drivers: cleanup devargs lookup in bus scan

Error: In drivers/raw/ifpga/ifpga_rawdev.c, the change from
RTE_STR(IFPGA_BUS_NAME) to vdev->device.devargs->bus->name passes the
wrong bus name to rte_eal_hotplug_add(). The vdev is a vdev device
(registered via --vdev ifpga_rawdev_cfg,...), so
vdev->device.devargs->bus is the vdev bus, and its name is "vdev". The
old code correctly passed "ifpga" to hotplug the device onto the ifpga
bus. The new code would attempt to add the device to the vdev bus
instead.

Suggested fix: use rte_ifpga_bus.name (the ifpga bus object) or a local
string "ifpga" rather than deriving it from the vdev's devargs.