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 437ACA00C3 for ; Mon, 26 Sep 2022 21:35:45 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3CE9E42670; Mon, 26 Sep 2022 21:35:45 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2068.outbound.protection.outlook.com [40.107.237.68]) by mails.dpdk.org (Postfix) with ESMTP id 330524113C; Mon, 26 Sep 2022 21:35:43 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jaP2N9shifeMB0t97kckYv3B114Q4LUpYis9Z1WNQ2PCrggsJxGAnU9UaWJqIFnPCljRfWYKH0LAlnK3BGRzlWFghYvsUpfSyTNAleHljs+CaKhxFFrFKKkjw41KyJtZMVI0X8OMitLNfPZ9Y4QEnYsQMcLW6cYS3lzDVOQ7mXF0qR7TvWdOT90Mhc1xd+s7NPYeshNFS+yBOBZTUG5+m/yAcFSOcC9vMzutwOgeD+pfZ+RwORymcaAG5SmpyWxGaCYYu4RGQsr6ak55EPOup+g/E9WqhgEkpV1PaUnaQ+UJGO8GQs6idcpmtzaReKSM8NJUAfobEraV8p+caaINVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=aYhkEnRsfWmQB20mbScf/wu9TYHej0JfefZ69pP+gpM=; b=h/MBNxJA1O9l1rVaS0axJA1HgcSPNlMd92NurImutS92pyyi8yIQeoPwE5bQFpkp7feOyMbW0bC5o5q8eRT7IRri/v22Omlv/FM7YWv7vFOxG/8unmbb2gv8r99NtZ5b6PMENpOK7coZT7EY9ok7dLh8gHGAgVKg9fg8YZo20jiYuVlA+dndyrR1EAEElU4BeFnMi3Ut52qsi6biZNQ/7hjruw2o0UW4C4/Cr1oC/wgB56Mb8/b3YqPeFGMxRuIc0a3EGMi0S7Xol+OflvS/5CUhwdv05TF1k+JyVtv6rjQSP3b9aLru2LQ2CsSKj+pF3latAwXPCNRAdbeV7BuV1A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=aYhkEnRsfWmQB20mbScf/wu9TYHej0JfefZ69pP+gpM=; b=efd/rDFMkfpSoimdGIsxKLkBTSBCbMYnFq0OoRSjCTKiqfSNzebwVQvBnLbbu1hXPZQBFE+2INZ/c8q93pdvtuSS9L2JDq6WTSUJEIBjZre8A1Yesc4sDdIFs33bgx2uB1RUQO7yo6KvOSfTs2GYKHvv0JndDnGETXRZETNQuuKzMk2k1iossr+lm1T+HLOsNC48vOE6rtXGIiVsVqVQc9qD6ZA7EkP4lFuvo7Ak3m/W6ilYKd/ah5F+z5eWv7uL9UvHuq+JmOVEuUoUOTe1UYLoCRSPdtb8WsJJYHGRqPK90DhjGUEbZLYsFUjAsrz1ZHR1PUt8Tr9ASLPa6aiB/w== Received: from DM6PR12MB3753.namprd12.prod.outlook.com (2603:10b6:5:1c7::18) by SJ0PR12MB5485.namprd12.prod.outlook.com (2603:10b6:a03:305::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.25; Mon, 26 Sep 2022 19:35:40 +0000 Received: from DM6PR12MB3753.namprd12.prod.outlook.com ([fe80::e0f7:a30a:e9c:4c53]) by DM6PR12MB3753.namprd12.prod.outlook.com ([fe80::e0f7:a30a:e9c:4c53%4]) with mapi id 15.20.5654.025; Mon, 26 Sep 2022 19:35:40 +0000 From: Slava Ovsiienko 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 Thread-Topic: [dpdk-dev] [PATCH v2 2/2] net/mlx5: fix resource leak when releasing a drop action Thread-Index: AQHYtrwHAwT7Fw9Kg02dGVPtZwSvh63s8SaAgAVYIqA= Date: Mon, 26 Sep 2022 19:35:40 +0000 Message-ID: References: <429c86ba3b944c99a4b50978d456e781@huawei.com> In-Reply-To: <429c86ba3b944c99a4b50978d456e781@huawei.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: DM6PR12MB3753:EE_|SJ0PR12MB5485:EE_ x-ms-office365-filtering-correlation-id: 7d6a02fc-cff5-4adc-5d1e-08da9ff64b7f x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 2cedl5FK3T5RdL+rFhbbfv8GlqMp2+9tqDLTjeyEFGUpILwDhQlLs+P13CGwadbUBgIKQmBC5QlMIrrrRSQMmuwyUCCabexKhFR3rEcaKu3jzrM2clKBvL6ZDrdysFO5EjSbgFTE7i0M+x22CuCtVYpZ+/ImaTg/sj60M/Li+um2A0Aa20l3kfTdHn94GFHqZ4M67eAbolYfJoBzSk+aZVPfcSZIvBdqA1w9Pgib+dyCRfEvC42flEt+exH8gJ3w4A3tbiOLEqoPhFKKWw4/4zHpdjhw5aCl56F2VVdG54cslBKhh4F4rJCkRbkzZZxNOOLr/IDTm01KvDGh28K6IFjEPNWpUzL935tyOpbDej3xLZ0dqAan6zGj6lbOYoD6TgCT6J60nf7g3qo5fDOg8dNOXcwuk51jFpFkiQvG7sjCOqZvPqLSVhTlbVqAlw2uwxPudOEIGh5mgCRw6KCh60hGbkGvf4vSzBCnXBE7ixBbEs2SuzeTCaJ9FHXCmbdADl2jGj97piKpjMfkohHilU+KXTPLu+izY38uw9KMvBYMemIj0gTqWoGjUHWrH9qB12cQkvi7ebKIVqaxLswCMVsDq7J6xBg7B8Y02o5xloaxNcywknronnGQNoYfnWoZmPxr2j8vIL2oR9kiJgul8wZkY3Si8E7o8OtJqGLEBnBD5ppmtBTmBkh5tbZF9SBR+vdeiYb4v2k4EDWTYBh+rviySpk+Ys+/GDI8hiBGwy8Eja4LnQvOdNWgngFr6AlUv0HQK0rp03BML6jV7BouCs9jnEhbV9GZJib3H4LGmBk= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR12MB3753.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(4636009)(396003)(39860400002)(366004)(376002)(136003)(346002)(451199015)(122000001)(26005)(9686003)(5660300002)(53546011)(33656002)(38070700005)(2906002)(66946007)(76116006)(66556008)(64756008)(66446008)(66476007)(4326008)(8676002)(6506007)(52536014)(7696005)(41300700001)(38100700002)(86362001)(55016003)(8936002)(186003)(54906003)(110136005)(71200400001)(83380400001)(316002)(478600001)(21314003); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?i3WiO7NaIIjP4val0nhsUrsp/zg+WQxRnzKcYr6x3udK6+MrpxJtnfXRcx0D?= =?us-ascii?Q?3q0HERUPTMRe/dBQ1Dv7gi51pt4pq9Jx90dF1VLw5BYMP+rLnJLxGflnNDzk?= =?us-ascii?Q?/tEDvKgMZaHgs/XjHgThUvrjP6b0UJOF+v5B72M5wmwoWZbWuJwqfcKvtT6/?= =?us-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qd1D1REiMulEtYw9TzxdDd?= =?us-ascii?Q?+aB+AU1vQTzYMSLAosB2OhaAhy49nYm2oFeo4s1HmkRfJfZvxhbT97SGICNq?= =?us-ascii?Q?TyqW8j7sYuvQk/dZwxaqwLhZ5BBRJWkLiJAq/uFaFTcd7NU48fHif5TrJsyX?= =?us-ascii?Q?Ymv2VdME8tIQQNmA0cLPSru/v85LPA1sktAct75lbNC5RAfeczxSinZ9f5B8?= =?us-ascii?Q?Sd+5buTFoEeRsIhkvKEspX/GFmSETWQys3JxEtNeIe1l0GxqrbCLTBo3t6NQ?= =?us-ascii?Q?deb/wEz4AL+jnSZRPR3sqE+bPt16r8GuQLx433nE5dSYuGdeqwh4yEZYC48G?= =?us-ascii?Q?TF20UN5xKeiKu1To/t7B5A59NsyjAmnXTJsFyzEPEBfeBYTdOkM4nXxrftOh?= =?us-ascii?Q?5N+mdgbJoZ6psDUNKg8czXbjBMQZoAVmgw7Y17gF/RCVgwI7csi/BK+sxGvD?= =?us-ascii?Q?PMwhw9KjjLMMEzK734ca1UtZjO0pYbvL03vxZLX7larAW7xZ4/nS8JgxIqyK?= =?us-ascii?Q?QB9rpMUo6nsMsvuVScm0qWpvTg85oo4aC/+ya8kk?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR12MB3753.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7d6a02fc-cff5-4adc-5d1e-08da9ff64b7f X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Sep 2022 19:35:40.3130 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: HhQ7IZBJY05yimg61BTKWnIySD+JQsZyb2dmKus9NckylwbxVinhbE+i5Oyzyq1G6Btv3oCqV7CrIf13ZktIxg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB5485 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 Hi, Yunjian We have drop action in mlx5. To create/destroy drop action we have=20 mlx5_drop_action_create/ mlx5_drop_action_destroy common routines. As PMD supports operation either over FW (Verbs in rdma_core) or SW/HW stee= ring with DevX objects the "virtual" methods are used for objects: 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) 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) 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() 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() So, yes, I agree. There is missing action destroy, it seems we have leakage= . Let's look at=20 __mlx5_hrxq_remove() destroy_action() priv->obj_ops.hrxq_destroy(); 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. 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. With best regards, Slava > -----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 >=20 > Friendly ping. >=20 > > -----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