DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Ye, MingjinX" <mingjinx.ye@intel.com>
To: Thomas Monjalon <thomas@monjalon.net>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
	"stable@dpdk.org" <stable@dpdk.org>,
	"stephen@networkplumber.org" <stephen@networkplumber.org>,
	"Richardson, Bruce" <bruce.richardson@intel.com>,
	"Marchand, David" <david.marchand@redhat.com>
Subject: RE: [PATCH 2/3] bus/vdev: revert fix devargs after multi-process bus scan
Date: Thu, 20 Jun 2024 06:10:51 +0000	[thread overview]
Message-ID: <LV3PR11MB86015F9C7C07E67F7132B358E5C82@LV3PR11MB8601.namprd11.prod.outlook.com> (raw)
In-Reply-To: <2735147.hTDNKPQEx9@thomas>



> -----Original Message-----
> From: Thomas Monjalon <thomas@monjalon.net>
> Sent: Thursday, June 20, 2024 4:15 AM
> To: Ye, MingjinX <mingjinx.ye@intel.com>
> Cc: dev@dpdk.org; stable@dpdk.org; stephen@networkplumber.org;
> Richardson, Bruce <bruce.richardson@intel.com>; Marchand, David
> <david.marchand@redhat.com>
> Subject: Re: [PATCH 2/3] bus/vdev: revert fix devargs after multi-process bus
> scan
> 
> 14/03/2024 10:36, Mingjin Ye:
> > The asan tool detected a memory leak in the vdev driver alloc_devargs.
> > The previous commit does not insert device arguments into devargs_list
> 
> What is the previous commit?
commit: f5b2eff0847d49a66301f0046502c6232cd5da3f


> Where is devargs_list in this function?
In the rte_devargs_insert function.
> 
> > when attaching a device during a bus scan of a secondary process.
> > This resulted in an existing memory leak when removing a vdev device,
> > since rte_devargs_remove actually does nothing.
> >
> > Therefore the following commit was reverted accordingly.
> >
> > Fixes: f5b2eff0847d ("bus/vdev: fix devargs after multi-process bus
> > scan")
> >
> > Restoring this commit will fix the memory leak. There was an issue
> > with device parameters using free devargs when inserting a vdev device
> > when devargs_list already existed, resulting in a core dump. A new
> > patch will fix this issue.
> >
> > Fixes: f5b2eff0847d ("bus/vdev: fix devargs after multi-process bus
> > scan")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Mingjin Ye <mingjinx.ye@intel.com>
> 
> I'm not comfortable with reverting a so old commit.
> Your previous attempt in this bus driver was not successful.
> Please prove the memory leak cannot be simply fixed.

dpdk/drivers/bus/vdev/vdev.c:471
ret = insert_vdev(in->name, NULL, NULL, false);

Since the last argument is always fale, this results in the objects of alloc_devargs in insert_vdev not being added to the devargs_list via rte_devargs_insert.

rte_vdev_uninit->rte_devargs_remove will release the devargs objects constructed through the program startup parameters. 
however the devargs bound to the device (the devargs objects constructed in insert_vdev) are not released. causing a memory leak.

Therefore, after undoing the patch. insert_vdev->rte_devargs_insert can update the devargs object without causing a memory leak.
> 


  reply	other threads:[~2024-06-20  6:10 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-14  9:36 [PATCH 0/3] fix insert dev core dump Mingjin Ye
2024-03-14  9:36 ` [PATCH 1/3] bus/vdev: revert fix devargs in secondary process Mingjin Ye
2024-06-19 20:12   ` Thomas Monjalon
2024-03-14  9:36 ` [PATCH 2/3] bus/vdev: revert fix devargs after multi-process bus scan Mingjin Ye
2024-06-19 20:15   ` Thomas Monjalon
2024-06-20  6:10     ` Ye, MingjinX [this message]
2024-03-14  9:36 ` [PATCH 3/3] net/vdev: fix insert vdev core dump Mingjin Ye
2024-03-15  5:51   ` Jiang, YuX
2024-06-19 20:16   ` Thomas Monjalon
2024-06-20  6:41     ` Ye, MingjinX

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=LV3PR11MB86015F9C7C07E67F7132B358E5C82@LV3PR11MB8601.namprd11.prod.outlook.com \
    --to=mingjinx.ye@intel.com \
    --cc=bruce.richardson@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=stable@dpdk.org \
    --cc=stephen@networkplumber.org \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).