[PATCH] drivers/bus: set device NUMA node to unknown by default
Olivier Matz
olivier.matz at 6wind.com
Fri Sep 30 10:11:19 CEST 2022
On Fri, Sep 30, 2022 at 09:10:55AM +0200, David Marchand wrote:
> On Thu, Sep 29, 2022 at 2:05 PM Olivier Matz <olivier.matz at 6wind.com> wrote:
> >
> > The dev->device.numa_node field is set by each bus driver for
> > every device it manages to indicate on which NUMA node this device lies.
> >
> > When this information is unknown, the assigned value is not consistent
> > across the bus drivers.
> >
> > Set the default value to SOCKET_ID_ANY (-1) by all bus drivers
> > when the NUMA information is unavailable.
> >
> > Signed-off-by: Olivier Matz <olivier.matz at 6wind.com>
>
> - The dma/idxd driver, which has its own bus, seems ok, though I
> would align its code for readability.
>
> @@ -322,7 +322,7 @@ dsa_scan(void)
>
> while ((wq = readdir(dev_dir)) != NULL) {
> struct rte_dsa_device *dev;
> - int numa_node = -1;
> + int numa_node = SOCKET_ID_ANY;
>
> if (strncmp(wq->d_name, "wq", 2) != 0)
> continue;
>
>
> - There is an impact on upper classes of devices.
>
> For ethdev, a port inherits the numa_node value from the rte_device object.
> Yet, rte_eth_dev_socket_id() is described as:
> * @return
> * The NUMA socket ID to which the Ethernet device is connected or
> * a default of zero if the socket could not be determined.
> * -1 is returned is the port_id value is out of range.
Good catches, I'll fix them in v2.
Thanks,
Olivier
More information about the dev
mailing list