From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0071.outbound.protection.outlook.com [104.47.32.71]) by dpdk.org (Postfix) with ESMTP id 11A4D234; Tue, 18 Apr 2017 10:35:27 +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=nSAEXlcbCselBSiL5zFK9tseU46k4auktD16+r5w7Z0=; b=eppav3wybffOTIUvqHbhz7GSOvL35Xkk18KT7ThmEKChVZz0uIc6yUUhoIrGkIuyKH7oWm8yMvSJKBrag1jqRqtE1PaACMenLAQ8QJsKbE3yveJIcl/u1Qxg6DhFiujx7pXd8R6filN8oXvtio7SCI0veEGGDTp+i3J3raGCOcM= 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 08:35:23 +0000 From: Santosh Shukla To: olivier.matz@6wind.com, dev@dpdk.org Cc: thomas.monjalon@6wind.com, hemant.agrawal@nxp.com, shreyansh.jain@nxp.com, Santosh Shukla , stable@dpdk.org Date: Tue, 18 Apr 2017 14:04:46 +0530 Message-Id: <20170418083448.24743-1-santosh.shukla@caviumnetworks.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170406064549.7966-1-santosh.shukla@caviumnetworks.com> References: <20170406064549.7966-1-santosh.shukla@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: MA1PR01CA0074.INDPRD01.PROD.OUTLOOK.COM (10.174.56.14) To CY1PR0701MB1726.namprd07.prod.outlook.com (10.163.21.140) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 29d4b4ce-d586-4cb6-d6c1-08d48635dcde X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131423075)(201703031133081); SRVR:CY1PR0701MB1726; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1726; 3:0ncTT/HCJMmgkX3T/1u7+Ok79vZe4qQNN0OEjLeUrwOiEximKl0AtIQKlQEf5/+uLLnUI9TmKWG/PT0ztMyJSAvCI53AsbJYDnYKwn9g77gE8U5rmvXNyeBMxt0aDNMP02jk1t/O9d4U4r8ytMECCdEaO+NXJeKqPFjS9a8lxxPuLhlpzQlosZOJjyAxlVDC+4iiTp8GinKv/IA8DKFVASidMOdq9w1P7tLjSID8pec5xQhmnba6Tuq76dMRnIHUXo0+nc/JdpZ3r8L9A51LwvpLSdf+ZORrFxms8dsqS0IvH+4faazQbMB60e9I/uzWCX9S4AGyGWgBLTSEFsj9ww==; 25:Xf0dZohLtkeeXOqMGHtMeP3usWK+P4Rn8O1Hg38aDyjffzv6I2m2uJiG1bc9XDQNxI6huH3gL1RjnDEMPgH5jbTsHhwZZtLtVqAadC5QEpMX7m95CaR91JCUrlBeBGOCt1ZmQarorEmMsJKSCuGZ3gW2+BvpK4/CYXJOsG2hjbTSb6ZDA1UwFxwV+S3aWlkOGRrroquTeICvqZw1PRnMlduqIJgXijlIwRmsIyHgL7bHRvim4d/fYa52kwWUHdaUJHN57bqqms/zvfNqlrWQribz9NHufMsVU0MR1SLm752Jcfsd/63JqKQ0BGb4Y6yzLhw9iMmtBTOrtOfjoE5ADuz1uU7WK7Nsd6NmI9wo/ggPBtTgBKtkGHglV/+wpvOfNc8U0mrz2SaYUVa8Prwf6BUt/5BglmeSLIHyn5iRW8Wh5CknDpS+lFVE5DKn8oTQ6GxiOwnbV/g1MeKakMWzQQ== X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1726; 31:kK0jGEkQMTXfJdjtBXpaEtAAVYFXwOo126ku6mMwrHNB3ETH0YGpuOUtkC284EkqVVNskmP59Yc857yFHX2cIzaknfNts+9GCYOAy3c6C0OULC0VrOq1Urn+dH+DC1d9DpKP+kCxpk0bVMgMuEezL+US07HpHjGqSrNV2JeHjJEDsJl/XV+fr1ZO5LHcXO9z4Mcx0wNhH0uQariU6IdjYCapvfxRoWoKm1YFqPkSLpM=; 20:3cnOxc2GBkDQqNNJq+869QqDwTouGGtSqs+BhNhf1gk1yVPkRpAkEP/xsRKns6qDVkcGuzjfSN4YyZ/hEk69KpizTQZmt1hy6TmGAJDGPPfRf8v/Rf3op8j+xJi/gztSvvSaTXz6V209gY48a4J+7k7SrvmcCQXIZWUZJVYVE1kS2uaUrbb4vNGhss5XBprDDlpCwKswO9Vz6OioihwKNCRVEpGCom4wnWYsZKzWpiXUmk6NZ2HweirqxBuMkz3qlaCEU+RGK5wVKUkbbjSDFz8ZVV0eqZQ+E9H2GzZJYBrqpBwga6fDEht03kDPn6cfA2h3SKsxekxUpc1COC3aUJ9DOsrRDAkLoI6VTxW23BwTtoCz3P/PWxsNl665fWvFPXZod6IGhEk0HeBCB3f5aKCgcTblq78NDZJCYUQ6CdxdlNghfxSjjXUGMLPNjjC8G0sa1dxKV0HwShcXKmLLwxuW3Bt11QXIp5n/2+piKt9bsoXJnmWkGj+WMARei5NbaJhJPWuuFEmvaBexTLmzdm0RxFBJ5sWD7NXzMnSalUdGcTXIYduxT2pDw5uuofVxf8Dk4dCutuHiaYJrWHsTbASTypR9ykRIjVSvvLUMdHg= 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:5Z+ODc4vHgFgXUtvZs12Bf+CDS0C6Du5XbRxC6vrWpkwDEEmyV3VQ33eBJgjaiJwPxPKCjLHfOMTryvgTZuxytXTmNjiCE1PBIeoM69ZTUl8IBwpRuA4GkI6R6xWLvLo+xmawBFS1aKwILwRRedRz5RxH7P7KjDuP2QEli3PFSRT9+Wa3vVjnLnitmqjFY4s2c8pCNevbOL8Sn0Uzl6vTmzhoO1OiIHulazDEeotuqS8Q+lK6vo159MFt+JZZ2A5EsoOfyfohYdWho60MHtQ3G/gIF1O4YNJReEXJ0nvEXxT9N7MFbZNnFmApwRuYf/+iDr7vgDpAgI49JsxpRjCCfco6yWEC91ypjSTO6Rr5DTbtlrGMr4F7rejkgwi2yEHlZ3qhmN80xMBL0jNcgLiQ9UrGyfUg8rlBALWwTlOyVxjfz+16Q+/GRjFh7Y9W2xH+/w5XcC2UoC6bmUEoWUvgA/gdXfvLNDBcUQlm5M0IH1xfwoVAvpwECM7ndpNrUVPgDr0Tw5UspNwQA3t5xbgkgRgrv0AczWueArS2kdQB7gffROgQkJGdGibRBTSZQtxDc4xOhsOkF1GPpQc/43y9UGX3nrqUQXvKcYXXKru0IhlwU+vw1O4in7tKkPpCD9qdbLHdrR56aGz8ryYGvf5MFSTqr5AHIgIornwxSxvAfKnbJf3QiZ+EMODSOQabfC4 X-Forefront-PRVS: 028166BF91 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6069001)(6009001)(39450400003)(39410400002)(39850400002)(39840400002)(39400400002)(76176999)(5003940100001)(50986999)(6116002)(5660300001)(3846002)(7736002)(50226002)(33646002)(50466002)(48376002)(36756003)(1076002)(42186005)(6666003)(5009440100003)(8656002)(6506006)(189998001)(6306002)(4326008)(53376002)(2950100002)(38730400002)(42882006)(110136004)(6486002)(8676002)(81166006)(305945005)(6512007)(966004)(25786009)(66066001)(53936002)(47776003); 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:optFTc5FmrgJPTf9FpMDITAC9pU4a8fElk/PQCT?= =?us-ascii?Q?20ATv/b3CAtTQrav6ctsf9wBdCFCGXWkRtvVjcGNmzFsTgKspN1Q8y7frPQy?= =?us-ascii?Q?cvaa0rGhD/zhO9zj4WYBSAfhATKiamyGUJBkvmbZQmsxGkFCZVqB2a526o9O?= =?us-ascii?Q?fvJkB6cGQ/PlZwuIy6mRWBceUNP+xdRzHTBsx2uOjXY7gqteSHW0XnkTVjLJ?= =?us-ascii?Q?TlFb1gAenEr/u+Jt7qirPENH+pcW6Jr/iGDpxVaubkHKNW2Llb/F0XouTEPs?= =?us-ascii?Q?ZqMd7OCxt3aNAdO9rO5+6CIZ2IPu/E4EEUIzuyUMLEYiO1IITMpGhQfqxrke?= =?us-ascii?Q?oaLzkTw+LyDXpA+tOQerl2VBGdGhu+yFWjczG7W51EoG5LcQvkJwTObwjfeW?= =?us-ascii?Q?IRN3pr/jgCP1CW5KH+InGqsPxaSy0PM4BEw6m6VTavPopclaXWwKgFj5i/zc?= =?us-ascii?Q?7Q4KzxyCnpbjc27VYlkNVLSRE/tLkkcg2Pbc43aw7O4Odxx7jy69d9yNH+75?= =?us-ascii?Q?lbYvtbB2a4hZaBJhAhh4ZrzInAIDa580CErPsat7PUkNKIwMANTpvl963eGZ?= =?us-ascii?Q?Nh4Kgj3V3ZgWPUMUpnHRHGcTEfy1rQgiJUn5OeAC3k3P/ZGKYAkzRNVCcX5V?= =?us-ascii?Q?ASnzQNuuRYyIAhwgQ927hNkVT7wu98p7CpmhuD8cK31xUkNrDvBZ4LIsrh+Z?= =?us-ascii?Q?kOitMxKWWD1bWH8UcDKkw/7TN7LZr8/PC0q0XVc6Mzue3LjKuqYwQohT311M?= =?us-ascii?Q?dTUP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b8bVQ0DxIM8zP6WMXM5oZxe6rkkzBBnPKAalwi2bC7LCOMVa5sfSeKryKg==; 24:Z/gsIcTeWwmlEJks6WUUE8hBxcaKoRmNdQ9h+lFlJXP/KinwB3Qm8ZKL7vIYr8ZCPXEUXLROpKWDRoIDfJlCB1iN9MLjhl07LigVSEOG/d8= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1726; 7:Bd/Uv6YK4W0Cq+0rjvhYi7XO60kgWhpgfwt7aDLhLhzvVE+jcU76Z+sBRYgApvLkG91gjLPldMkR5UyYircMMKreHT8dCYjSCyUgfEiWnH6hvGxZNOs7fV4K1tDpgv6n/JZLfkfUCFrW+Z9ZAhruntHhCYuEmLN0O/N+bY9IUuyXnXRwMSLNuF6oqsi8iL1x6cnsJbWGPcAfpsMv2tHR8oAjS1AE4mATXSW85ZGE2MjikRz17N1PE+fI7yn7OjUkGBrZBbq3PZhyje/3Bwp/VgxK4fKbS8kEoVYm6VLicI9sBAAGCt5bVBWjEmSxBpE4xcGSuXpGwDQuVkog0VVWNQ== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Apr 2017 08:35:23.1384 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0701MB1726 Subject: [dpdk-dev] [PATCH v3 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 08:35:28 -0000 Cc: stable@dpdk.org Signed-off-by: Santosh Shukla --- v3: - Cleanup code change as per discussion in http://dpdk.org/dev/patchwork/patch/23262/ test/test/test_mempool_perf.c | 61 ++++++++++++++++++++++--------------------- 1 file changed, 31 insertions(+), 30 deletions(-) diff --git a/test/test/test_mempool_perf.c b/test/test/test_mempool_perf.c index ebf1721ac..213fcba5d 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 = (struct rte_mempool *)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 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 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,26 +311,28 @@ do_one_mempool_test(unsigned cores) static int test_mempool_perf(void) { + struct rte_mempool *mp = NULL; + 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; @@ -339,26 +340,26 @@ test_mempool_perf(void) printf("start performance test (without cache)\n"); mp = mp_nocache; - if (do_one_mempool_test(1) < 0) + if (do_one_mempool_test(mp, 1) < 0) return -1; - if (do_one_mempool_test(2) < 0) + if (do_one_mempool_test(mp, 2) < 0) return -1; - if (do_one_mempool_test(rte_lcore_count()) < 0) + if (do_one_mempool_test(mp, 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, 1) < 0) return -1; - if (do_one_mempool_test(2) < 0) + if (do_one_mempool_test(mp, 2) < 0) return -1; - if (do_one_mempool_test(rte_lcore_count()) < 0) + if (do_one_mempool_test(mp, rte_lcore_count()) < 0) return -1; /* performance test with 1, 2 and max cores */ @@ -366,13 +367,13 @@ test_mempool_perf(void) mp = mp_nocache; use_external_cache = 1; - if (do_one_mempool_test(1) < 0) + if (do_one_mempool_test(mp, 1) < 0) return -1; - if (do_one_mempool_test(2) < 0) + if (do_one_mempool_test(mp, 2) < 0) return -1; - if (do_one_mempool_test(rte_lcore_count()) < 0) + if (do_one_mempool_test(mp, rte_lcore_count()) < 0) return -1; rte_mempool_list_dump(stdout); -- 2.11.0