Message ID | 1525770687-22980-2-git-send-email-rasland@mellanox.com (mailing list archive) |
---|---|
State | Accepted, archived |
Delegated to: | Shahaf Shuler |
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D307E7CB1; Tue, 8 May 2018 11:11:49 +0200 (CEST) Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40069.outbound.protection.outlook.com [40.107.4.69]) by dpdk.org (Postfix) with ESMTP id 8A3026D3B; Tue, 8 May 2018 11:11:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=TONpeUGXodu/g8iNWX5xoIgOh0x1dFTaoONSOLb4WgY=; b=bklc+Pb/Kb3FDOcswhLn1FEToMWzfWs9/J/IElFia1ccUI4xJBxtoubf9IrKDE+bsImXwpOF7tf8dC3uqPRrGfYpEqYBTPKW2GWvw5ulC3lJw69YLGLSsnVJUeTjV2baNDZDHAUf3rj0kzFDzIXb/U9E0VarcEeK2LAXgJi7J0Q= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=rasland@mellanox.com; Received: from mellanox.com (37.142.13.130) by HE1PR05MB1259.eurprd05.prod.outlook.com (2a01:111:e400:588a::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.735.18; Tue, 8 May 2018 09:11:43 +0000 From: Raslan Darawsheh <rasland@mellanox.com> To: shahafs@mellanox.com Cc: dev@dpdk.org, thomas@monjalon.net, ophirmu@mellanox.com, rasland@mellanox.com, yskoh@mellanox.com, stable@dpdk.org Date: Tue, 8 May 2018 12:11:27 +0300 Message-Id: <1525770687-22980-2-git-send-email-rasland@mellanox.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1525770687-22980-1-git-send-email-rasland@mellanox.com> References: <1525770687-22980-1-git-send-email-rasland@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [37.142.13.130] X-ClientProxiedBy: VI1P194CA0047.EURP194.PROD.OUTLOOK.COM (2603:10a6:803:3c::36) To HE1PR05MB1259.eurprd05.prod.outlook.com (2a01:111:e400:588a::13) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(48565401081)(2017052603328)(7153060)(7193020); SRVR:HE1PR05MB1259; X-Microsoft-Exchange-Diagnostics: 1; HE1PR05MB1259; 3:QPrrGam4eVrq82GoqDfmOQtHsHln3X9YKR+NamYhE84TcqHizDPu+nGjE7N4AMMeu+5ezF6A6XJ1HIUBiTvmPkU1rr20LLPRH/Yt9ZWtWdav6fCJVjzvxwLBPR/KfU2NIQE04L6O1HtW2apU50rKwiWkn+KWOmO8Ko+qliYxp+XjISeIGEtiS1J3agdw7mbeuAZjw8mwFwTFXi4kz6zw/Su9JEO+nfM0Eqj5lnF/k+4vEAMpp6E9koFrDAAM5Wmg; 25:Eo5NBbnPUim4VUdxbn03PDmtHX8mrQ+MoWQdByMYZj6/WBlh/dbl0N15kkiGM+kYMvlbXX75Vz2EWE92J5FHUF0ma1dLyKh+LLGXErx8uIAokEAafsTubHJ6Vl7V2C/70YgVMe7EfTdki74H5k57vOphJAgoN2KQVDR9NgR5H6JZcvwc0jdPeIjf+enaZIPPsvBylBfmINbQmd0nhbQHCmHYR+GBoS9k1E0Ho27+7XQwnwfC1SttCDxiqJxboONBEFeZi/tka1Ulwbq0x8kSthOA4/NCrvO7yMLBK6zsPm5Jdt0odwMvb5mOhP0lUd/VNaeqz/s2HgMALdL1uEdGmg==; 31:1kj6XjC/VTB5CTbd7PfiMGwXEJwhnVoA0Lxl9nu+mv55EXQZWZvPwrjD7W1mJBliqCKgBUlHSq5nAoMH4hRAvvrnlqucYdBxrQh0FZx3Fzm26zhRW7uZbv6J2qhRHAtctsfXVeZVk3yLp51cFIbgepwLC1ojlzeV3xJ8D0LwrPAEELHIytG2s4WLx9+g0HAn4u1ZwR8VwLIrWL+QKlXi4pydElzCV6p7LcO6jWVxShQ= X-MS-TrafficTypeDiagnostic: HE1PR05MB1259: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; HE1PR05MB1259; 20:+TIYDgcMbLeqHE5P9wFagO3nWPixaTtSoTCU/D3o6cSQ08bHwHbatrsSB5dKw6RQfc+cXOMISM6ye/NUypME+4vka6+FLwdnU/jbH0z+zXgcHOuDnwK0W3Nn9SblnjB6rbKyY5SKMXIm2dPJLM8sMdLNh+MMTLKykY6+WYE8YkTdN+doOTcHNqVTx7cYXTmEQdmP24UXpuTHqJ3JI029xBE07z3gN73cyUBg8jIj3lXfmcJIR0ecksifgX1z+eH1ruNEC9nYVQJv5k3kHKvT1+BYsM+q4t1Qoaih0Z7cr2JZJWf3R1imjHJuneEo4YBCcw7UxCjQ9zgDDOAXmf969hy8O0glvVXnFekZ6vkCmS++GfWlxypqqi1w5EiQ7OkDewXUSF2Xk7dCGST+kQwrWLchjYY36MywZ3euwQDd7zBXJPhc/Ghi9eiuiDqVAc1rYwYSqAao3Moel6gET64TCLOymeppXWGEZfdcwUEyrr91JHf55i1DJHg8xaeCQb7a; 4:lGhFh/P8C1GTRxz1lUH5GqOyp2F4Xa5Hl29jR7yDdDY9B4OCYe1+vkpuycfoy5B8C5MuA8fyTo9NGSeQ/sqOEyBd7UdcEffB73AFAamiQp7FwdQT7lUXxjS8omJ0iE9qtztNY5Fm/MFB4csPS/9loPrdwhbP2NB8N6k9OIdHzrhCZ4roL+VIXVat4hilf4g2GiQfqDpOLEnjhzmmo8SlJwQea/RjBkYQ/LyhQfPWxoC5krxENFRLgoi8WuNnTpAd7r31falX54+wlhyBwAtm8w== X-Microsoft-Antispam-PRVS: <HE1PR05MB125937D5B6B97656B8516E5AC29A0@HE1PR05MB1259.eurprd05.prod.outlook.com> X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(10201501046)(3002001)(93006095)(93001095)(3231254)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123562045)(20161123560045)(6072148)(201708071742011); SRVR:HE1PR05MB1259; BCL:0; PCL:0; RULEID:; SRVR:HE1PR05MB1259; X-Forefront-PRVS: 0666E15D35 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39860400002)(366004)(346002)(396003)(39380400002)(376002)(189003)(199004)(50226002)(956004)(476003)(7696005)(81156014)(68736007)(51416003)(8676002)(86362001)(53936002)(8936002)(2616005)(66066001)(55016002)(16526019)(97736004)(446003)(486006)(11346002)(105586002)(4326008)(7736002)(81166006)(52116002)(33026002)(25786009)(478600001)(34206002)(76176011)(6116002)(47776003)(2906002)(21086003)(3846002)(2351001)(386003)(59450400001)(26005)(6636002)(6666003)(48376002)(50466002)(5660300001)(2361001)(16586007)(37006003)(36756003)(316002)(305945005)(106356001)(69596002); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR05MB1259; H:mellanox.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HE1PR05MB1259; 23:tR79QSTkN0D5VZX9zYYvgmRS8hOzJWhtrjKBRdx2s?= 9lMH1dB0DaKawOh/o+imnbutrynvgkQnUNawYV3BlTJ6yTApKgKUApwvvl9JXnRX60YRuDcDoWRUTWQA6Y7HtI3s0pCScFiMCFRyW6wclIdyUF6WTkt9C5Ez0scU0EuFv37ns/IEfK7PQzd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nosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; HE1PR05MB1259; 7:MnkbtXWI4B7K0pCBom1qxYe+9EanQ1tZWDtZuYjpgYvbjdLDLfl0qB4SVI8mX5mcFE0ouzNNP8SlP2yECDjAjfIg9Ii4dR2V/2PgbdxlVApcNeE4GrRKS629ME7SPGlMF8EBHGMXhcsPIsZT14Zdd/teZTqf6FZ9oL3RMiNPwIIes3zafJxyOFyCGdR6pKi42k3KN2BCFceUARKtjc7JNGR6H8pTvzp6w69m3JKiBi8X06xt3Svd5TBEnBDEKv9X X-MS-Office365-Filtering-Correlation-Id: 3faf1247-4941-44e5-7e7b-08d5b4c3b841 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 May 2018 09:11:43.2590 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3faf1247-4941-44e5-7e7b-08d5b4c3b841 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR05MB1259 Subject: [dpdk-dev] [PATCH v3 2/2] net/mlx5: fix resource leak in case of error X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions <dev.dpdk.org> List-Unsubscribe: <https://dpdk.org/ml/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://dpdk.org/ml/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <https://dpdk.org/ml/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org Sender: "dev" <dev-bounces@dpdk.org> |
Checks
Context | Check | Description |
---|---|---|
ci/checkpatch | success | coding style OK |
ci/Intel-compilation | fail | Compilation issues |
Commit Message
Raslan Darawsheh
May 8, 2018, 9:11 a.m. UTC
If something went wrong in mlx5 pci prop the allocated eth dev
will cause a memory leak.
This commit release the eth dev that was previously allocated.
Fixes: 771fa900b73a ("mlx5: introduce new driver for Mellanox ConnectX-4 adapters")
Cc: stable@dpdk.org
Signed-off-by: Raslan Darawsheh <rasland@mellanox.com>
---
v2 changes:
Reword the commit log.
v3 changes:
Reword the commit log.
change the release to be only in primary process.
---
---
drivers/net/mlx5/mlx5.c | 2 ++
1 file changed, 2 insertions(+)
Comments
> On May 8, 2018, at 2:11 AM, Raslan Darawsheh <rasland@mellanox.com> wrote: > > If something went wrong in mlx5 pci prop the allocated eth dev > will cause a memory leak. > > This commit release the eth dev that was previously allocated. > > Fixes: 771fa900b73a ("mlx5: introduce new driver for Mellanox ConnectX-4 adapters") > Cc: stable@dpdk.org > > Signed-off-by: Raslan Darawsheh <rasland@mellanox.com> > > --- Acked-by: Yongseok Koh <yskoh@mellanox.com> Thanks
--Shahaf > -----Original Message----- > From: Yongseok Koh > Sent: Tuesday, May 8, 2018 10:20 PM > To: Raslan Darawsheh <rasland@mellanox.com> > Cc: Shahaf Shuler <shahafs@mellanox.com>; dev@dpdk.org; Thomas > Monjalon <thomas@monjalon.net>; Ophir Munk > <ophirmu@mellanox.com>; stable@dpdk.org > Subject: Re: [PATCH v3 2/2] net/mlx5: fix resource leak in case of error > > > > On May 8, 2018, at 2:11 AM, Raslan Darawsheh <rasland@mellanox.com> > wrote: > > > > If something went wrong in mlx5 pci prop the allocated eth dev will > > cause a memory leak. > > > > This commit release the eth dev that was previously allocated. Considering this patch as a temporary w.a. as there is patchset[1] which starts to address this issue from ethdev layer. > > > > Fixes: 771fa900b73a ("mlx5: introduce new driver for Mellanox > > ConnectX-4 adapters") > > Cc: stable@dpdk.org > > > > Signed-off-by: Raslan Darawsheh <rasland@mellanox.com> > > > > --- > Acked-by: Yongseok Koh <yskoh@mellanox.com> > > Thanks [1] http://dpdk.org/dev/patchwork/patch/39544/
diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index 3831e3d..c4ab166 100644 --- a/drivers/net/mlx5/mlx5.c +++ b/drivers/net/mlx5/mlx5.c @@ -1063,6 +1063,8 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, claim_zero(mlx5_glue->dealloc_pd(pd)); if (ctx) claim_zero(mlx5_glue->close_device(ctx)); + if (eth_dev && rte_eal_process_type() == RTE_PROC_PRIMARY) + rte_eth_dev_release_port(eth_dev); break; } /*