From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 79367A0545 for ; Wed, 3 Aug 2022 15:23:42 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7048C42B9D; Wed, 3 Aug 2022 15:23:42 +0200 (CEST) Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by mails.dpdk.org (Postfix) with ESMTP id 064F340141; Wed, 3 Aug 2022 15:23:38 +0200 (CEST) Received: from dggpemm500020.china.huawei.com (unknown [172.30.72.57]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4LyXZy2S2MzTgV0; Wed, 3 Aug 2022 21:22:18 +0800 (CST) Received: from dggpemm100016.china.huawei.com (7.185.36.192) by dggpemm500020.china.huawei.com (7.185.36.49) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Wed, 3 Aug 2022 21:23:36 +0800 Received: from dggpemm500008.china.huawei.com (7.185.36.136) by dggpemm100016.china.huawei.com (7.185.36.192) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Wed, 3 Aug 2022 21:23:35 +0800 Received: from dggpemm500008.china.huawei.com ([7.185.36.136]) by dggpemm500008.china.huawei.com ([7.185.36.136]) with mapi id 15.01.2375.024; Wed, 3 Aug 2022 21:23:35 +0800 From: wangyunjian To: Matan Azrad , "dev@dpdk.org" CC: Slava Ovsiienko , Dmitry Kozlyuk , Huangshaozhang , "stable@dpdk.org" Subject: RE: [dpdk-dev] [PATCH 1/1] net/mlx5: fix memory leak when releasing a drop action Thread-Topic: [dpdk-dev] [PATCH 1/1] net/mlx5: fix memory leak when releasing a drop action Thread-Index: AQHYpADitWnXxutJz0yH8L2dvwkFYq2XiN6AgAWmE3A= Date: Wed, 3 Aug 2022 13:23:35 +0000 Message-ID: <05a504bb39d84177af4e786e8bc3d403@huawei.com> References: <004c86e8ddf05bb9d3df77580357c4eca852c013.1659177063.git.wangyunjian@huawei.com> In-Reply-To: Accept-Language: zh-CN, en-US Content-Language: zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.174.242.157] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-CFilter-Loop: Reflected X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org > -----Original Message----- > From: Matan Azrad [mailto:matan@nvidia.com] > Sent: Sunday, July 31, 2022 3:02 PM > To: wangyunjian ; dev@dpdk.org > Cc: Slava Ovsiienko ; Dmitry Kozlyuk > ; Huangshaozhang ; > stable@dpdk.org > Subject: RE: [dpdk-dev] [PATCH 1/1] net/mlx5: fix memory leak when releas= ing a > drop action >=20 > Hi Yunjian >=20 > From: Yunjian Wang > > When the memory for hrxq->action is allocated in mlx5_devx_hrxq_new(). >=20 > Memory -> resources .. are >=20 > > But it was not being freed when the drop action was released in > > mlx5_devx_drop_action_destroy(). These cause a memory leak. > > > > Fixes: bc5bee028ebc ("net/mlx5: create drop queue using DevX") > > Cc: stable@dpdk.org > > > > Signed-off-by: Yunjian Wang > > --- > > drivers/net/mlx5/mlx5_devx.c | 6 ++++++ > > 1 file changed, 6 insertions(+) > > > > diff --git a/drivers/net/mlx5/mlx5_devx.c > > b/drivers/net/mlx5/mlx5_devx.c index 6886ae1f22..171ce5c08a 100644 > > --- a/drivers/net/mlx5/mlx5_devx.c > > +++ b/drivers/net/mlx5/mlx5_devx.c > > @@ -1097,6 +1097,12 @@ mlx5_devx_drop_action_destroy(struct > > rte_eth_dev *dev) > > mlx5_devx_ind_table_destroy(hrxq->ind_table); > > if (priv->drop_queue.rxq->devx_rq.rq !=3D NULL) > > mlx5_rxq_devx_obj_drop_release(dev); > > +#ifdef HAVE_IBV_FLOW_DV_SUPPORT > > + if (hrxq->action !=3D NULL) { > > + mlx5_glue->destroy_flow_action(hrxq->action); > > + hrxq->action =3D NULL; > > + } > > +#endif >=20 > Good catch for the leak. > I think the issue is in mlx5_devx_tir_destroy and not related only to the= drop > queue management. > So the fix should be for the mlx5_devx_tir_destroy. What do you think? Agree, I fix it.=20 https://patchwork.dpdk.org/project/dpdk/patch/ba20dc6b94576f29cd2c9aa10672c= 700b20ce819.1659526016.git.wangyunjian@huawei.com/ Thanks. >=20 >=20 >=20 > > } > > > > /** > > -- > > 2.27.0