From: Somnath Kotur Date: Fri, 14 Feb 2020 06:43:53 +0000 (+0530) Subject: bus/pci: fix devargs on probing again X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=fc67ae91ebae7c48fc27a1d24e0843c50c192459;p=dpdk.git bus/pci: fix devargs on probing again As per the comments in this code section, since there is a matching device, it is now its responsibility to manage the devargs we've just inserted. But the matching device ptr's devargs is still uninitialized or not pointing to the newest dev_args that were passed as a parameter to local_dev_probe(). This is needed particularly in the case when *probe is called again* on an already probed device as part of adding a representor port to OVS-DPDK. Fixes: 7e8b26650146 ("eal: fix hotplug add / remove") Cc: stable@dpdk.org Signed-off-by: Somnath Kotur Acked-by: Gaetan Rivet --- diff --git a/drivers/bus/pci/linux/pci.c b/drivers/bus/pci/linux/pci.c index 740a2cdad4..71b0a3053d 100644 --- a/drivers/bus/pci/linux/pci.c +++ b/drivers/bus/pci/linux/pci.c @@ -377,6 +377,11 @@ pci_scan_one(const char *dirname, const struct rte_pci_addr *addr) */ RTE_LOG(ERR, EAL, "Unexpected device scan at %s!\n", filename); + else if (dev2->device.devargs != + dev->device.devargs) { + rte_devargs_remove(dev2->device.devargs); + pci_name_set(dev2); + } } free(dev); }