bus/vdev: fix uninitialized device bus
Checks
Commit Message
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@dpdk.org
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
drivers/bus/vdev/vdev.c | 1 +
1 file changed, 1 insertion(+)
Comments
22/10/2018 07:47, Qi Zhang:
> 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@dpdk.org
>
> Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
22/10/2018 09:02, Thomas Monjalon:
> 22/10/2018 07:47, Qi Zhang:
> > 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@dpdk.org
> >
> > Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
>
> Acked-by: Thomas Monjalon <thomas@monjalon.net>
Applied, thanks
@@ -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;