[1/3] bus/vdev: revert fix devargs in secondary process
Checks
Commit Message
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.
Fixes: 6666628362c9 ("bus/vdev: fix devargs in secondary process")
After restoring this commit, the memory leak still exists.
A new patch has since fixed this issue.
Fixes: 6666628362c9 ("bus/vdev: fix devargs in secondary process")
Cc: stable@dpdk.org
Signed-off-by: Mingjin Ye <mingjinx.ye@intel.com>
---
drivers/bus/vdev/vdev.c | 21 +--------------------
1 file changed, 1 insertion(+), 20 deletions(-)
Comments
14/03/2024 10:36, Mingjin Ye:
> 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.
>
> Fixes: 6666628362c9 ("bus/vdev: fix devargs in secondary process")
>
> After restoring this commit, the memory leak still exists.
> A new patch has since fixed this issue.
>
> Fixes: 6666628362c9 ("bus/vdev: fix devargs in secondary process")
> Cc: stable@dpdk.org
>
> Signed-off-by: Mingjin Ye <mingjinx.ye@intel.com>
Applied
The rest of the series is not cleared enough to be applied.
We need more precise explanation of the problem to solve,
and some good reviews please.
At this stage I'm confident enough only for this revert.
@@ -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,
@@ -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;