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 3076AA0C43; Wed, 12 May 2021 16:04:44 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DC3504003F; Wed, 12 May 2021 16:04:43 +0200 (CEST) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2078.outbound.protection.outlook.com [40.107.236.78]) by mails.dpdk.org (Postfix) with ESMTP id DECAD4003E; Wed, 12 May 2021 16:04:42 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SElJthcnHp9BPcWtt/z0HAhCB87PS/ZvFBMx3wPQ7q7szUJW121c4QH5AyE5ic0LO8ZSdRXWptcFAHbGc2cz9RAMWfx1CMaEeZfJYQ8tZ7SQyy03mSsYwAMLSjvjuakCoJ7a1SpBcHwYJs6ba6VrT8i3rjL06UUnVGK1q6HNrR2SiCJPujeB7Jj3erdOn2sW94yTqRPXi8Ohyh/uN32xXNPCe5QxhhEQVYE51tgfqqPxLyKxoAVevhSu2VvTWkNWObX2ISk3uOeAUFH0GjxgKAHufrRQMuKJBIauaj7rKTv4XBJGkhN8vvD8C6naP9f6ddTm38+VCdy9uQefOzPw9g== 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-SenderADCheck; bh=mJDbsL27HI/w3bxyxx6Clsmop5GUgP4Kd/ZPQ7Q3VJI=; b=Xz9KaxpZe/U7el0ucvjTtbGXaNZhfLpf4gG/IoA4rXGmrK+3icowwiGuaq8Tqt4A+bJ8aOxJbN9V/6+j7K2TR4ksl5VcfiKswWa/BTuU8tUpufSwGHhjz+0nPSMpebCZEXnNXTC2WqWNpRHQxbWEcac4Gkf2vc3VJMg+GHTaO3jFsTUVjr7MFfs+gQkkR8IXD4N1LmSR+dwqZknP7H4C/V8byDm81sUz1+TnQSR0pNnIdNXdI3vo9GGNDd1bvybqzEhIDLO4+O7JpLLDoh3pYSgut/pHjNWQrbVqMu9mF61x+ZCp4riox96km0yPtNmbXaGX1Rjz2RHzbM3Cc3n5Iw== 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=mJDbsL27HI/w3bxyxx6Clsmop5GUgP4Kd/ZPQ7Q3VJI=; b=Gf9er1QHE8Sp6s/GXBtTa2OX6uBqQi+4kOzasRfsAmNTgSgQRS/y58hY3+nkhwfNE2qyC4vGxr2biDMtFrLDLFHRAUqrFBB2bkrJu+I3aRT9f8/3VLnOvTmq5GZlPEtZBsyGaF51dxBV4NdvQIOUmgjSR4uYQNXmpd0u3AYxvEZCbSwhsHysomOVFcFbTzUNmlsBLG5qTBcZW+36DfKus8MrFtqJqNfn0RBuBE7v405D0zX2iGzGTW4K+MXDv5OoOp1iU4LbTFxJ2ZUjQTtYYSYBu4m7+2bm2nXwIvVX2EuGBhqqqu9tymgjXMxpxcspv1wNuecnwTyqvdCn1aCUxQ== Received: from DM6PR12MB3753.namprd12.prod.outlook.com (2603:10b6:5:1c7::18) by DM6PR12MB4763.namprd12.prod.outlook.com (2603:10b6:5:36::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.27; Wed, 12 May 2021 14:04:41 +0000 Received: from DM6PR12MB3753.namprd12.prod.outlook.com ([fe80::c595:e3bc:686c:16a4]) by DM6PR12MB3753.namprd12.prod.outlook.com ([fe80::c595:e3bc:686c:16a4%5]) with mapi id 15.20.4108.031; Wed, 12 May 2021 14:04:41 +0000 From: Slava Ovsiienko To: wangyunjian , "dev@dpdk.org" CC: Matan Azrad , Shahaf Shuler , "dingxiaoxiong@huawei.com" , "stable@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH 1/2] net/mlx4: fix mem leak when a device configured repeatedly Thread-Index: AQHXRzFUMTWktTC/kUmameTb2pRdv6rf4QVQ Date: Wed, 12 May 2021 14:04:41 +0000 Message-ID: References: <1620825508-29440-1-git-send-email-wangyunjian@huawei.com> In-Reply-To: <1620825508-29440-1-git-send-email-wangyunjian@huawei.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: huawei.com; dkim=none (message not signed) header.d=none;huawei.com; dmarc=none action=none header.from=nvidia.com; x-originating-ip: [188.163.75.124] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: c8d5645b-dbab-4582-b338-08d9154ee37b x-ms-traffictypediagnostic: DM6PR12MB4763: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3968; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: blBbnyU3v3bWU6PV/MjeXZIplA+umFklaTCl23o3/iO4RPGP5/CtMBiidxqTb1lmOApw7lfv6lQmlXbYjDe5fFJOSTYGdHpr2Os9gkJVS+fQTaRgliJf3EsJGvFiKHd8u79BZUuWjllR/AWl+8zMhn1eKAUcLA7SHE1BcZx3uqc786UKgRTkWVywT9aIosS+/rGbMxfyiT9Q6OuE4Co00rFKMyKD9uSsITJHaQ6AiF6JdIBTUBcNilroz4qzdteew5HxWHSL6R3w2nROxdCMFSoaM7o30efYA40dgwd9afM1UhgBbVMMo4bnn3fSKjtLt8wuESGzpjPOa9VrHBrZR9znjH3T0o+G1kB3qlyOSuQewDyJ/7FnIrxskHCVuzTmLOKoe9hsX6AXRWR+ldpmDSBjZt2N2+O8nVQtwmoHCqnXPtcSlyNFXxrXObZzsr7Sy2dxdwNkK3dnydIFD7pL1+oL77astatnZWVt+NhSPYEyI6cnHAUfRHB9DWYoDfyf48ZME7Vr44PV+m6QSaKWyngcBFiqmrq/6C9RYbmu0CAVtNvK6o6ZZqi/MmbY8QxUmlipvtk+PHfUuL/HNO8htjN/2nIxgdR280yxn4cE/FI= 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:(4636009)(376002)(396003)(366004)(39860400002)(346002)(136003)(4326008)(122000001)(66556008)(66446008)(66946007)(76116006)(8936002)(66476007)(54906003)(55236004)(64756008)(110136005)(6506007)(316002)(55016002)(86362001)(8676002)(9686003)(52536014)(5660300002)(186003)(71200400001)(478600001)(53546011)(7696005)(38100700002)(2906002)(26005)(33656002)(83380400001); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?ZdWckxrDPIKl/K6mvZoAwm9Pzj/pM6LMdF3e2JqvKpc+XwdWV4ORRbBnVrWc?= =?us-ascii?Q?DjqtF4i3Z25Yrf69FxYqDqftwLDcXjtYigTW5eztTqA45VqCC8EbiEogApA1?= =?us-ascii?Q?+ubxTgtz9xBVcBgc5kYR1YYRW0GiFg0VSlw1QxkKIVIC60d90yosPA1V9kP3?= =?us-ascii?Q?Mh/7X9oTY4krxrW5Idrksof7qkPJGPWfeWnC9xwDv2p3C6pwBW8sbSP44zaA?= =?us-ascii?Q?E1GpGhl4eestpn7t15dZBLB/DkYdo2xmDJG3nXk0bzsmv2sgaoL5w/Mh1wC2?= =?us-ascii?Q?ohT7h49n11Isyb+OwDZcAGBDSAHakLXt4cbHqjAxhrsbaxH3fNw2Du1P0Eno?= =?us-ascii?Q?miuI39Ss/zgbxmuD6Cnxx9ipKBVEjh1bSfUooYBcJqxr8DYxyd20+eUPTdpH?= =?us-ascii?Q?JkEZIyzRUQu1JQz7vK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F?= =?us-ascii?Q?RUr5zew4iQAVmiFElBzlCe9S?= 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: c8d5645b-dbab-4582-b338-08d9154ee37b X-MS-Exchange-CrossTenant-originalarrivaltime: 12 May 2021 14:04:41.6923 (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: 6rGlADPOpWgNlUZjAYG/MzGAJ3jk9kP4r5k2bYpNH9izMB2ml+E7iqKNW7tXeW6w6HQOC2cTsWhtxWRVf1Pnog== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4763 Subject: Re: [dpdk-dev] [PATCH 1/2] net/mlx4: fix mem leak when a device configured repeatedly X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi, Yunjian Nice and tiny fix, thank you! Could you, please, remove the empty line after mlx4/5_proc_priv_uninit(dev)= =20 to follow the mlx5 coding style? With best regards, Slava > -----Original Message----- > From: wangyunjian > Sent: Wednesday, May 12, 2021 16:18 > To: dev@dpdk.org > Cc: Matan Azrad ; Shahaf Shuler > ; Slava Ovsiienko ; > dingxiaoxiong@huawei.com; Yunjian Wang ; > stable@dpdk.org > Subject: [dpdk-dev] [PATCH 1/2] net/mlx4: fix mem leak when a device > configured repeatedly >=20 > From: Yunjian Wang >=20 > Currently, configuring a mlx device, it will allocate its own process pri= vate in > mlx5_proc_priv_init() and only frees it when closing the device. This wil= l lead > to a memory leak, when a device is configured repeatedly. >=20 > For example: > for(...) > do > rte_eth_dev_configure > rte_eth_rx_queue_setup > rte_eth_tx_queue_setup > rte_eth_dev_start > rte_eth_dev_stop > done >=20 > Fixes: 97d37d2c1f6b ("net/mlx4: remove device register remap") > Cc: stable@dpdk.org >=20 > Signed-off-by: Yunjian Wang > --- > drivers/net/mlx4/mlx4.c | 2 ++ > 1 file changed, 2 insertions(+) >=20 > diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c index > 7cd35cd3ca..c72587b7ef 100644 > --- a/drivers/net/mlx4/mlx4.c > +++ b/drivers/net/mlx4/mlx4.c > @@ -201,6 +201,8 @@ mlx4_proc_priv_init(struct rte_eth_dev *dev) > struct mlx4_proc_priv *ppriv; > size_t ppriv_size; >=20 > + mlx4_proc_priv_uninit(dev); > + > /* > * UAR register table follows the process private structure. BlueFlame > * registers for Tx queues are stored in the table. > -- > 2.23.0