bus/pci: fix devargs on probing again
authorSomnath Kotur <somnath.kotur@broadcom.com>
Fri, 14 Feb 2020 06:43:53 +0000 (12:13 +0530)
committerThomas Monjalon <thomas@monjalon.net>
Tue, 31 Mar 2020 00:54:29 +0000 (02:54 +0200)
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 <somnath.kotur@broadcom.com>
Acked-by: Gaetan Rivet <grive@u256.net>
drivers/bus/pci/linux/pci.c

index 740a2cd..71b0a30 100644 (file)
@@ -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);
                        }