From: Gaetan Rivet Date: Mon, 23 Apr 2018 23:54:44 +0000 (+0200) Subject: bus/vdev: do not reference devargs list X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=1f6d16ee63313ff0444e0a4287958ba8eaa196a3;p=dpdk.git bus/vdev: do not reference devargs list This list should not be operated upon by drivers. Use the public API to achieve the same functionalities. Signed-off-by: Gaetan Rivet Acked-by: Jianfeng Tan Acked-by: Thomas Monjalon --- diff --git a/drivers/bus/vdev/vdev.c b/drivers/bus/vdev/vdev.c index 38ed70a7f0..45ef058945 100644 --- a/drivers/bus/vdev/vdev.c +++ b/drivers/bus/vdev/vdev.c @@ -229,7 +229,7 @@ insert_vdev(const char *name, const char *args, struct rte_vdev_device **p_dev) } TAILQ_INSERT_TAIL(&vdev_device_list, dev, next); - TAILQ_INSERT_TAIL(&devargs_list, devargs, next); + rte_eal_devargs_insert(devargs); if (p_dev) *p_dev = dev; @@ -259,9 +259,7 @@ rte_vdev_init(const char *name, const char *args) /* If fails, remove it from vdev list */ devargs = dev->device.devargs; TAILQ_REMOVE(&vdev_device_list, dev, next); - TAILQ_REMOVE(&devargs_list, devargs, next); - free(devargs->args); - free(devargs); + rte_eal_devargs_remove(devargs->bus->name, devargs->name); free(dev); } } @@ -309,9 +307,7 @@ rte_vdev_uninit(const char *name) TAILQ_REMOVE(&vdev_device_list, dev, next); devargs = dev->device.devargs; - TAILQ_REMOVE(&devargs_list, devargs, next); - free(devargs->args); - free(devargs); + rte_eal_devargs_remove(devargs->bus->name, devargs->name); free(dev); unlock: @@ -443,10 +439,7 @@ vdev_scan(void) rte_spinlock_unlock(&vdev_custom_scan_lock); /* for virtual devices we scan the devargs_list populated via cmdline */ - TAILQ_FOREACH(devargs, &devargs_list, next) { - - if (devargs->bus != &rte_vdev_bus) - continue; + RTE_EAL_DEVARGS_FOREACH("vdev", devargs) { dev = calloc(1, sizeof(*dev)); if (!dev)