Skip to content

Commit

Permalink
bus/vdev: revert fix devargs in secondary process
Browse files Browse the repository at this point in the history
[ upstream commit 22ce39b3aadb109cbefabb91aad44c94e8c2a5e6 ]

The ASan tool detected a memory leak in the vdev driver
alloc_devargs. The previous commit was that when inserting
a vdev device, the primary process alloc devargs and the
secondary process looks for devargs. This causes the
device to not be created if the secondary process does
not initialise the vdev device. And, this is not the
root cause.

Therefore the following commit was reverted accordingly.

After restoring this commit, the memory leak still exists.

Bugzilla ID: 1450
Fixes: 6666628362c9 ("bus/vdev: fix devargs in secondary process")

Signed-off-by: Mingjin Ye <mingjinx.ye@intel.com>
  • Loading branch information
yemj-odc authored and bluca committed Jun 24, 2024
1 parent 1620b6d commit 6a30502
Showing 1 changed file with 1 addition and 20 deletions.
21 changes: 1 addition & 20 deletions drivers/bus/vdev/vdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -263,22 +263,6 @@ alloc_devargs(const char *name, const char *args)
return devargs;
}

static struct rte_devargs *
vdev_devargs_lookup(const char *name)
{
struct rte_devargs *devargs;
char dev_name[32];

RTE_EAL_DEVARGS_FOREACH("vdev", devargs) {
devargs->bus->parse(devargs->name, &dev_name);
if (strcmp(dev_name, name) == 0) {
VDEV_LOG(INFO, "devargs matched %s", dev_name);
return devargs;
}
}
return NULL;
}

static int
insert_vdev(const char *name, const char *args,
struct rte_vdev_device **p_dev,
Expand All @@ -291,10 +275,7 @@ insert_vdev(const char *name, const char *args,
if (name == NULL)
return -EINVAL;

if (rte_eal_process_type() == RTE_PROC_PRIMARY)
devargs = alloc_devargs(name, args);
else
devargs = vdev_devargs_lookup(name);
devargs = alloc_devargs(name, args);

if (!devargs)
return -ENOMEM;
Expand Down

0 comments on commit 6a30502

Please sign in to comment.