From fc67ae91ebae7c48fc27a1d24e0843c50c192459 Mon Sep 17 00:00:00 2001 From: Somnath Kotur Date: Fri, 14 Feb 2020 12:13:53 +0530 Subject: [PATCH] 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 --- drivers/bus/pci/linux/pci.c | 5 +++++ 1 file changed, 5 insertions(+) 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); } -- 2.20.1