From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0064.outbound.protection.outlook.com [104.47.36.64]) by dpdk.org (Postfix) with ESMTP id 0D4B62BA2; Tue, 18 Apr 2017 16:42:29 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=aDZnsI/I8ymm4MM92vYXSiqmPilR26pwa4uiYhwaMdQ=; b=lMzpT38uyuUR/012Koev+WhKzWEjPPFSMLXqGb847ye8MuntuC3YkC5o3cH4tFFDxnT9KYkglmsqqs6li0DXSqE5fqQ4e/ekAAdLABkxhmylFehOIvnCwiWymNyhpQwuPue6Fm6F1aLvw8o/IpFwVV0XIs63nGwOnATWEviPaY8= Authentication-Results: 6wind.com; dkim=none (message not signed) header.d=none;6wind.com; dmarc=none action=none header.from=caviumnetworks.com; Received: from localhost.localdomain (111.93.218.67) by CY1PR0701MB1726.namprd07.prod.outlook.com (10.163.21.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1034.10; Tue, 18 Apr 2017 14:42:25 +0000 From: Santosh Shukla To: olivier.matz@6wind.com, dev@dpdk.org Cc: hemant.agrawal@nxp.com, shreyansh.jain@nxp.com, Santosh Shukla , stable@dpdk.org Date: Tue, 18 Apr 2017 20:11:28 +0530 Message-Id: <20170418144130.1777-1-santosh.shukla@caviumnetworks.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170418083448.24743-1-santosh.shukla@caviumnetworks.com> References: <20170418083448.24743-1-santosh.shukla@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: BM1PR01CA0096.INDPRD01.PROD.OUTLOOK.COM (10.174.208.12) To CY1PR0701MB1726.namprd07.prod.outlook.com (10.163.21.140) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8e7fdbdb-fb80-4537-6c37-08d486692304 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131423075)(201703031133081); SRVR:CY1PR0701MB1726; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1726; 3:pvM7J2zfDx//pocFIh1gq3S944xdTzZqnvzkUwOQIqkeFSjDX2D+ryh8UTmu9SZEVHUjG+Kf8EPTuTvaejIrXb0AnIpyQT12DbR8qXhWyLfbA3oARgm56EUlJYMU440NqWXgDnvcHHbrP4HN4u4bxoTfa6bZdKsu6s9aU8BV76qtZX2HbG0JFPtvxhYGyAWD9C+BYy20gKRzuHP2dL7eozmBvxlKbUSiwLLRWoqI0Up2+rl0+Co17/AgxnkGB7av+pDMncVBTZr1KOfAm1JfdwA5flNYE62k+BP2oC2OMceAsypg+lIpsgVzf4Hbw3DB5PrXPL62SR9YMo1gnLxfKw==; 25:/ZfArfAxSgcAsyekm2zIuFhCvYcf3CsHsNQt3cjaCzuSusL+65OFT4G7IKa+5aEVwk3D/AY5MGf46zG0a+EDnApdiMiZLxLESSw9iNkW20YtmmMTi6iMZA024huAxJVvzgTTs46wHRU0Ef37B/stWmjCcztxIuil4tG8v8JhJFyXyCGrs5akLoVtcVkhQwlDpKkFdvWKZG+tBRcRhRaKe1UhJty9/29tr4c0VM2KRffwwlNtmPYcztH1zccMLvlrr6c2c0zjImmcUugn1GtZVGq4GYsb5SULrT99gGkkzsq4VKmVtyHjKn1wsxFtdvfoJWrMqow1ApsDadu+IUhN48tAaQ2qKZ8wAGXaiScOf5a2l3ESOM7maj7zbLdShCk99+lkIxlkLBnIe1t6DLSvHBGzFR1XFY465zfD2gu/TX0xkxkTEfMpGq1WM9ye5NcYWS0JQeQrtF6EsaF6V+wQzw== X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1726; 31:ZIDy4T5k1Vi/sl5SccaMvWA3skpn0RSqK2x1Z3qDmnVAuHXFPqIkD6xvuzL12z24n/7svNChzO3oS8AwjIcP8wRV1IYxBLTUaDLI7NqKuROtoVXDwdQcejjJg45Rs1LfwRvAmI8NI4PMmH8wtj+T25lwOgJBDIl1VipAPOQjmG6TgaL8AyrfG0s2RKCPQhIxT7cFNltThwrJCbDCouC7HInPiJFVofvrt2Zk3vH3ECw=; 20:9DwE03HXJFI2+0wSDxjoJzvTd45OoSt7eFOb1RVY1kdVq24Sc/FV5MFA8mleWxY38k2dVnIea08xBPkRd9ujysEjWIcwgTnbzlpj+QC/C0KY6kilVrdmR9i9ndu6pI81Mog77Syhylfg647e+2kMz7txhTCwMDSUku0VmNGwwYf33k7o2yhcOcNVMHDK4IjK7tM4e9RXydJdbnP06DFvMYHBc8XNA2VKz5in07qPv7JScGDQL4RTiXpUdEViZoOnBUA43de6gpJjUd8mmPj07d4seuL4fT20Sjypb+CCYgpf+bFP21AY9KQxZfeg8CBJ1Xm26pCAs5DpI3SRHiqbBM2pO+tuFcTo4hTKbaXj3I6xu6BBEdPBt0fMJs68xTK23dmh6oA6yBCstpL7VxulLPYh0OT93Q9ozocNRhLxG3nKHZe/pn/6UEXvnWx/amsCaTMBAeOkOkrOrJ7wOVDWA8RW/FiVsl8yhOA3dmuHiNs1k5WydFUfGQ5CwY3ojx3q9xcBP2cvgti2Rme5ID17SR2lGm3JfTaLSJQec1lVhbozOWomW14qRMAdYgROgdAteXb2fjmHCcokkWBxxSNc4OGo9BJngl5AOb4kHiI9uY4= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(93006095)(6041248)(201703131423075)(201702281528075)(201703061421075)(20161123564025)(20161123560025)(20161123555025)(20161123562025)(6072148); SRVR:CY1PR0701MB1726; BCL:0; PCL:0; RULEID:; SRVR:CY1PR0701MB1726; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1726; 4:/iHQlLVYCDgxkXEsZlIjdiaKZR5LdJyNcJrqRw6zev3eJ1xvWjL7l5H/hRnNylYlwnkg7AVttIb75px2OhKhP5Dv2qGZvrDY7Hp3LsPqjN7gAWJ5d3H3wdzKSaGjfKcg/k4+A5FZhn1vhJlM50hZMTg7GfKysCc9IYdhQNkFC5XJ90H/p/wO/jVtlWG2DBzfMC/ZWl6jKDcWmsi6HAaAuT0eAvzHYvImKhptd5AHlAGXbnhVL2TvUt0ElUW/g+v+Tjm3XGLO3AKOPYgeMWmD56Av9uli50hNlpejxUTr5WNiNctLjwLOkSX37yPYmoSFm/GeK86FBNy0AQC2qg3qZkFIu75ImPoNPxfLDHyuEAzyVbWJ1QXRZnUdN7j6WxLq64DkmSF4ZEIhEIsuj7uVk7wE41eFHto3iV2CE1YZkqUH/PZRgCYHJq98hYd66v+Rhr/Jr5wW6qBk/1M+JZiHgS4yTCI/p/jzsC0gRjKi0FMlydjyrMgN4eknMXhiFM8/XQpCjrHOx+wL3j03BXxGP2bV1h9xMx64zQeDj3NCeVOwZjMJ5D9qpdAux7DO91NwDTVNhkXOZCUqDJLvzmI8mVD39ZgFrNLWj9wJmMpylAfJkafkiehdYRTGD1C5uLDOjL4VeiCkYcpl6oIyIX+CniFC7TyjcCFI7L1t9P/iaguyBC2kzX/ubrRI6wW2X6/r X-Forefront-PRVS: 028166BF91 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6069001)(6009001)(39840400002)(39450400003)(39850400002)(39410400002)(39400400002)(42882006)(48376002)(2950100002)(50466002)(6486002)(50226002)(5660300001)(6506006)(5003940100001)(110136004)(38730400002)(66066001)(4326008)(76176999)(47776003)(25786009)(50986999)(5009440100003)(6306002)(8656002)(305945005)(1076002)(2906002)(53936002)(966004)(6512007)(7736002)(3846002)(6116002)(81166006)(42186005)(189998001)(36756003)(8676002)(33646002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0701MB1726; H:localhost.localdomain; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR0701MB1726; 23:ucsW6HXGh0eCzcvxkuz8CjMG7PHIdzIKtuXlHw+?= =?us-ascii?Q?c/5dSmU0CzrgAGvzScm6TaznpFQLH2mzVYMTMECbblFCosq8KXRvla/UAp47?= =?us-ascii?Q?kEv7dA/w/jA0NDZv+AIMMRbhOpQDXNkE4PPdXXOOUuq2UxmYPkuCa+dw10ro?= =?us-ascii?Q?ZNVsKclos0pso2pdStVc7fwaRysh2zzotlItfoza/Wn1Cp9pLqudBf/Bwvgn?= =?us-ascii?Q?9QetfN6av0tUuyfaQvPCfiBrcz2k0fK31CUk3CKS4NiWPXocsrSDLgj0BqmK?= =?us-ascii?Q?BPxJIbKXQa9pkopm73idZSdGi0/0/hhGHXosHVF6BYIl6RNAZs4k/ToLy+EM?= =?us-ascii?Q?ebQsCsa4t5ZP74kMCCE96VKRRPX8oMl4tJvIjtSNiRu81aEO2q0dWin4tXR/?= =?us-ascii?Q?nKAAWSMamQzU+j0/Lo5hKUozqJqiRbKjJmEWKyB1js/ChNYgz7tEKmphmKmi?= =?us-ascii?Q?rq49h/CL7MYDuUdUD77VaI7/s/bjiJg9dJTDocJC92+BYy3PI7HHee+hzOc/?= =?us-ascii?Q?9p9FX97zWSJNjjLh98RJG5LVMtc2ZTMlmOEEf8CoRY1RDxLVi1fl5CDxgxRU?= =?us-ascii?Q?WWbF749EcXAxmkE9ytg6e7lm6WvJGZXJHO1Y5YU9CMtroJ90aSq16+kPq9/N?= =?us-ascii?Q?xp+R+mWH0S9zeQPoYEsN3AxsjMJVNxeNN9rTZMFTPZHu4U/Mekfj4Rsicfls?= =?us-ascii?Q?ggHOHL49V2fM8I23ZhdO2Vj/WRJgw4V33dok5o5/ONQHbJz1oH5lGDh9tupp?= =?us-ascii?Q?gzAfp7jacPzRetPs2I0KAAcyOpKRLB0wRSbzdQmTE0tvrSNw4w1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1qOKIVylD4mL1WqRTfj3Ih7EM3Tbp//IzNhrFqGeUU/meufJfesUO9ExF8aEKfrg75zQU1Uo= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1726; 7:8byv3P5k0oH647QPtXJOSJm4WH1YRZgd3ku/V9nKfFvTCiEWLDCUYU2loue3yS6i9jYBBL3Sef5EL1lj22hq5qUtLgEF2zfkRxEJadcmGwZXNcDgyhb2ouLKo5mkCvMc6H3Sj9Og8eU0s3HGFLON4j1xUiZXoBmDmZFUHLy9W3ybgMUIE3soH/95XvGmAnqbu+VH8dBqad5PP6Y35kF48OOiyy6Ifvdky+kB9hDSpC9Vh/MdhVh/qPvksLcLb9MhxNjBNmcpKsSOXNEepGQ/cheaU/WQDDLm5xQq9EammOiTdeBOUJ8K/h+UtVRZoVct2uToP/U94IL9IsqLLDIjtA== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Apr 2017 14:42:25.5597 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0701MB1726 Subject: [dpdk-dev] [PATCH v4 1/3] test/test/mempool_perf: Remove mempool global vars 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: , X-List-Received-Date: Tue, 18 Apr 2017 14:42:30 -0000 Cc: stable@dpdk.org Signed-off-by: Santosh Shukla --- v3 --> v4: - removed extra mp local var. - Includes nit changes refer http://dpdk.org/dev/patchwork/patch/23680/ test/test/test_mempool_perf.c | 63 +++++++++++++++++++++---------------------- 1 file changed, 30 insertions(+), 33 deletions(-) diff --git a/test/test/test_mempool_perf.c b/test/test/test_mempool_perf.c index ebf1721ac..1b4045eb3 100644 --- a/test/test/test_mempool_perf.c +++ b/test/test/test_mempool_perf.c @@ -109,8 +109,6 @@ goto label; \ } while (0) -static struct rte_mempool *mp; -static struct rte_mempool *mp_cache, *mp_nocache; static int use_external_cache; static unsigned external_cache_size = RTE_MEMPOOL_CACHE_MAX_SIZE; @@ -144,10 +142,11 @@ my_obj_init(struct rte_mempool *mp, __attribute__((unused)) void *arg, } static int -per_lcore_mempool_test(__attribute__((unused)) void *arg) +per_lcore_mempool_test(void *arg) { void *obj_table[MAX_KEEP]; unsigned i, idx; + struct rte_mempool *mp = arg; unsigned lcore_id = rte_lcore_id(); int ret = 0; uint64_t start_cycles, end_cycles; @@ -221,7 +220,7 @@ per_lcore_mempool_test(__attribute__((unused)) void *arg) /* launch all the per-lcore test, and display the result */ static int -launch_cores(unsigned cores) +launch_cores(struct rte_mempool *mp, unsigned int cores) { unsigned lcore_id; uint64_t rate; @@ -249,13 +248,13 @@ launch_cores(unsigned cores) break; cores--; rte_eal_remote_launch(per_lcore_mempool_test, - NULL, lcore_id); + mp, lcore_id); } /* start synchro and launch test on master */ rte_atomic32_set(&synchro, 1); - ret = per_lcore_mempool_test(NULL); + ret = per_lcore_mempool_test(mp); cores = cores_save; RTE_LCORE_FOREACH_SLAVE(lcore_id) { @@ -282,7 +281,7 @@ launch_cores(unsigned cores) /* for a given number of core, launch all test cases */ static int -do_one_mempool_test(unsigned cores) +do_one_mempool_test(struct rte_mempool *mp, unsigned int cores) { unsigned bulk_tab_get[] = { 1, 4, 32, 0 }; unsigned bulk_tab_put[] = { 1, 4, 32, 0 }; @@ -299,7 +298,7 @@ do_one_mempool_test(unsigned cores) n_get_bulk = *get_bulk_ptr; n_put_bulk = *put_bulk_ptr; n_keep = *keep_ptr; - ret = launch_cores(cores); + ret = launch_cores(mp, cores); if (ret < 0) return -1; @@ -312,67 +311,65 @@ do_one_mempool_test(unsigned cores) static int test_mempool_perf(void) { + struct rte_mempool *mp_cache = NULL; + struct rte_mempool *mp_nocache = NULL; + rte_atomic32_init(&synchro); /* create a mempool (without cache) */ - if (mp_nocache == NULL) - mp_nocache = rte_mempool_create("perf_test_nocache", MEMPOOL_SIZE, - MEMPOOL_ELT_SIZE, 0, 0, - NULL, NULL, - my_obj_init, NULL, - SOCKET_ID_ANY, 0); + mp_nocache = rte_mempool_create("perf_test_nocache", MEMPOOL_SIZE, + MEMPOOL_ELT_SIZE, 0, 0, + NULL, NULL, + my_obj_init, NULL, + SOCKET_ID_ANY, 0); if (mp_nocache == NULL) return -1; /* create a mempool (with cache) */ - if (mp_cache == NULL) - mp_cache = rte_mempool_create("perf_test_cache", MEMPOOL_SIZE, - MEMPOOL_ELT_SIZE, - RTE_MEMPOOL_CACHE_MAX_SIZE, 0, - NULL, NULL, - my_obj_init, NULL, - SOCKET_ID_ANY, 0); + mp_cache = rte_mempool_create("perf_test_cache", MEMPOOL_SIZE, + MEMPOOL_ELT_SIZE, + RTE_MEMPOOL_CACHE_MAX_SIZE, 0, + NULL, NULL, + my_obj_init, NULL, + SOCKET_ID_ANY, 0); if (mp_cache == NULL) return -1; /* performance test with 1, 2 and max cores */ printf("start performance test (without cache)\n"); - mp = mp_nocache; - if (do_one_mempool_test(1) < 0) + if (do_one_mempool_test(mp_nocache, 1) < 0) return -1; - if (do_one_mempool_test(2) < 0) + if (do_one_mempool_test(mp_nocache, 2) < 0) return -1; - if (do_one_mempool_test(rte_lcore_count()) < 0) + if (do_one_mempool_test(mp_nocache, rte_lcore_count()) < 0) return -1; /* performance test with 1, 2 and max cores */ printf("start performance test (with cache)\n"); - mp = mp_cache; - if (do_one_mempool_test(1) < 0) + if (do_one_mempool_test(mp_cache, 1) < 0) return -1; - if (do_one_mempool_test(2) < 0) + if (do_one_mempool_test(mp_cache, 2) < 0) return -1; - if (do_one_mempool_test(rte_lcore_count()) < 0) + if (do_one_mempool_test(mp_cache, rte_lcore_count()) < 0) return -1; /* performance test with 1, 2 and max cores */ printf("start performance test (with user-owned cache)\n"); - mp = mp_nocache; use_external_cache = 1; - if (do_one_mempool_test(1) < 0) + if (do_one_mempool_test(mp_nocache, 1) < 0) return -1; - if (do_one_mempool_test(2) < 0) + if (do_one_mempool_test(mp_nocache, 2) < 0) return -1; - if (do_one_mempool_test(rte_lcore_count()) < 0) + if (do_one_mempool_test(mp_nocache, rte_lcore_count()) < 0) return -1; rte_mempool_list_dump(stdout); -- 2.11.0