From patchwork Fri Oct 12 10:04:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shreyansh Jain X-Patchwork-Id: 148743 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp539762lji; Fri, 12 Oct 2018 03:07:43 -0700 (PDT) X-Google-Smtp-Source: ACcGV62v3kdCtmQQ7+ULEuc+GGTBfsgx4oNGkhlDdNSYoOA1JUEI0FOwXzNATcVTN2IgbxuqIIQM X-Received: by 2002:a7b:c1d9:: with SMTP id a25-v6mr4614389wmj.55.1539338863417; Fri, 12 Oct 2018 03:07:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539338863; cv=none; d=google.com; s=arc-20160816; b=HBmFC9GPJ5QVG4rXtAiuFiI7fMB8CEawGgv6ItfULo7goLNHvaGx0OajRavjYFr+fx ImbOtNmbPYabKHXwbJhc2NQQppgY0uV1zX5aKH+xyracvaeYY3QzLf4I/erF+gN4gJop eoDUQi5/bPtwpBNT4u4Vi7fa6jWTwlQMCJf3/i9SP2ZO4ftPI5MzLn76qKQQYqpCfTme RiOQKKlGS08YVgOdiuyivRMAJ06bJDZ0rZAArI1gLiKp16S5OeBPbfWTjNniPAtCT6mX yrNDLgWe4JJi4MGJ2CRNTUfsrwpfn1a8kowOKHC6r+aj/6LX8Zz2pF68cV1mhQqKzhu2 SiKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:references:in-reply-to:message-id :date:cc:to:from:dkim-signature; bh=3OZvGU2BXLRjr4ecjfH4vNn1maYnOc2QjSCQT27MGyk=; b=vTBond9IwQrPNlvjz8fFX6fFMCD17BgmAfe3Mj28ee6KsmB9JhNBhmS1K5hq90dxkq KlWWDClQ6TboUfjPNMZ82LmArh65WtpnH7FhXEf5/ZmDxERxexL4opAqQGsoVfFrT79O QKxqk/9IId/RA3Ny7+Dl7EQDPz02pyn2SshR9RuAA+4EqW25yczhKyS04z1NeuMoeHI2 RtND1ha0XkDIviPB5VEbFQ9cWdvt++lnO6YEkBt3biiJwFJ+8nffdjH5Df//ysyCGhCu aAVly4p7efH68XJmmbrgrTktUuuRS19bpTgOL13Aj6t5cTnHDTDEBUigilk6k5JW7zSr rTyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=CqBtoTTh; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id n2-v6si646683wrx.302.2018.10.12.03.07.43; Fri, 12 Oct 2018 03:07:43 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=CqBtoTTh; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 247421B504; Fri, 12 Oct 2018 12:06:13 +0200 (CEST) Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00083.outbound.protection.outlook.com [40.107.0.83]) by dpdk.org (Postfix) with ESMTP id 49CEB1B4B1 for ; Fri, 12 Oct 2018 12:06:00 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3OZvGU2BXLRjr4ecjfH4vNn1maYnOc2QjSCQT27MGyk=; b=CqBtoTThf9MOmyr7Q/fXIU7w1ohMMVXgMtPg1nGU/RVCjTDJgwy23TcWtmZEruQr9txYYfhFIfoMB1tgFic3Q94rpUxJcrN7iV9MYT6umPlTGXCHwiRgRsGp5l5BcVIoz0RTFIUVeCvupQ9GLRKEEujlK3nJbcTYKUx/VulCNnQ= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=shreyansh.jain@nxp.com; Received: from Tophie.ap.freescale.net (14.142.187.166) by AM0PR04MB4676.eurprd04.prod.outlook.com (2603:10a6:208:75::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1228.25; Fri, 12 Oct 2018 10:05:58 +0000 From: Shreyansh Jain To: thomas@monjalon.net Cc: ferruh.yigit@intel.com, dev@dpdk.org, Hemant Agrawal Date: Fri, 12 Oct 2018 15:34:24 +0530 Message-Id: <20181012100426.29349-14-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181012100426.29349-1-shreyansh.jain@nxp.com> References: <20180926180440.31726-1-shreyansh.jain@nxp.com> <20181012100426.29349-1-shreyansh.jain@nxp.com> MIME-Version: 1.0 X-Originating-IP: [14.142.187.166] X-ClientProxiedBy: BMXPR01CA0004.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:d::14) To AM0PR04MB4676.eurprd04.prod.outlook.com (2603:10a6:208:75::18) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 93f727ac-6369-41f1-e831-08d6302a4f35 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM0PR04MB4676; X-Microsoft-Exchange-Diagnostics: 1; AM0PR04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b7uJNQ9jh+f+eyQu+6YmBqKGmEh9nozjKIMyim8w83pTVhXS2obJNeKhAbUwxLaGjFaLqpQDdcddVMkTqIClAdARry09leN+eJ4MAdv3xyKc0lPZ6Nsawy1nUYywCghKNnteivDkCr8St1F98PO9a3bcUN6QpAZEaTq1oWCi8l3LmAFrQCP68a8RxtLqjeemD43MnRnFKYFaGfJomeh6TAbNLkz9ohVviWUPNVPfJt55JfZ5vFgtPjqzMTKFQn9YJWfUncQos358rn2ylk6ztW0BdYwVi77a5qHrRrAc89YN1ObUUIbg3xCzjvin8XZqhQ2GO33lAzhyxxk2k8AMwN7PiVtwqcGwnd49AtQ7qCgE4; 4:lKpevTpAC/TGdhlGUPSv9FMttYxvwYQL4e3vFObSVxCZYGx17MfFfKE2TDDsa9q3G9aE0RE9zBUEMNCh1zXm/jshR6Pe+V0uIObliqi+bnLcJYu0m2eL7FGCX67riuAmZgawgd7mjHMvnhUGv613QKWfxB+OnxSuvukQsMYt75D4rXHSGBU1V2ZWallr0/ImrwRFXoUEFnUbXYFBiUXyrqzFxi2y96C5URw/JhfkVjjHVOGio9S3aQygEVyFcqCh3l5w13zzQYQ7RArSLfWV0aCzfsuBBMLHYDY189hz6uy+tmDjM/c2P1rVxvYabY9D X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3002001)(3231355)(944501410)(52105095)(6055026)(149066)(150057)(6041310)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051); SRVR:AM0PR04MB4676; BCL:0; PCL:0; RULEID:; SRVR:AM0PR04MB4676; X-Forefront-PRVS: 0823A5777B X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(376002)(396003)(346002)(366004)(136003)(39860400002)(199004)(189003)(2906002)(52116002)(16526019)(14444005)(53936002)(8676002)(478600001)(186003)(386003)(446003)(105586002)(7736002)(106356001)(6512007)(6116002)(86362001)(3846002)(81156014)(50226002)(68736007)(1076002)(47776003)(5660300001)(6506007)(8936002)(78486009)(36756003)(316002)(26005)(66066001)(6666004)(25786009)(55236004)(81166006)(11346002)(48376002)(76176011)(44832011)(2361001)(956004)(51416003)(2616005)(97736004)(1006002)(50466002)(486006)(476003)(305945005)(16586007)(6916009)(4326008)(6486002)(2351001)(110426005); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR04MB4676; H:Tophie.ap.freescale.net; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM0PR04MB4676; 23:gT42yylq4VXhh4PedDZJnon2eCoinvWCrytE496Ry?= sTBqCs3IJLUJVmGwjfw/pjAmbfTxK9H+xWJv847zibhczTnx4kakyQO3/jCFmUd+Kukm2OpFe3N0Zuk8Feo+EXOmBA5uuFL0b48m1UY24Rmq30gZy+LLS72Qq1DV2jhfHc81/ey+VgXNN5/BMmSW/VC2dOBRrzm5U8yvQ779JvAmERCGWaVn8BYaTpInk6buYq0eWN67keBsQLBKLGfbHi7iOdc6jvZoGeHkJg6nmaGWzlK2EIbfmvfQSgeM5Wsy43tb1PKaK4jRMmlS5+OXsUPqnMYfKIUVHVrvhq/iLnmAMUVBSjv9Efuc2qnCLCWeLuNrclxyw1vA6b5x6cfhEOUmZJvsp9YHtSHkonr2/DbrXlPXasZZwYsD7P1SkupwQWClu2g6eTIH3M027j7HLEsqGYD7RoBFKQiaxAus5Fv3iP2JUQMF1zoPdnpQXjoYbNWPCHjEaJ8Qyvde0eyeNyEby4EsQfbe+dEsG1irUCWzHMnjBdL4XvTUEDj2TeXmf0Vk2e7R+nYyXCM2Z5HnzgEqOY3VH4+ax7unD0Oi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X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Oct 2018 10:05:58.5369 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 93f727ac-6369-41f1-e831-08d6302a4f35 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB4676 Subject: [dpdk-dev] [PATCH v3 13/15] net/dpaa2: enhance the queue memory cleanup routines X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" From: Hemant Agrawal Earlier the tx queue data was getting cleaned up in close while rest of the functionality was in un-init. Now a new func is created to free queue memory. Signed-off-by: Hemant Agrawal --- drivers/net/dpaa2/dpaa2_ethdev.c | 56 ++++++++++++++++++-------------- 1 file changed, 32 insertions(+), 24 deletions(-) -- 2.17.1 diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c index 46fa38f4a..27ae4740e 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -291,6 +291,35 @@ dpaa2_alloc_rx_tx_queues(struct rte_eth_dev *dev) return -1; } +static void +dpaa2_free_rx_tx_queues(struct rte_eth_dev *dev) +{ + struct dpaa2_dev_priv *priv = dev->data->dev_private; + struct dpaa2_queue *dpaa2_q; + int i; + + PMD_INIT_FUNC_TRACE(); + + /* Queue allocation base */ + if (priv->rx_vq[0]) { + /* cleaning up queue storage */ + for (i = 0; i < priv->nb_rx_queues; i++) { + dpaa2_q = (struct dpaa2_queue *)priv->rx_vq[i]; + if (dpaa2_q->q_storage) + rte_free(dpaa2_q->q_storage); + } + /* cleanup tx queue cscn */ + for (i = 0; i < priv->nb_tx_queues; i++) { + dpaa2_q = (struct dpaa2_queue *)priv->tx_vq[i]; + if (!dpaa2_q->cscn) + rte_free(dpaa2_q->cscn); + } + /*free memory for all queues (RX+TX) */ + rte_free(priv->rx_vq[0]); + priv->rx_vq[0] = NULL; + } +} + static int dpaa2_eth_dev_configure(struct rte_eth_dev *dev) { @@ -868,23 +897,13 @@ dpaa2_dev_stop(struct rte_eth_dev *dev) static void dpaa2_dev_close(struct rte_eth_dev *dev) { - struct rte_eth_dev_data *data = dev->data; struct dpaa2_dev_priv *priv = dev->data->dev_private; struct fsl_mc_io *dpni = (struct fsl_mc_io *)priv->hw; - int i, ret; + int ret; struct rte_eth_link link; - struct dpaa2_queue *dpaa2_q; PMD_INIT_FUNC_TRACE(); - for (i = 0; i < data->nb_tx_queues; i++) { - dpaa2_q = (struct dpaa2_queue *)data->tx_queues[i]; - if (!dpaa2_q->cscn) { - rte_free(dpaa2_q->cscn); - dpaa2_q->cscn = NULL; - } - } - /* Clean the device first */ ret = dpni_reset(dpni, CMD_PRI_LOW, priv->token); if (ret) { @@ -2027,8 +2046,7 @@ dpaa2_dev_uninit(struct rte_eth_dev *eth_dev) { struct dpaa2_dev_priv *priv = eth_dev->data->dev_private; struct fsl_mc_io *dpni = (struct fsl_mc_io *)priv->hw; - int i, ret; - struct dpaa2_queue *dpaa2_q; + int ret; PMD_INIT_FUNC_TRACE(); @@ -2042,17 +2060,7 @@ dpaa2_dev_uninit(struct rte_eth_dev *eth_dev) dpaa2_dev_close(eth_dev); - if (priv->rx_vq[0]) { - /* cleaning up queue storage */ - for (i = 0; i < priv->nb_rx_queues; i++) { - dpaa2_q = (struct dpaa2_queue *)priv->rx_vq[i]; - if (dpaa2_q->q_storage) - rte_free(dpaa2_q->q_storage); - } - /*free the all queue memory */ - rte_free(priv->rx_vq[0]); - priv->rx_vq[0] = NULL; - } + dpaa2_free_rx_tx_queues(eth_dev); /* free memory for storing MAC addresses */ if (eth_dev->data->mac_addrs) {