Hi Xueming,

 

Yes, we need the fix.

It should be backporting to 23.11.x, since the previous commit “bus/vdev: fix devargs in secondary process” which is also backporting to 23.11.1 that cause bug 1450 – Regression: vdev device not setup in secondary process (dpdk.org) exists in 23.11 stable branch.

This bug’s resolution is the fix (http://git.dpdk.org/dpdk/commit/?id=22ce39b3aa) in main branch, so pls schedule this fix patch to 23.11.3.

 

root@virtio-tester-217:~/jiangyu/LTS/dpdk# git show 6148604a43

commit 6148604a438aad21e5d74f414976666b370582c1

Author: Mingjin Ye mingjinx.ye@intel.com

Date:   Fri Sep 1 07:24:09 2023 +0000

 

    bus/vdev: fix devargs in secondary process

 

    [ upstream commit 6666628362c94a0b567a39a0177539c12c97d999 ]

 

    When a device is created by a secondary process, an empty devargs is

    temporarily generated and bound to it. This causes the device to not

    be associated with the correct devargs, and the empty devargs are not

    released when the resource is freed.

 

    This patch fixes the issue by matching the devargs when inserting a

    device in secondary process.

 

    Fixes: dda987315ca2 ("vdev: make virtual bus use its device struct")

    Fixes: a16040453968 ("eal: extract vdev infra")

 

    Signed-off-by: Mingjin Ye mingjinx.ye@intel.com

    Acked-by: Anatoly Burakov anatoly.burakov@intel.com

 

Best regards,

Yu Jiang

 

From: Xueming Li <xuemingl@nvidia.com>
Sent: Saturday, August 31, 2024 10:51 PM
To: Ye, MingjinX <mingjinx.ye@intel.com>; Xu, HailinX <hailinx.xu@intel.com>
Cc: dpdk stable <stable@dpdk.org>
Subject: Re: patch 'bus/vdev: revert fix devargs in secondary process' has been queued to stable release 23.11.2

 

Hi Hailin,

 

This patch was originally queued to 23.11.2 list, but removed per Mingjin's request. If we do need the fix, let's schedule it to 23.11.3.

 

Regards,

Xueming


From: Ye, MingjinX <mingjinx.ye@intel.com>
Sent: Wednesday, July 17, 2024 10:21 AM
To: Xueming Li <
xuemingl@nvidia.com>
Cc: dpdk stable <
stable@dpdk.org>
Subject: RE: patch 'bus/vdev: revert fix devargs in secondary process' has been queued to stable release 23.11.2

 

Hi,

Please not backport this revert commit. DPDK 23.11.2 does not need to do anything.

Thanks,
Mingjin

> -----Original Message-----
> From: Xueming Li <
xuemingl@nvidia.com>
> Sent: Friday, July 12, 2024 7:02 PM
> To: Ye, MingjinX <
mingjinx.ye@intel.com>
> Cc: dpdk stable <
stable@dpdk.org>
> Subject: patch 'bus/vdev: revert fix devargs in secondary process' has been
> queued to stable release 23.11.2
>
> Hi,
>
> FYI, your patch has been queued to stable release 23.11.2
>
> Note it hasn't been pushed to
http://dpdk.org/browse/dpdk-stable yet.
> It will be pushed if I get no objections before 07/14/24. So please shout if
> anyone has objections.
>
> Also note that after the patch there's a diff of the upstream commit vs the
> patch applied to the branch. This will indicate if there was any rebasing
> needed to apply to the stable branch. If there were code changes for
> rebasing
> (ie: not only metadata diffs), please double check that the rebase was
> correctly done.
>
> Queued patches are on a temporary branch at:
>
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging
>
> This queued commit can be viewed at:
>
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-
> staging&id=8b75cfb86f90c816bdda28b8696beb18d553fd2b
>
> Thanks.
>
> Xueming Li <
xuemingl@nvidia.com>
>
> ---
> From 8b75cfb86f90c816bdda28b8696beb18d553fd2b Mon Sep 17 00:00:00
> 2001
> From: Mingjin Ye <
mingjinx.ye@intel.com>
> Date: Thu, 14 Mar 2024 09:36:28 +0000
> Subject: [PATCH] bus/vdev: revert fix devargs in secondary process
> Cc: Xueming Li <
xuemingl@nvidia.com>
>
> [ 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>
> ---
>  drivers/bus/vdev/vdev.c | 21 +--------------------
>  1 file changed, 1 insertion(+), 20 deletions(-)
>
> diff --git a/drivers/bus/vdev/vdev.c b/drivers/bus/vdev/vdev.c index
> 14cf856237..38d05a9fe9 100644
> --- a/drivers/bus/vdev/vdev.c
> +++ b/drivers/bus/vdev/vdev.c
> @@ -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;
> --
> 2.34.1
>
> ---
>   Diff of the applied patch vs upstream commit (please double-check if non-
> empty:
> ---
> --- - 2024-07-12 18:40:18.570682691 +0800
> +++ 0100-bus-vdev-revert-fix-devargs-in-secondary-process.patch       2024-
> 07-12 18:40:14.356594197 +0800
> @@ -1 +1 @@
> -From 22ce39b3aadb109cbefabb91aad44c94e8c2a5e6 Mon Sep 17 00:00:00
> 2001
> +From 8b75cfb86f90c816bdda28b8696beb18d553fd2b Mon Sep 17 00:00:00
> 2001
> @@ -4,0 +5,3 @@
> +Cc: Xueming Li <
xuemingl@nvidia.com>
> +
> +[ upstream commit 22ce39b3aadb109cbefabb91aad44c94e8c2a5e6 ]
> @@ -20 +22,0 @@
> -Cc:
stable@dpdk.org