[dpdk-dev] [PATCH 1/2] bus/pci: fix driver detach clear

Matan Azrad matan at mellanox.com
Tue Nov 12 09:47:38 CET 2019


When a rte_device is unplugged, the driver should be detached from the
device.

The PCI detach driver operation wrongly didn't clear the driver from the
device structure what remain the device in probe state from the EAL
point of view.

Clear the driver in driver detach successful operation.

Fixes: dbe6b4b61b0e ("pci: probe or close device")
Cc: mukawa at igel.co.jp
Cc: stable at dpdk.org

Signed-off-by: Matan Azrad <matan at mellanox.com>
---
 drivers/bus/pci/pci_common.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/bus/pci/pci_common.c b/drivers/bus/pci/pci_common.c
index 6b46b4f..3f55420 100644
--- a/drivers/bus/pci/pci_common.c
+++ b/drivers/bus/pci/pci_common.c
@@ -247,6 +247,7 @@ static struct rte_devargs *pci_devargs_lookup(struct rte_pci_device *dev)
 
 	/* clear driver structure */
 	dev->driver = NULL;
+	dev->device.driver = NULL;
 
 	if (dr->drv_flags & RTE_PCI_DRV_NEED_MAPPING)
 		/* unmap resources for devices that use igb_uio */
-- 
1.8.3.1



More information about the dev mailing list