From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0062.outbound.protection.outlook.com [104.47.41.62]) by dpdk.org (Postfix) with ESMTP id A5F4F7CC5 for ; Sun, 28 May 2017 22:01:40 +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=RUBH3ixB1K3BvNxx1tX06cKSAZTjG3oMIDOlIZdU/Vg=; b=To2i9P4GgDmH8Yq/1x1Ai6BsCsN+USaFiBo39mKZwcSB8gOUTM918IN4U6EHq+m42VZ+Z7SxhRMrPMqijhuX+BasIuWWrEveQwiLRVIppllXc1U0QhIic5OemVwO+kje6ZVIsPfncsbtB/4865+rxnaZomgqPGZmeetzzCz5Giw= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=caviumnetworks.com; Received: from jerin.domain.name (111.93.218.67) by CY1PR0701MB1725.namprd07.prod.outlook.com (10.163.21.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1124.9; Sun, 28 May 2017 20:01:36 +0000 From: Jerin Jacob To: dev@dpdk.org Cc: bruce.richardson@intel.com, harry.van.haaren@intel.com, hemant.agrawal@nxp.com, gage.eads@intel.com, nipun.gupta@nxp.com, narender.vangati@intel.com, nikhil.rao@intel.com, gprathyusha@caviumnetworks.com, Jerin Jacob Date: Mon, 29 May 2017 01:28:41 +0530 Message-Id: <20170528195854.6064-21-jerin.jacob@caviumnetworks.com> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170528195854.6064-1-jerin.jacob@caviumnetworks.com> References: <20170528195854.6064-1-jerin.jacob@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: BMXPR01CA0003.INDPRD01.PROD.OUTLOOK.COM (10.174.214.141) To CY1PR0701MB1725.namprd07.prod.outlook.com (10.163.21.14) X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY1PR0701MB1725: X-MS-Office365-Filtering-Correlation-Id: a0c0854f-e650-44bb-90bc-08d4a6045ab9 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131423075)(201703031133081); SRVR:CY1PR0701MB1725; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1725; 3:EPY4HpAnyXHyDn7jaBDh0cnQiD8FedJz3lypiQ3jZFHwiFnuAgpPuBeLx4cSiiQGiK5T2fB+DMEdmTvV/zQsS3rNbjwHYjOPuSNAQJPaQhU882cgYImzQKcLWSyHyiEMyWFvkPc68i2bXocV0lDHJUY62o4hDoEyA6V/Ab+OBns11u7ssp8+9tLMrWgNOZnkQBx/mAU+fwpeltjTTiavo7KcLqLYR/ot0cBG/Y4MaU8K4eAebSp569ANbe6Z0ONkyPNZjSXzZCvAZ0ZIRe8VYMvKF75fsj84DUD86nZLOYz07aUGVcDbMHdK54FUMw9dT8CdvIVQH6LZCMDZx7fG9g==; 25:GipkRQxRhv4Jejge9Dv62NMKfbmOyFElHJfvNvN7vcXsMaWo7QwBq9j9WzKOKiPuyYnBRStgADTQnu73u33doUc3HdonbfbIcCPck1QuNoW5e55hQX82R+lQiEjCjxkiZAFVsqteGvJVnDticHcgZwZ23gMmCehrH1UKPXjwxp0H9Lqo+jEWafSgMgAfbzVETQBRuRyfMkOuyhRDwhkkx57TH79rxUN9QwClJh5onCGs1fkcvfAXszjNaXFL6OhbmQigSE7tkKtMOCzooSb49F65OfNIUcv0hyvApBBXAVd+aIkf92qOMY/iz/l5OiieHv9+3bbJ61OBkYzGz3Iu6teKEV6snu/dbInDPPhdHFNUAsPdocQR5FO0Q8491wkTCe/5c3eAQI4jnP/tH4natZ2IrgkqWNlflyOsgEPWiVORdTZJo6UdSuWwuPBxJhVdHS2P2l1W/qgwl8hp27vFSKGbvXJFQn0wTkgAIInZYTE= X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1725; 31:0VOWpGlsP9KPjNcp1LMjlDFcZU6iiwHtNMdEVzcMIsraqU6zrQmsEkdAcjec0pOLPx53IsBcMZ9/16IFEIv0qBto6QBCUQe0l1x0Yf0pKYa3mabWRUt4OKh8BN8w7bF9EVk6Dpm49OxVYdLHlsheLZzN2cv0ieWuL7M2di5suGHpCOeH3h0Umbm3DPkWuW5aiRvhvrmvN4jBzlkTUQQz3GJC8mdB4Yg4YMe6Bx5zFYw=; 20:iOiyBwzz/8eZ2QMr7zehEzttiVY+TJru2yXEfN5Xw8fJWVBZdLNCQFadhqbA21d4ImenLqwV8MbY78mBILbB7SPuraLwv7lbEQvVnGraRx0GPyS89hkB5lOBZ/A/J6xIGFEYMeUqhBl0lLjHsSG9aBD9zLNWOqGhL9n8KjYySZGNjXmBMmuGPswjOVT6N2QB0j5BdicKBukxnUfPLuklLfAU5n4nySeu4mRVB0Tc+2dNotka8L/tK+0rTJQg+B38c+mxKZXSFuIW5clO/L3X77LTuaqHKlMNqbBu1NNApR0GRMstvo2/J+pACVwI8DgbYfZsmvu6qa9UJOtM0q1HNSwkJ86MN3UWoXQI1cH4zK5oF+MXdDWpsOJOEsbtM36Xfi7bHAAHe7uMKoSXN7lA32CVFUHGhiQ0FHB/iau3GQOVYmi9v9Yh8GmOgNAPl6qhnu0kVxdcFHYBA60FkKxX5zrCQ1Jv5I+Ow0h862AHISlaWVuYcNVKYJrd9hqew+e0FcSjfxQ8VkcMxYl/cxBgNBQnpwiyoxr/o0MNNqXclk3XWW5ja+58awN1/ekoVQmy8K8iRYStajXZ5vqItAKmbIA535l4VkiA3ly4le5VjPM= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(131327999870524); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700073)(100105000095)(100000701073)(100105300095)(100000702073)(100105100095)(6040450)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(93006095)(100000703073)(100105400095)(6041248)(20161123562025)(20161123555025)(20161123560025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(6072148)(100000704073)(100105200095)(100000705073)(100105500095); SRVR:CY1PR0701MB1725; BCL:0; PCL:0; RULEID:(100000800073)(100110000095)(100000801073)(100110300095)(100000802073)(100110100095)(100000803073)(100110400095)(100000804073)(100110200095)(100000805073)(100110500095); SRVR:CY1PR0701MB1725; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR0701MB1725; 4:NS8x6ZCfw5QtToaom/KrAi0IloXTmZTkQg2gF1My?= =?us-ascii?Q?q6AxfP9aXL1nkqaX3xSOuz+Lkkznoobif3bOcFcESnYH0E6ZZxbrhw2/0kh9?= =?us-ascii?Q?VOIAp6slTEt3museLm1V2cX3ZIO0pE90mlvlmSVkfe01BKeQ0oXbkOW1scWB?= =?us-ascii?Q?LTw8H87J8T1CdN1enl1hKPS3A5548DSdLFrE6b3OtTmWXxlg9InUTe9+hxm7?= =?us-ascii?Q?VWzQca1nzxYN1iGzXv3MimgiEviTuOFu/257j7S1jlrpB3H89QYBJsqIK99P?= =?us-ascii?Q?/zOSA0R4cNKwUkSVX05Iv8bZkoMQNxLccafc3XuXm3h3mSCoYsmmsyCGdAyC?= =?us-ascii?Q?6VN7E1FWle4UKNKzcG+Q8CN/acsaE+b1H+eS6W3nkXijRoS8aQ0arUnpqTv+?= =?us-ascii?Q?WMcTnORWg+KluGJPDV+FZIUZ18Em1Xb8hadfr+eFgH0Od4M2+/EcVRGDLF+S?= =?us-ascii?Q?CHrQr31yZIy3ywpKj/VIM8VIBdOwR63EyWbC5eyR/50FNc6JK6Yi47d1qIZU?= =?us-ascii?Q?OJRts6Ut33SeM+2XnMSGvyUJvzUeluMXxdkCdBBI7Nraq8z4E/8Z24GUSguK?= =?us-ascii?Q?INj9krFC1rJTS0gNdQ5ghvZrdFUgFVACQCRhhru95wCSBQZcOomEgoYMHxw2?= =?us-ascii?Q?bTCuFqBooMkfD/R8mhCuXMxcukVpOCENMKQxALQVQCcuS+Q99OfIu14d1+/G?= =?us-ascii?Q?ULcXWHbdPwDIZnMQLqq63AOITSWHLrBgstMNhxIhf7lsEtDJfXJoVnfRWZWJ?= =?us-ascii?Q?5PnK3xk+t2N1FUblwViiq8RYS0JAg4VvcunSWObU58Co1phTUTJLTiRB3awQ?= =?us-ascii?Q?Np8wYj2qv9NARq8C/sj+TlUMnnNn//cuuqFbplCXoiwtNOBPGHtXILASHz1H?= =?us-ascii?Q?SRWcFuu2LEMCACSgSmg+caP2aAekPwxqJjb4S0EOV+atDJ3dfr9Mg+HjgGdP?= =?us-ascii?Q?dNSwwtItWcVt+aUjkJWjXBOtGbXQxdPjQygBNCNqAD86FcmuQ2+6tPFPEvW8?= =?us-ascii?Q?bg+KrgAJceC8drSBzlQXrW2UDcoEfzqyILDudGZSEyhvOSIHE5dHE30q+eud?= =?us-ascii?Q?dHXqsIw7ayMQMXrw1eDCkxFt2puRNN5YAeYDcGnA8XZlf9RqsoEB1J/AHc/8?= =?us-ascii?Q?4eAky+0OrMcKCsQP7B0sYnc1zt+/+dBV/orCchd5ZtDeUhuNifIsVQ=3D=3D?= X-Forefront-PRVS: 03218BFD9F X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(39450400003)(39850400002)(39410400002)(39840400002)(39400400002)(81166006)(6486002)(66066001)(4326008)(50986999)(76176999)(50226002)(189998001)(72206003)(36756003)(6506006)(38730400002)(5003940100001)(5009440100003)(110136004)(107886003)(42186005)(53416004)(7736002)(8676002)(48376002)(50466002)(1076002)(3846002)(6116002)(6512007)(2361001)(305945005)(2906002)(6666003)(478600001)(25786009)(5660300001)(2351001)(6916009)(42882006)(2950100002)(33646002)(8656002)(47776003)(53936002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0701MB1725; H:jerin.domain.name; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR0701MB1725; 23:HKZDE8Ui37BX+y4Fp8FjdF775/CfWaOEXsEC89U?= =?us-ascii?Q?rcPHk1ripkE07h2Rxm2oKep4W7e5UMs0MO6jaB5u3zue5pxKUK/Ko8azBmUm?= =?us-ascii?Q?V/RC0HDMLzKjNcU6ORSZxndbTaifYn+eX/hxotPFFb2SfX1QqQ2oznSAzM6E?= =?us-ascii?Q?xF4+I4RniztIomIRMUppUdJUCLmC3L+R6PgTyxdc5IVu0GLNzIHYxe6/UKtr?= =?us-ascii?Q?cXoIQ1fWMx5ZfV4nuUVp4eIgC4inkPNkCeQqRCEam0QGaKBzKbs1s1mPX/B0?= =?us-ascii?Q?A2S8PAKEhWRLLOtdXakJ8/UKce2pSgHiJpjj1WjwHw5nOfEpAZj0TcRn94Q7?= =?us-ascii?Q?PNjUg46o55OB2uO6kqGnEWFut8aVoRiU3iJM9TcP0QKCdQmClMOpqIX3V711?= =?us-ascii?Q?l6gv68Dhhd8Bwdy5a/h4QNBLVOdwM/x21oKGWkRSmdcFy+zE+K9vyjZrDaz6?= =?us-ascii?Q?PhQOt9X5xqk0emwdnTNyaGXVwM96SmyGZpc1UP1qDUe8MdMK9AZ83nMQVJnu?= =?us-ascii?Q?xhTWimnU5niwgtoghzdLI87ja9h5JzUszuc6yHausyjacIeO4EOLr3N4HWCx?= =?us-ascii?Q?14FHymE3r/uoMCgQ7SOgbrsTYYUEp2dX0oA6Kv8miKrGkYT9D/VzQwSPwTV4?= =?us-ascii?Q?UG0f1HIVfWHZjmYJQSbsQpZDfmRrWt3/DVyMgVafOuyH7gTXjMuHw60ZmC1f?= =?us-ascii?Q?OcOO8IobhIT8p9QKydCLhns+7e2ZTWGCR39w2aH7tJO8fuGCdOJCBSrDLf0f?= =?us-ascii?Q?9mBq9kWOeKNjGaPREmnSt9Q7muDY9+FNzTNGMcDNpDoGuGS1AQRtbKemeOCS?= =?us-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-Exchange-Diagnostics: 1; CY1PR0701MB1725; 5:ls2+8YrFLBZFTwdK3YKFhursSyX9WCMhxqD67lx8mxGTEYFsf0ODfHbYNSP4qfWwf3QPTNkRj8OblCJqxzGDQvwsKbhRKErZPd0jopJ65DKyExwSuhio9dtAXLJMJSDNEtLIECCZEIA1z5Qiumx6pJ6bkAsqlWY8oESMmaMDR2wvoMXeTubqTKf1ingcRXjfhUt30fRrtQ3gmHFHx1Q/f2GcPHSSmYOtJvheUdM3/hrIP4eh75NJJIHNb5WciVlhzuqBV+xBdSZNvZliEzp1tdEurFD3hUTAwcwc/ur4yEIXUSKedoRnp7cTnjVT4ly54qJVGgJ7u7oSca6+Dya+H5N+ud8VRwfYd6nHfGQ1ZAUzDrF/yIYY/5MpClP625aTXMSJaxnklU4ZwwBZDPwznOqU1gkOg0aU1Y2Cp0rs5UCudGh9salnlhL0WWuiybXTLla1koFz2WwXqtVD9nwP/bWmrsnyacm30P2Hq043lZPWBzIGaYIwZxXaSXOIGYgN; 24:M9VoLV3B8ELHOgJrfepEAfq04OFVWSiXWHDLLvJtkiBwpHR2mE859MC/agfdTSHYKyQowDUsxdFMwQDULxDa8PBaBvrXV/1NGie3dsXRQfo= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1725; 7:Hq7a0+jIe89RNTUl/FEp2GxCC4Yj9ZRIsUa3KsNGzDMwLpt4OLEI2OUI02nUxNohqHM51qJybZlKAh6GNKUHqn7DFddHn9NiIf83hiG3YMMltxNpTauEWOu9iSCS4CzsP2mI4xwzNDibBaKfu6v3O26uTLQhhL1kB2f/z17y4GzLG3R4nmpowyjt5Uc4G4Q8PCP6NA+1uHh81dcNinFNpSoGqRkPTgR2s0HZoYJHinzHAf61snbBYRUoNesuwSAcWdoN5Rb4XxtFcls6uwEikJsDH/JEeNd/2xAE2ATGkmk6ZTzeT9pKTz+UWcqwJSWOcMe0pmtoSEQtuZj0XZY5QA== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 May 2017 20:01:36.1633 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0701MB1725 Subject: [dpdk-dev] [PATCH 20/33] app/testeventdev: perf: add basic functions 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: Sun, 28 May 2017 20:01:41 -0000 add functions to create mempool, destroy mempool and print the test result. Signed-off-by: Jerin Jacob --- app/test-eventdev/test_perf_common.c | 53 ++++++++++++++++++++++++++++++++++++ app/test-eventdev/test_perf_common.h | 8 ++++++ 2 files changed, 61 insertions(+) diff --git a/app/test-eventdev/test_perf_common.c b/app/test-eventdev/test_perf_common.c index d95eb6252..a44f2df5c 100644 --- a/app/test-eventdev/test_perf_common.c +++ b/app/test-eventdev/test_perf_common.c @@ -32,6 +32,59 @@ #include "test_perf_common.h" +int +perf_test_result(struct evt_test *test, struct evt_options *opt) +{ + RTE_SET_USED(opt); + struct test_perf *t = evt_test_priv(test); + + return t->result; +} + +void +perf_eventdev_destroy(struct evt_test *test, struct evt_options *opt) +{ + RTE_SET_USED(test); + + rte_event_dev_stop(opt->dev_id); + rte_event_dev_close(opt->dev_id); +} + +static inline void +perf_elt_init(struct rte_mempool *mp, void *arg __rte_unused, + void *obj, unsigned i __rte_unused) +{ + memset(obj, 0, mp->elt_size); +} + +int +perf_mempool_setup(struct evt_test *test, struct evt_options *opt) +{ + struct test_perf *t = evt_test_priv(test); + + t->pool = rte_mempool_create(test->name, /* mempool name */ + opt->pool_sz, /* number of elements*/ + sizeof(struct perf_elt), /* element size*/ + 512, /* cache size*/ + 0, NULL, NULL, + perf_elt_init, /* obj constructor */ + NULL, opt->socket_id, 0); /* flags */ + if (t->pool == NULL) { + evt_err("failed to create mempool"); + return -ENOMEM; + } + + return 0; +} + +void +perf_mempool_destroy(struct evt_test *test, struct evt_options *opt) +{ + RTE_SET_USED(opt); + struct test_perf *t = evt_test_priv(test); + + rte_mempool_free(t->pool); +} int perf_test_setup(struct evt_test *test, struct evt_options *opt) diff --git a/app/test-eventdev/test_perf_common.h b/app/test-eventdev/test_perf_common.h index ab5c082f5..442ec99b8 100644 --- a/app/test-eventdev/test_perf_common.h +++ b/app/test-eventdev/test_perf_common.h @@ -82,7 +82,15 @@ struct test_perf { uint8_t sched_type_list[EVT_MAX_STAGES] __rte_cache_aligned; } __rte_cache_aligned; +struct perf_elt { + uint64_t timestamp; +} __rte_cache_aligned; + +int perf_test_result(struct evt_test *test, struct evt_options *opt); int perf_test_setup(struct evt_test *test, struct evt_options *opt); +int perf_mempool_setup(struct evt_test *test, struct evt_options *opt); void perf_test_destroy(struct evt_test *test, struct evt_options *opt); +void perf_eventdev_destroy(struct evt_test *test, struct evt_options *opt); +void perf_mempool_destroy(struct evt_test *test, struct evt_options *opt); #endif /* _TEST_PERF_COMMON_ */ -- 2.13.0