summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorQi Zhang <qi.z.zhang@intel.com>2018-10-25 11:30:36 +0800
committerThomas Monjalon <thomas@monjalon.net>2018-10-28 18:32:22 +0100
commitf5b2eff0847d49a66301f0046502c6232cd5da3f (patch)
treef47f7d3cc79c21fb94ef65d9dfda5430182d01a4 /drivers
parentc7810c319d5f70c7d3c1b878f9431dc17dc1b6bc (diff)
downloaddpdk-f5b2eff0847d49a66301f0046502c6232cd5da3f.zip
dpdk-f5b2eff0847d49a66301f0046502c6232cd5da3f.tar.gz
dpdk-f5b2eff0847d49a66301f0046502c6232cd5da3f.tar.xz
bus/vdev: fix devargs after multi-process bus scan
It's not necessary to insert device argment to devargs_list during bus scan, but this happens when we try to attach a device on secondary process. The patch fix the issue. Fixes: cdb068f031c6 ("bus/vdev: scan by multi-process channel") Cc: stable@dpdk.org Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/bus/vdev/vdev.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/bus/vdev/vdev.c b/drivers/bus/vdev/vdev.c
index 685cc4e..6952724 100644
--- a/drivers/bus/vdev/vdev.c
+++ b/drivers/bus/vdev/vdev.c
@@ -202,7 +202,9 @@ alloc_devargs(const char *name, const char *args)
}
static int
-insert_vdev(const char *name, const char *args, struct rte_vdev_device **p_dev)
+insert_vdev(const char *name, const char *args,
+ struct rte_vdev_device **p_dev,
+ bool init)
{
struct rte_vdev_device *dev;
struct rte_devargs *devargs;
@@ -237,7 +239,8 @@ insert_vdev(const char *name, const char *args, struct rte_vdev_device **p_dev)
}
TAILQ_INSERT_TAIL(&vdev_device_list, dev, next);
- rte_devargs_insert(devargs);
+ if (init)
+ rte_devargs_insert(devargs);
if (p_dev)
*p_dev = dev;
@@ -257,7 +260,7 @@ rte_vdev_init(const char *name, const char *args)
int ret;
rte_spinlock_recursive_lock(&vdev_device_list_lock);
- ret = insert_vdev(name, args, &dev);
+ ret = insert_vdev(name, args, &dev, true);
if (ret == 0) {
ret = vdev_probe_all_drivers(dev);
if (ret) {
@@ -383,7 +386,7 @@ vdev_action(const struct rte_mp_msg *mp_msg, const void *peer)
break;
case VDEV_SCAN_ONE:
VDEV_LOG(INFO, "receive vdev, %s", in->name);
- ret = insert_vdev(in->name, NULL, NULL);
+ ret = insert_vdev(in->name, NULL, NULL, false);
if (ret == -EEXIST)
VDEV_LOG(DEBUG, "device already exist, %s", in->name);
else if (ret < 0)