[dpdk-dev] [PATCH] bus/vdev: fix uninitialized device bus

Qi Zhang qi.z.zhang at intel.com
Mon Oct 22 07:47:11 CEST 2018


Device bus should be initialized after bus scan.
While it does not happened when scan vdev from secondary process,
that cause segment fault at rte_dev_probe when call dev->bus->xxx.

Fixes: cdb068f031c6 ("bus/vdev: scan by multi-process channel")
Cc: stable at dpdk.org

Signed-off-by: Qi Zhang <qi.z.zhang at intel.com>
---
 drivers/bus/vdev/vdev.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/bus/vdev/vdev.c b/drivers/bus/vdev/vdev.c
index 0142fb2c8..7d658fdf7 100644
--- a/drivers/bus/vdev/vdev.c
+++ b/drivers/bus/vdev/vdev.c
@@ -222,6 +222,7 @@ insert_vdev(const char *name, const char *args, struct rte_vdev_device **p_dev)
 		goto fail;
 	}
 
+	dev->device.bus = &rte_vdev_bus;
 	dev->device.devargs = devargs;
 	dev->device.numa_node = SOCKET_ID_ANY;
 	dev->device.name = devargs->name;
-- 
2.13.6



More information about the dev mailing list