From patchwork Wed Aug 17 09:59:21 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Elo, Matias \(Nokia - FI/Espoo\)" X-Patchwork-Id: 74052 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp2424034qga; Wed, 17 Aug 2016 03:00:28 -0700 (PDT) X-Received: by 10.200.43.105 with SMTP id 38mr44082285qtv.73.1471428028901; Wed, 17 Aug 2016 03:00:28 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id v51si20565317qtc.2.2016.08.17.03.00.28; Wed, 17 Aug 2016 03:00:28 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE dis=NONE) header.from=nokia.com Received: by lists.linaro.org (Postfix, from userid 109) id 49FD460D2E; Wed, 17 Aug 2016 10:00:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAD_ENC_HEADER,BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id EA35660BD9; Wed, 17 Aug 2016 10:00:17 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 0751B60C3A; Wed, 17 Aug 2016 10:00:12 +0000 (UTC) Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00094.outbound.protection.outlook.com [40.107.0.94]) by lists.linaro.org (Postfix) with ESMTPS id 142E860B0D for ; Wed, 17 Aug 2016 09:59:59 +0000 (UTC) Received: from VI1PR07CA0089.eurprd07.prod.outlook.com (10.165.229.143) by DB6PR0701MB2951.eurprd07.prod.outlook.com (10.168.84.13) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.549.15; Wed, 17 Aug 2016 09:59:56 +0000 Received: from DB3FFO11FD033.protection.gbl (2a01:111:f400:7e04::122) by VI1PR07CA0089.outlook.office365.com (2a01:111:e400:7a52::15) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.587.9 via Frontend Transport; Wed, 17 Aug 2016 09:59:56 +0000 Received-SPF: Pass (protection.outlook.com: domain of nokia.com designates 131.228.2.240 as permitted sender) receiver=protection.outlook.com; client-ip=131.228.2.240; helo=fihe3nok0734.emea.nsn-net.net; Received: from fihe3nok0734.emea.nsn-net.net (131.228.2.240) by DB3FFO11FD033.mail.protection.outlook.com (10.47.217.64) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.567.7 via Frontend Transport; Wed, 17 Aug 2016 09:59:55 +0000 Received: from fihe3nok0734.emea.nsn-net.net (localhost [127.0.0.1]) by fihe3nok0734.emea.nsn-net.net (8.14.9/8.14.5) with ESMTP id u7H9xLGa019015 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 17 Aug 2016 12:59:21 +0300 Received: from 10.144.19.15 ([10.144.104.92]) by fihe3nok0734.emea.nsn-net.net (8.14.9/8.14.5) with ESMTP id u7H9xLED019008 (version=TLSv1/SSLv3 cipher=AES128-SHA256 bits=128 verify=NOT) for ; Wed, 17 Aug 2016 12:59:21 +0300 X-HPESVCS-Source-Ip: 10.144.104.92 From: Matias Elo To: Date: Wed, 17 Aug 2016 12:59:21 +0300 Message-ID: <1471427961-17187-2-git-send-email-matias.elo@nokia.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1471427961-17187-1-git-send-email-matias.elo@nokia.com> References: <1471427961-17187-1-git-send-email-matias.elo@nokia.com> X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:131.228.2.240; IPV:NLI; CTRY:FI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(7916002)(2980300002)(438002)(199003)(189002)(2950100001)(77096005)(87936001)(356003)(47776003)(626004)(8936002)(48376002)(50466002)(8676002)(19580395003)(305945005)(81156014)(7846002)(19580405001)(36756003)(2906002)(76176999)(106466001)(50986999)(68736007)(11100500001)(5003940100001)(81166006)(16796002)(50226002)(107886002)(33646002)(110136002)(97736004)(2351001)(450100001)(189998001)(92566002)(229853001)(586003)(42882005); DIR:OUT; SFP:1102; SCL:1; SRVR:DB6PR0701MB2951; H:fihe3nok0734.emea.nsn-net.net; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; DB3FFO11FD033; 1:2BBRLHMt7x34Xdvpg7YQqdp06wroQjAUIXD70leJeY6MF912fE6OdYUXhLL8Mw2VK8oHxfR1kW/9CSGPyfeBCeJmSk6eK+acmIQrWvL9lzso7mec7FcKjDTC4Emb8HUbq/m2bGSlcSWW7pIdLmczqD/vy6wRgoPHy14/KWzuMZTSPMzhb4vAy0khA+2YQcd0nrIVyRGcTkhoPnouUZlRdxDEWMR2bfPglx9f92LHa/4lOlP+qK5LHmkTUKOYXDw6R3fbl1w9OdMcqraSRIGnzzAZpv3EH4oZ2hEc+SvU6bstEarwCTRwjr8stkP/9YBpgKap4Uj8OnEIcYbmNSnamcixLOpVp74rqhYzER3xBV9SB3JUEBgnVU5N21DnPPJiYqyHZrIExaDqE6v9DuujjkvLj+xos4GpgUMohLmdEKPEl1fGD0JYEdQ4y6l7OYLZcyBx57sZS1P/IflTiDzadNTHz5g07vFV4Ymk9YwQBdk= MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 5f7760f1-9bb7-430b-d991-08d3c6853e24 X-Microsoft-Exchange-Diagnostics: 1; DB6PR0701MB2951; 2:mkOFOCcZytD/U8lfAJXZChgMfQBN7mwIY7GqKRbABrdS35QwdcOZPUL4ntgNMzUZn8XkWW9bRvbmjFEzf+iGlveyBft296SqMzos1MP3X/Mya7mM89lyAc2sEf57XnvBKeWJHc5z0AT5j04u55sQ3PqL5jwG2MXMZOeWT6LzYVtZP0S2bzR32hW8HiyPJzFH; 3:5D9X2D3MprSgAiVdnk3kzwkBs79Os1IBqGDIWDtPdxLWS3eE35tYngL/3UBmjzDt6i9Y5lu4n7oIsAUHooKNBZSzi2Okl00QpfGMANRI9lWKeymr0eWlNGIxXgny/Ogc2DyQEHSrmgy5CE6PsG8nZIhcJ2GuFaa8zCTfAVO7U+zCMQ2iqGvsVh8Qgs+SfqfZfA1Eb2N80tugFGrhbrjfz6CH1hnIwn/QGHpOq+Qd+qwpOGxHY3KUIRbtFyQPC31XaWE/6Amo9srhnGK0W3xL+A== X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(8251501002); SRVR:DB6PR0701MB2951; X-Microsoft-Exchange-Diagnostics: 1; DB6PR0701MB2951; 25:YzhrtJQxQjPc1lqU/5LlZSOTg2l0YMjzeIw3vve5LPwK7wINv5pLOaxpLvbjoz/GZ3tIfLpegBQuNw3Ab2zTXjl0gcFDVyoMpFpeMor4no4SxnFWY9dSAnpOunlA3iIojR2WOqefQ6TgNqI+a/vXmmhXSBopBIH/5gYhKOLriJm7MNqXj2/yCRL14lq1tqfN2TChowqrFoWzOYm2In+gb6QIDW63CqQPYmF1mZDxSc800AoekqzJeztACDhmlXLyCMVn7kbRtOA/GyjDyWlWNYzFYawikHpqC/sD8Yabyv5jTFJsf+MnAMIlwn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GOT8bCgTqsxAGswuW2kr/vD2hjjMO9xOgJ/+ByhNw3cycYQt4VXasxS9k51e3VA69nQgKOQfAx5Wpk+nftH2tOe6AN3kc8XD9NEDfYIhxXBoHIvDbnN9veK3qOcpyRNI03cvsO3nXl/1BmOFiZSpHdV9+vHPqVvVY42qAmWu7hUADUro0PBoOeLbnp6wcgGZ6f9VKhKUjdLoVqA6qlyBHuE5FGXNZl7Z5hd5InxK+gI30xZINw= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(82608151540597); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(13018025)(8121501046)(13016025)(5005006)(3002001)(10201501046)(6055026); SRVR:DB6PR0701MB2951; BCL:0; PCL:0; RULEID:; SRVR:DB6PR0701MB2951; X-Microsoft-Exchange-Diagnostics: 1; DB6PR0701MB2951; 4:zh3r0CrE6nrYRewU22XojUgCoV08C8BMMPdsA3FqfGKg9QCg07RWloVCWc5et+S7c81zmXlUSMsFpWTgLBNLd354wM1+rV0G31IHIUeLmhRRXSxMXUxSnCncRcCRQ5LwdwSY7Otf9UnWLS1n02do5Ycc58fGe2zvAv8nXftPS6yve7xvqvcE3cuWuq4jKeqbF2too+V3QAB9b42zS96wYwkxRsMOR/QyGJt+DA8sWoE/2XuPScHGhhefhTwA5OHHFwcVxgPFtPB0R4fpM3PVWBACC/mYDC4vyrb/vynO9fp/WSr/ZsLIwiEJeSS46dOI/P2CJpXjVWAnPpZerdTaGIBb5OIe08nR8xBzLUraATOfm8p4TV73dWkw5GjgmcbQpOF8jy9YuUZ51qhKwAn7pbxTI4TBSnjJcL1ULkyNcu3+l/q6l3tAIiKRZpGvtt49RZrP81aT+pVfeE0IRpSdQQ2M2sl9johLWWoI0ZheXXg= X-Forefront-PRVS: 0037FD6480 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DB6PR0701MB2951; 23:lpGlQAh5qFSfobL/TWgVpmGvB2SU5hbcxusi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oFx7i+zoqa9mDg5ZWM7nVYVzpqQxYGU+PwyUuVyKYQtITFiLy72JtWd1a SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nokia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Aug 2016 09:59:55.9620 (UTC) X-MS-Exchange-CrossTenant-Id: 5d471751-9675-428d-917b-70f44f9630b0 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5d471751-9675-428d-917b-70f44f9630b0; Ip=[131.228.2.240]; Helo=[fihe3nok0734.emea.nsn-net.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0701MB2951 X-Topics: patch Subject: [lng-odp] [PATCH 2/2] linux-gen: dpdk: free used mempool when closing pktio device X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" DPDK 16.07 finally supports freeing memory pools. Signed-off-by: Matias Elo --- platform/linux-generic/pktio/dpdk.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) -- 2.7.4 Reviewed-by: Bill Fischofer diff --git a/platform/linux-generic/pktio/dpdk.c b/platform/linux-generic/pktio/dpdk.c index bf8b499..b45c9a8 100644 --- a/platform/linux-generic/pktio/dpdk.c +++ b/platform/linux-generic/pktio/dpdk.c @@ -390,6 +390,8 @@ static int dpdk_close(pktio_entry_t *pktio_entry) if (pktio_entry->s.state != PKTIO_STATE_OPENED) rte_eth_dev_close(pkt_dpdk->port_id); + rte_mempool_free(pkt_dpdk->pkt_pool); + return 0; } @@ -650,14 +652,9 @@ static int dpdk_open(odp_pktio_t id ODP_UNUSED, else pkt_dpdk->min_rx_burst = 0; - /* Look for previously opened packet pool */ - pkt_pool = rte_mempool_lookup(pkt_dpdk->pool_name); - if (pkt_pool == NULL) - pkt_pool = rte_pktmbuf_pool_create(pkt_dpdk->pool_name, - DPDK_NB_MBUF, - DPDK_MEMPOOL_CACHE_SIZE, 0, - DPDK_MBUF_BUF_SIZE, - rte_socket_id()); + pkt_pool = rte_pktmbuf_pool_create(pkt_dpdk->pool_name, DPDK_NB_MBUF, + DPDK_MEMPOOL_CACHE_SIZE, 0, + DPDK_MBUF_BUF_SIZE, rte_socket_id()); if (pkt_pool == NULL) { ODP_ERR("Cannot init mbuf packet pool\n"); return -1;