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 95197A00C5 for ; Thu, 29 Sep 2022 03:51:18 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8B33941140; Thu, 29 Sep 2022 03:51:18 +0200 (CEST) Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by mails.dpdk.org (Postfix) with ESMTP id 8B88840DDC; Thu, 29 Sep 2022 03:51:15 +0200 (CEST) Received: from dggpemm500020.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4MdGSJ0cZGzlVtJ; Thu, 29 Sep 2022 09:46:56 +0800 (CST) Received: from dggpemm100015.china.huawei.com (7.185.36.61) 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.31; Thu, 29 Sep 2022 09:51:13 +0800 Received: from dggpemm500008.china.huawei.com (7.185.36.136) by dggpemm100015.china.huawei.com (7.185.36.61) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Thu, 29 Sep 2022 09:51:13 +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.031; Thu, 29 Sep 2022 09:51:13 +0800 From: wangyunjian To: Slava Ovsiienko , "dev@dpdk.org" CC: Matan Azrad , Raslan Darawsheh , Dmitry Kozlyuk , Huangshaozhang , "stable@dpdk.org" Subject: RE: [dpdk-dev] [PATCH v2 2/2] net/mlx5: fix resource leak when releasing a drop action Thread-Topic: [dpdk-dev] [PATCH v2 2/2] net/mlx5: fix resource leak when releasing a drop action Thread-Index: AQHYtrwEpdIfc1hTyUCiPjEyb4FJf63s8SEwgATZnACABBOQMA== Date: Thu, 29 Sep 2022 01:51:12 +0000 Message-ID: <3b5bef9558094f19b467513823ea0e13@huawei.com> References: <429c86ba3b944c99a4b50978d456e781@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 I agree with you. Can you fix it? Thanks Yunjian > -----Original Message----- > From: Slava Ovsiienko [mailto:viacheslavo@nvidia.com] > Sent: Tuesday, September 27, 2022 3:36 AM > To: wangyunjian ; dev@dpdk.org > Cc: Matan Azrad ; Raslan Darawsheh > ; Dmitry Kozlyuk ; > Huangshaozhang ; stable@dpdk.org > Subject: RE: [dpdk-dev] [PATCH v2 2/2] net/mlx5: fix resource leak when > releasing a drop action >=20 > Hi, Yunjian >=20 > We have drop action in mlx5. > To create/destroy drop action we have > mlx5_drop_action_create/ mlx5_drop_action_destroy common routines. >=20 > As PMD supports operation either over FW (Verbs in rdma_core) or SW/HW > steering with DevX objects the "virtual" methods are used for objects: >=20 > priv->obj_ops.drop_action_create(dev) - create drop action > a) mlx5_ibv_drop_action_create()- use Verbs (dv-flow_en =3D=3D 0) > b) mlx5_devx_drop_action_create() - use DevX (dv-flow_en !=3D 0) >=20 > priv->obj_ops.drop_action_destroy(dev) - destroy drop action > a) mlx5_ibv_drop_action_destroy()- use Verbs (dv-flow_en =3D=3D 0) > b) mlx5_devx_drop_action_destroy() - use DevX (dv-flow_en !=3D 0) >=20 >=20 > Let's consider DevX case. > mlx5_devx_drop_action_create() > mlx5_rxq_devx_obj_drop_create() > mlx5_devx_ind_table_new() > mlx5_devx_hrxq_new() > xxx_create_dest_tir() > xxx_action_create_dest_tir() >=20 >=20 > mlx5_devx_drop_action_destroy() > /* It seems action destroy is missing here */ > mlx5_devx_tir_destroy() > mlx5_devx_ind_table_destroy() > mlx5_rxq_devx_obj_drop_release() >=20 > So, yes, I agree. There is missing action destroy, it seems we have leaka= ge. >=20 > Let's look at > __mlx5_hrxq_remove() > destroy_action() > priv->obj_ops.hrxq_destroy(); >=20 >=20 > And there we have a problem. > obj_ops.hrxq_destroy() - not always mlx5_devx_tir_destroy() is called. > It might be mlx5_ibv_qp_destroy() (for Verbas) and patch would not work. >=20 > So, instead of fixing __mlx5_hrxq_remove() and mlx5_devx_tir_destroy() > I would consider patching: > - mlx5_devx_drop_action_destroy() > - mlx5_ibv_drop_action_destroy > by adding action desatroying. >=20 > With best regards, > Slava >=20 >=20 > > -----Original Message----- > > From: wangyunjian > > Sent: Friday, September 23, 2022 12:32 > > To: dev@dpdk.org > > Cc: Matan Azrad ; Raslan Darawsheh > ; > > Slava Ovsiienko ; Dmitry Kozlyuk > > ; Huangshaozhang > ; > > stable@dpdk.org > > Subject: RE: [dpdk-dev] [PATCH v2 2/2] net/mlx5: fix resource leak when > > releasing a drop action > > > > Friendly ping. > > > > > -----Original Message----- > > > From: wangyunjian > > > Sent: Tuesday, August 23, 2022 2:46 PM > > > To: dev@dpdk.org > > > Cc: matan@nvidia.com; rasland@nvidia.com; viacheslavo@nvidia.com; > > > dkozlyuk@nvidia.com; Huangshaozhang ; > > > wangyunjian ; stable@dpdk.org > > > Subject: [dpdk-dev] [PATCH v2 2/2] net/mlx5: fix resource leak when > > > releasing a drop action > > > > > > Currently, the resources for hrxq->action are allocated in > > > mlx5_devx_hrxq_new(). But it was not being freed when the drop action > > > was released in mlx5_devx_drop_action_destroy(). > > > So, fix is to free the resources in mlx5_devx_tir_destroy(). > > > > > > Fixes: bc5bee028ebc ("net/mlx5: create drop queue using DevX") > > > Cc: stable@dpdk.org > > > > > > Signed-off-by: Yunjian Wang > > > --- > > > drivers/net/mlx5/mlx5_devx.c | 7 +++++++ drivers/net/mlx5/mlx5_rxq.= c > > > | > > > 6 ------ > > > 2 files changed, 7 insertions(+), 6 deletions(-) > > > > > > diff --git a/drivers/net/mlx5/mlx5_devx.c > > > b/drivers/net/mlx5/mlx5_devx.c index > > > 6886ae1f22..09c8856f05 100644 > > > --- a/drivers/net/mlx5/mlx5_devx.c > > > +++ b/drivers/net/mlx5/mlx5_devx.c > > > @@ -907,6 +907,13 @@ mlx5_devx_hrxq_new(struct rte_eth_dev *dev, > > > struct mlx5_hrxq *hrxq, static void mlx5_devx_tir_destroy(struct > > > mlx5_hrxq *hrxq) { > > > +#if defined(HAVE_IBV_FLOW_DV_SUPPORT) > > > || !defined(HAVE_INFINIBAND_VERBS_H) > > > + if (hrxq->hws_flags) > > > + mlx5dr_action_destroy(hrxq->action); > > > + else > > > + mlx5_flow_os_destroy_flow_action(hrxq->action); > > > + hrxq->action =3D NULL; > > > +#endif > > > claim_zero(mlx5_devx_cmd_destroy(hrxq->tir)); > > > } > > > > > > diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.= c > > > index eaf23d0df4..e518fe9bfd 100644 > > > --- a/drivers/net/mlx5/mlx5_rxq.c > > > +++ b/drivers/net/mlx5/mlx5_rxq.c > > > @@ -2861,12 +2861,6 @@ __mlx5_hrxq_remove(struct rte_eth_dev *dev, > > > struct mlx5_hrxq *hrxq) { > > > struct mlx5_priv *priv =3D dev->data->dev_private; > > > > > > -#ifdef HAVE_IBV_FLOW_DV_SUPPORT > > > - if (hrxq->hws_flags) > > > - mlx5dr_action_destroy(hrxq->action); > > > - else > > > - mlx5_glue->destroy_flow_action(hrxq->action); > > > -#endif > > > priv->obj_ops.hrxq_destroy(hrxq); > > > if (!hrxq->standalone) { > > > mlx5_ind_table_obj_release(dev, hrxq->ind_table, > > > -- > > > 2.27.0