[dpdk-dev] [PATCH v3] pci/linux: copy new id for inserted device
Thomas Monjalon
thomas at monjalon.net
Tue Oct 13 10:40:34 CEST 2020
13/10/2020 00:01, Jim Harris:
> When a device is inserted into an existing BDF slot
> that has not been probed, we must overwrite the old
> PCI ID with the ID of the new function. Otherwise
> we may not probe the function with the correct driver,
> if at all.
>
> Signed-off-by: Jim Harris <james.r.harris at intel.com>
> ---
> --- a/drivers/bus/pci/linux/pci.c
> +++ b/drivers/bus/pci/linux/pci.c
> @@ -352,6 +352,7 @@ pci_scan_one(const char *dirname, const struct rte_pci_addr *addr)
> if (!rte_dev_is_probed(&dev2->device)) {
> dev2->kdrv = dev->kdrv;
> dev2->max_vfs = dev->max_vfs;
> + dev2->id = dev->id;
This simple assignment looks nicer than memcpy.
Thanks for this change.
[...]
> if (dev2->kdrv != dev->kdrv ||
> - dev2->max_vfs != dev->max_vfs)
> + dev2->max_vfs != dev->max_vfs ||
> + dev2->id != dev->id)
Unfortunately comparison of structs is not supported.
It seems your original memcmp is right.
More information about the dev
mailing list