From: 万乐冰 <wanlebing@gmail.com>
To: ferruh.yigit@intel.com
Cc: dev@dpdk.org, konstantin.ananyev@intel.com,
wanlebing <wanlebing@didichuxing.com>
Subject: Re: [dpdk-dev] [PATCH] ethdev: fix memory leak on removing eth rxtx callback
Date: Thu, 22 Nov 2018 10:32:46 +0800 [thread overview]
Message-ID: <CAFvSgXyrx8TR6SnakdOcSuuLmuTB0T305gv_jOMUdthbMpU5xg@mail.gmail.com> (raw)
In-Reply-To: <219e09d4-5516-b297-3e85-d4078e55a2fd@intel.com>
cc konstantin.ananyev
konstantin.ananyev, please help.
Ferruh Yigit <ferruh.yigit@intel.com> 于2018年11月21日周三 下午10:48写道:
> On 11/21/2018 1:11 PM, wanlebing wrote:
> > eth rxtx callback is dynamically allocated using rte_zmalloc()
> > but not released. Fix it by calling rte_free() to free callback
> > when removing rxtx callback.
>
> I guess they are not freed intentionally because there is no safe way to
> do it.
> I remember Konstantin sent an RFC in the past to rework the callbacks,
> cc'ed him
> for more details.
>
> >
> > Signed-off-by: wanlebing <wanlebing@didichuxing.com>
> > Signed-off-by: wanlebing <wanlebing@gmail.com>
> > ---
> > lib/librte_ethdev/rte_ethdev.c | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> > diff --git a/lib/librte_ethdev/rte_ethdev.c
> b/lib/librte_ethdev/rte_ethdev.c
> > index 5f858174b..f00311047 100644
> > --- a/lib/librte_ethdev/rte_ethdev.c
> > +++ b/lib/librte_ethdev/rte_ethdev.c
> > @@ -3926,6 +3926,7 @@ rte_eth_remove_rx_callback(uint16_t port_id,
> uint16_t queue_id,
> > if (cb == user_cb) {
> > /* Remove the user cb from the callback list. */
> > *prev_cb = cb->next;
> > + rte_free(cb);
> > ret = 0;
> > break;
> > }
> > @@ -3960,6 +3961,7 @@ rte_eth_remove_tx_callback(uint16_t port_id,
> uint16_t queue_id,
> > if (cb == user_cb) {
> > /* Remove the user cb from the callback list. */
> > *prev_cb = cb->next;
> > + rte_free(cb);
> > ret = 0;
> > break;
> > }
> >
>
>
next prev parent reply other threads:[~2018-11-22 2:33 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-21 13:11 wanlebing
2018-11-21 14:48 ` Ferruh Yigit
2018-11-22 2:32 ` 万乐冰 [this message]
2018-11-23 2:25 ` lebing wan
2018-11-23 9:13 ` Ananyev, Konstantin
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=CAFvSgXyrx8TR6SnakdOcSuuLmuTB0T305gv_jOMUdthbMpU5xg@mail.gmail.com \
--to=wanlebing@gmail.com \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@intel.com \
--cc=konstantin.ananyev@intel.com \
--cc=wanlebing@didichuxing.com \
/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).