From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yw1-f66.google.com (mail-yw1-f66.google.com [209.85.161.66]) by dpdk.org (Postfix) with ESMTP id 521951B4BB for ; Fri, 23 Nov 2018 03:25:36 +0100 (CET) Received: by mail-yw1-f66.google.com with SMTP id h32so4272501ywk.2 for ; Thu, 22 Nov 2018 18:25:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=IB0gtPb4nV1jTLCA0Ajj7i11I6FEaz/q69Tr3mrazsE=; b=CKsxxPYIRxzVtBN5G/BlNaMCSYchI7QrJBDUZ68E4CMTYctNcrEwBICrSt4U6DCPld cpVlBJAO+vXuh/KzDVpButHdSMoB2IvSJezybnqugVXhdk/OkI1JT2IKaN/YubvsgwDW x8lE8eUsP0BpEwbzUf57fG2i2sEZctmUjX+laWloBgoDq16CrFglK/rkIubuDOZbLg7q kvNhOiDpmNmld3tHaCE8O8W64TDMHZOjmhPwm+At/BfgFH2doqXMv6UX1gz5S9OBdDpj tsJ8r1r/IWMBkVO/dwawC3b8+vPlfFbll4wObT24IsQ2IlIrNzZFW05CPwEAyV/Gf4O8 wCsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=IB0gtPb4nV1jTLCA0Ajj7i11I6FEaz/q69Tr3mrazsE=; b=NxW8BhadKK7gL/J2yzSTLFdgsPUdpc/ydXyKR7MHJed0afQsj7L9IrQQxcL4G2TlQa TUkf7UB/Qv3W6cwXnzBPhOIvaexqWps1BFozLrxcYrLU3knH7H1bT+syweFDB5WFMmX+ FlCT+jw/rvxn+neiDFdCWSaXNJ7LLcxwuofqfaLndFbW9j9as2Z1R60tCYk6+1lcdWJ0 ddOj5zfdgYH5ly93rx1pi08dJs1jkHGsvGBK9xBO8zVK01TI2sPQNQS0ya8OmSSxMAvt iUVZpo1+vzNwMUTCUNGdBENuVNx5CbyzoqxwPpLPtmHitv1/EuLuI6vPGXKs7ss0XeOm LZMA== X-Gm-Message-State: AGRZ1gKw83KtUxsVusu3wlzkoEGlST78fNQWu1hlfrtcFkm2F/x7Wmvp aX0CyFX75SRZpn+qiv602kug7RQDp9eVy9dqZCr8K7A/ X-Google-Smtp-Source: AJdET5etWpEHa8biNbb8MyianlJL9FCkyWya+405PJN4h9RWRSjLuEumhmvNzkkH5M2OsnXJpcx3pVgd4Cyrd7vFmUo= X-Received: by 2002:a81:b61a:: with SMTP id u26mr13689972ywh.428.1542939935712; Thu, 22 Nov 2018 18:25:35 -0800 (PST) MIME-Version: 1.0 References: <20181121131127.28528-1-wanlebing@didichuxing.com> <219e09d4-5516-b297-3e85-d4078e55a2fd@intel.com> In-Reply-To: <219e09d4-5516-b297-3e85-d4078e55a2fd@intel.com> From: lebing wan Date: Fri, 23 Nov 2018 10:25:21 +0800 Message-ID: To: ferruh.yigit@intel.com Cc: dev@dpdk.org, konstantin.ananyev@intel.com, wanlebing Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [PATCH] ethdev: fix memory leak on removing eth rxtx callback X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 02:25:36 -0000 Any update? Ferruh Yigit =E4=BA=8E2018=E5=B9=B411=E6=9C=8821= =E6=97=A5=E5=91=A8=E4=B8=89 =E4=B8=8B=E5=8D=8810:48=E5=86=99=E9=81=93=EF=BC= =9A > 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 > > Signed-off-by: wanlebing > > --- > > 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 =3D=3D user_cb) { > > /* Remove the user cb from the callback list. */ > > *prev_cb =3D cb->next; > > + rte_free(cb); > > ret =3D 0; > > break; > > } > > @@ -3960,6 +3961,7 @@ rte_eth_remove_tx_callback(uint16_t port_id, > uint16_t queue_id, > > if (cb =3D=3D user_cb) { > > /* Remove the user cb from the callback list. */ > > *prev_cb =3D cb->next; > > + rte_free(cb); > > ret =3D 0; > > break; > > } > > > >