From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0089.outbound.protection.outlook.com [104.47.34.89]) by dpdk.org (Postfix) with ESMTP id E86309E3; Tue, 18 Apr 2017 16:39:47 +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=uMv4024ArRAOD6oMHJgTPYAxFbbFjXJkqMAvKAlpyU4=; b=E/9toNHhb5C7bByBarRcjaxvWY/vjDUmu4U/PLq9/DkHyIQhY8IBVIQwknQkmC7MOfPmqdTQ1qHQhfqhD6jPFb/jYTvycqNBudZiqNPWbTGDuvXmDT95MaYAJgE10E2wX6/FfYUXBJOivlvfKFNboPb9bs98pR5uCMpXmE6vd4M= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=caviumnetworks.com; Received: from [10.160.0.40] (111.93.218.67) by BN3PR0701MB1719.namprd07.prod.outlook.com (10.163.39.18) 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:39:42 +0000 To: Olivier MATZ References: <20170406064549.7966-1-santosh.shukla@caviumnetworks.com> <20170418083448.24743-1-santosh.shukla@caviumnetworks.com> <20170418154243.4ec32620@glumotte.dev.6wind.com> Cc: dev@dpdk.org, hemant.agrawal@nxp.com, shreyansh.jain@nxp.com, stable@dpdk.org From: santosh Message-ID: <5922a6af-b637-b7a9-59d6-2bbf836b0ff4@caviumnetworks.com> Date: Tue, 18 Apr 2017 20:09:26 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <20170418154243.4ec32620@glumotte.dev.6wind.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: BM1PR01CA0098.INDPRD01.PROD.OUTLOOK.COM (10.174.208.14) To BN3PR0701MB1719.namprd07.prod.outlook.com (10.163.39.18) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 920147c5-422a-4dc7-fe37-08d48668c170 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131423075)(201703031133081); SRVR:BN3PR0701MB1719; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 3:8nZ+1Bf5zC6PE6I+bDUfvEtqEe/b5RWFf9GEAIpMZgOBh0Lim0LVCS7EwhVWezcizrulzvvEca4RhCMBIUWZGVL8Gm7s/kJCGeJZqIHtWYjkg18CD9SoU8ejaKKysoziw/IIKmzgBqqdhh0rFKurG1BErZHgHcUwvQMVb+KpfkdVblA9ep6Vqws0KSyXQPxhlmqzOTrQPRBGFOut4+z3/gPXxRXVai9rUXFS1xtVSARoGgmFhOotaKvnqjW8qjLC+w/5OFsW7/i7hRAXmh60w4yQL98X87cHle1IxjYd3/ShJGMS4N2paMucpZVIaOKsGh/7oFfw4g7UzC18F+ZRvQ==; 25:dPJdlrpoU82tJ+9a3RO15t+eg+1MdZ7iNXpqrvLU7hpCahL1N2s4oMBLHcSjUYANQC/QPBOKJ5DLXpOHdT5nw/iF5RrFMR5EUn079dP6BTzP36Aeo4o7WXY+pOITXKPQmic537zTzUZTsPWLe27usWot3WFKP6gwYOpJ8Pj+YVgAwRo93qLAV4YLSHrN4siHnbjyTk/ye5qmkuNr4ELFWIn0D0ij7p6ONCe/o9mpZNHPiYCRcHXtlA51cuJ/tYXzFSDcqhwtXed0uWwfL3ZWVfib3XIhdwvCrGxtMflE2n4/e5NCw6sGW/rd+MiGWHzemXt/cc5fGxOshI6ClEt/d/LbZAnxYA4Rc6etYu5RuxJQNaDRteOFoqjLgJsiQg5U52w/f8V7d35XbW1abzIXKAYd3Jv7vWTofKcak+w0tI9cdixuA1tZ/KtRczN2zw/v9Sz3MsOyFrF6uAzjVTE+jg== X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 31:Bj2xRqiQtRDQLLw7xuEMx3uT4wLQdldD+HlfhaQKxdYmHEJpairFVuLIAZ5yYXXnFH28EkYgHKuelvi+jE39iYK/+lxWWOv40oHs2lbt8GSFz+GrRKNGS74qN1fjB0rEAzI8IGV10VBwsY1pxUOGR3OZp/fhbgCGQtwOgd4vcN2mBTbCCLTk/8E9GRQGB3kPb8+K+hm8M/KSCqwxWFj5UvZwcUTRGyDjzmJhxTM7S3nyRgMRgV5yN7LWymTnwt1TT0/I9epM/1tOjzrj/hwEZQ==; 20:9BgpvMocbXQPYoubOtoaYJH+MCvENQneEDJDFQO8aBY1O1rBlyW6B47VDVFviO9515wWShe/wZQmTNPK7McQ5vNvj0CzFAO7w31aw2+W/37W9IDzCt2ZR9pdu9p9aTa+ytjDZE49f3cq2LInUiuUBQ9jDgItntLehe+ovFcrowuVyomUf5+JfC/fx6Th83qA90zos3bRM3XvuaZlOQwDd58iI2K/4nppIxPolgxCZqLVOc3laFJPm4aJBO3CkgD4MiKk7Ca+U+QHc+lpDeXj+IlCSWFqx2LYmIe6k5GQKaVgA/mVsK8O5p55jkbR+xGmZtQ5IVq7N+8srrz1f53XsOBDou0zfIC2NqrGmY1giY26mpIq7E/FwXO1xAK+nq2W3oMTsggQ3y16GZfZ0wC87paX9BQqBnZBh8uZsVX4S9xzRXwz9nVs2zT2q/n1HyyRg3/N7CoQNA09nu0sqWvCI3+18fL5OI+D9hRsW5/F6zjIYilCDAGqqDJjS+xDqB+TGs/v8+lpV8F2Id5vpjnyoHQC4f4MfO7u6K+dm8392dTpmlCw6wVllJYd1fHawathYEag+eMlFyYedk+Vj0iJCzBs3nmLxG26ACHFABUAfeU= 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)(93006095)(3002001)(10201501046)(6041248)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(20161123560025)(20161123555025)(20161123564025)(6072148); SRVR:BN3PR0701MB1719; BCL:0; PCL:0; RULEID:; SRVR:BN3PR0701MB1719; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 4:X0Ya2KTx81AAg3PEaCMCwBar8QFJUTIAaWLIeJEhvfqOHGJgG+5Cx89Hg+ZC8OF7Pj8C5mPPR2hBcxggbRU7ENVfRCEFdhgfpHruW7UFhZjTxTJNJr8eOvbxB3Z8RBmVCLoBAoBBK7AIK523P7deNBpLznOmDByVi9xCoMbviYwrOzPRL/Bo2xGbOgtiA7BOjr+cWScbybgniYxUtRQ9Xe2V8OkV/fKg24T+0at+U9y93smrf7SrS49M6D147Uzy7QAAQ8ANPn2maHAjHBL10iJWKigAAuTM+BIMTouipZK6xrvoryWy4ZEU5hHs4B9bJA0uKnian1qnDNRkSL3CeOWRPU7okX/AbgxwK1lzUYScdiy5ncIdIS514KCKLCEeu7YvVwVuEn7scMIFKA7LJomF5O3COHix0+kQtX7CX2uS2YOLVViQ19Ypnk2U4TSVKZa8nIempNK3TND9Ch3IMi/dcbcFwa1tkpB1MtjtOBhaSgMvT6bnqOd9MK+il80clYI10+H1+ZaS0A4RcqV5C/wkJYaa3y7MlfAZmJ8ASssg6s8iRx7mWUsx92dNkeNCTZje5Y6IjIUggn7L5zKBinvzwvTW2S+Mnsrlcc+OyrdFd7fJmu8yVku9rSGPJqi3TR8HxOA9o0J3leBehTuZbANp7/U9vBGTEgd3MRJAMmf7vaS9VjWX15lFcB/IMxIj X-Forefront-PRVS: 028166BF91 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6049001)(6009001)(39840400002)(39450400003)(39400400002)(39410400002)(39850400002)(24454002)(377454003)(33646002)(31686004)(23746002)(86152003)(42186005)(53376002)(38730400002)(110136004)(25786009)(305945005)(2950100002)(6306002)(4326008)(50466002)(31696002)(6916009)(189998001)(5660300001)(83506001)(4001350100001)(42882006)(7736002)(5009440100003)(3846002)(2906002)(53936002)(6116002)(64126003)(6486002)(77096006)(6666003)(76176999)(54356999)(50986999)(81166006)(8676002)(230700001)(8656002)(36756003)(966004)(65806001)(229853002)(47776003)(65956001)(66066001)(6246003); DIR:OUT; SFP:1101; SCL:1; SRVR:BN3PR0701MB1719; H:[10.160.0.40]; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1; BN3PR0701MB1719; 23:E/TBsLLNMYut/DMjuIrVChVwpftRsVWJcwk?= =?Windows-1252?Q?JLa4LL9fNJD4keOX34q+unvwV5hC0do53j1Oxo+k8JG9pNkVjXZbLkoi?= =?Windows-1252?Q?eg57CenvNXcOc6Pgm+eDI904y/msd9rTV/a2PcCtGt5BnNE+TPHzsA7w?= =?Windows-1252?Q?z2RzZ8EtWsUQ4SuBONnLqrkz7JfTUapSQphFvoEol4MNUGjSI4vqLfcN?= =?Windows-1252?Q?ZGemL1pzC9bcE4oAzr5lLlI8qN7OnjMJMhGWER4AnaaRSVDZhxVzJoBo?= =?Windows-1252?Q?Nuxo7JeKc2nW+++kJuZA8JNhGr2h4B/E8cL1MA1tgPq+mmdjboFA4VNf?= =?Windows-1252?Q?QdLSg9FHQX69I2UYxV1SsLnw5AjRtbqL8H9R7WmPk+KSm50lg6TdPAGF?= =?Windows-1252?Q?6cEixKC9jCULnFtefpvwtsyxTOovZQewqhaiwRjCnwGdJ5fW3b2Ge+6j?= =?Windows-1252?Q?WdbjFb4d3LADSjFcCHCk5KiwGWOSk2YbE1iLXYdr/Ti70TGq6fBtpQxY?= =?Windows-1252?Q?HDAVlNdCAylt9byFnjG6tUzdcmtub93SZBKtRV1hSjJz2+aBhTJr23Dt?= =?Windows-1252?Q?A1vZitiBwPqGuvPXloAA8QGxInKd3eoiiGmfMxjalzpgmZc2esgpp6FR?= =?Windows-1252?Q?DZ3PvpfZHF0rSXwMy9I+x42gqwIiHCaWcTJOPGqXW4uAuHdnNW165MXl?= =?Windows-1252?Q?fED1B4Y13EmENekh5j5uSO4I7cIpy2FzcuWA6I7YKs4vJYtwHi1gY2aV?= =?Windows-1252?Q?KBYeV5JXxJjuChXu1jzxfs23GvKvzO/nna2an6P7brRa7nCN2Ged9sYE?= =?Windows-1252?Q?D8mM215RXctwBU/tZk1Nmqne2ySr+uJMKFdv/Iv+NPY9OKDuY1dcjyz9?= =?Windows-1252?Q?g9b4gJyCik9MrJKl/EYDixnZ7wF6xPX9jpmlCv19G19p03dskp0ZTM+A?= =?Windows-1252?Q?WbLNHgZGJu238uNGIbVof9sZSU5apksrWYWc2QQ4dTJr4973sAXr70j/?= =?Windows-1252?Q?hVcp2tFOIqu5r7k3kHPnfkeOXZ0fAo9gxBwUpNsFm7uOyjbh3XLVawnd?= =?Windows-1252?Q?gChKRQpxM0AWID8NqRJsDWmWcgprknX+Jmr7jzy2sJYBjfoVUn3uhe8O?= =?Windows-1252?Q?6SeD7SnlcVq99PmDvVwV92lxs9dwYQwVrd3A2yHZpbcMuRlCeAcZUjic?= =?Windows-1252?Q?wW+UJuxL0ROjUcunlRQCH+vTQVEeD+ReiVRsMeKFg1rnRlCYRC/UL1yE?= =?Windows-1252?Q?YVUejL7K61XdxYvxAx7/g4M6CybahwnVLH5R43hNJzZ4Tf25lzSUmbUN?= =?Windows-1252?Q?h18aBAp0oX8iuaXdAQ7ML5HiN2m8T5f7t2kJRfoH3E0MYNG6rvccosVj?= =?Windows-1252?Q?IOXM0/Ta7rNCD4/jfXk0z8UG859knIlwfRmDDT21WcmABpwTiiWHGXbS?= =?Windows-1252?Q?uPcReX00DdwPWBMQQunK2N45i7e5of/6Akb040z3hYQZqcdDTjYXCPv5?= =?Windows-1252?Q?czg2C+rw=3D?= X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 6:AZO/L9tNzmM/cpDn5GrzFHV6YMdLQ8qDMHpjIvLr1vWkrxN+wFcr0g7+xrxaMzdz+fX74rFpXik+AjTeojjfpybq/JY1plnxztHpYXADV94zyLrmm6/h26T2y4MTHtcNYfwk1MR5elojuZ70n5e7mZ4LGHMTCuKeBrzp1JtYQwhkzQw0/tyA5V22ibsKzU+gf1F30HJfJnhITUMA0WZj2mgmENMrTmRYU9P5nDI+J3bEiLxhN2ji0bnFAROsXGfkxWuwVjSJ36CxF29dy7xAAdqy44kkR8M5Dp1brgOxPqpO2ZJOShiDH2Uu+tXCrYJEp0xcyhnitxFfjcxxkuEi/wIaUPAJra6casIUUjVb7T36b4lQ+YGO+QaUJo6SlJoNkCROU3VQ+n1SylFjsyzDyb2blXsOCM2Hmm84hjO1AjzH8j9R3l+7xGYV0yEDMdZVjp0CaxEetpHsKuiy7nc8jA==; 5:9tIzp+A3AH61UP5mdPxt6/g3udlmXgKyP9zYLuvfdId6TacR+lB9Kbn9xZloVAcg7+RdHyIcGOtC54R1q+us432G2YVOpT5qyB1knl+so2zAdlFzrI+2aiTi4Sk+R6JMdWDB9wG+hvKXLQgZ72eLAA==; 24:3JklxAlpN5M25uS+J5k3NkteNiFU4RN7HESWgHYIj+8gxtCOFxYIQcQMWrOVf6kDb0Qg7B+JrFD51zbjIOgujC/CEuiLkWO5U2VormjYyJw= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 7:9qcpptHDJlSwKfGmaDqv+Bse60HDD3yx1A5az8lPTgt6skwJmuZBwNLZglqJsEODisIwjOdMekIDO6wP/3TbtDy8BqlH+oBYcWK/pMzIOXh0tuDhQZZJgh/ydvuih8wNQqa87QECmiEMraP/ZMUUUVQ2in/Gouz4k3jQrASzWGGQUEe7tu+TKuBarYmgj/EjHJCsOHY94QB9+ALRJOTbMpiZLr685DK/eMYT2JsI6098BO5/iHz/mHfMi9HZqoetCl5s+fEy/FG5zoR99rv73OGkI4Gmurza/5OapMuEeiUr1jGUkaRp30j6R9/4Rv1cE7if8Y5gx0MBPyhRLAcq7Q== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Apr 2017 14:39:42.4863 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR0701MB1719 Subject: Re: [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 14:39:48 -0000 Hi Olivier, On Tuesday 18 April 2017 07:12 PM, Olivier MATZ wrote: > Hi Santosh, > > On Tue, 18 Apr 2017 14:04:46 +0530, Santosh Shukla wrote: >> 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; > as a nit: the cast is not required. > Will consider in v4. >> 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; > We could even do shorter: the mp variable can probably be removed, and > directly replaced by mp_nocache or mp_cache in function calls. In v4. Thanks, Santosh > > Thanks, > Olivier