From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 96812A0096 for ; Wed, 5 Jun 2019 12:44:50 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 624E11B9FC; Wed, 5 Jun 2019 12:44:35 +0200 (CEST) Received: from sessmg22.ericsson.net (sessmg22.ericsson.net [193.180.251.58]) by dpdk.org (Postfix) with ESMTP id 222B61BA6F for ; Wed, 5 Jun 2019 12:44:34 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; d=ericsson.com; s=mailgw201801; c=relaxed/relaxed; q=dns/txt; i=@ericsson.com; t=1559731473; x=1562323473; h=From:Sender:Reply-To:Subject:Date:Message-ID:To:CC:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=3Ap+CN9zIt0IVSCVp0UkH7TQWCMeT/jmWOComifs1o4=; b=KgY6MH3YDl4RG6ckt1WqSi0QV0lpJXHP5/7ZEu5AMTDXEcQzY/r3y9qUiGMMsGlO MuQnu/lLWd32dxEOLe2aShU+6lPSDKW39eE+V5N89iZb4tnePcq7piKVwitOLbzb AN5TttdvlMFxhSF5kAEh+Pz60ZROZdwuWo5obZOGBew=; X-AuditID: c1b4fb3a-b6bb79e00000189f-38-5cf79d11c0d3 Received: from ESESSMB501.ericsson.se (Unknown_Domain [153.88.183.119]) by sessmg22.ericsson.net (Symantec Mail Security) with SMTP id C4.FD.06303.11D97FC5; Wed, 5 Jun 2019 12:44:33 +0200 (CEST) Received: from ESESBMB504.ericsson.se (153.88.183.171) by ESESSMB501.ericsson.se (153.88.183.162) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Wed, 5 Jun 2019 12:44:27 +0200 Received: from selio1a020.lmera.ericsson.se (153.88.183.153) by smtp.internal.ericsson.com (153.88.183.187) with Microsoft SMTP Server id 15.1.1713.5 via Frontend Transport; Wed, 5 Jun 2019 12:44:26 +0200 Received: from breslau.lmera.ericsson.se (breslau.lmera.ericsson.se [150.132.109.241]) by selio1a020.lmera.ericsson.se (8.15.1+Sun/8.15.1) with ESMTP id x55AiQRF025408; Wed, 5 Jun 2019 12:44:27 +0200 (CEST) From: =?UTF-8?q?Mattias=20R=C3=B6nnblom?= To: CC: , , , , =?UTF-8?q?Mattias=20R=C3=B6nnblom?= Date: Wed, 5 Jun 2019 12:43:59 +0200 Message-ID: <20190605104400.24484-6-mattias.ronnblom@ericsson.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190605104400.24484-1-mattias.ronnblom@ericsson.com> References: <20190516203529.GA642@bricha3-MOBL.ger.corp.intel.com> <20190605104400.24484-1-mattias.ronnblom@ericsson.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrDLMWRmVeSWpSXmKPExsUyM2J7ua7g3O8xBmtv6lvcWGVvsX1FF5vF u0/bmSxuNZ9ks1h8R86B1ePXgqWsHov3vGTy6Dk5j8nj/b6rbB5Xvq9mDGCN4rJJSc3JLEst 0rdL4MqY87GTteAlb0Xn61aWBsZ93F2MnBwSAiYS/zftZOxi5OIQEjjKKDFv4TJWCOcro8SD z+uZIZwLjBKrt3dDOZcYJbYd/c8C0s8m4Ckx+V03mC0iICSx9ONldpAiZoG9jBKv1s0DSwgL 2Eu8mjQTzGYRUJHYePErE4jNK+Ak8fDgDUaIQ+QlVm84wAxicwo4Szyevh+sRkigWmLC22ao ekGJkzOfgM1hFtCUaN3+mx3Clpdo3jqbGaJeS+L+ki/MExiFZiFpmYWkZRaSlgWMzKsYRYtT i4tz042M9FKLMpOLi/Pz9PJSSzYxAuPg4JbfVjsYDz53PMQowMGoxMN7rfd7jBBrYllxZe4h RgkOZiUR3sTbX2KEeFMSK6tSi/Lji0pzUosPMUpzsCiJ80av3hMjJJCeWJKanZpakFoEk2Xi 4JRqYHRVspuQdfe8aLruxHlfXTLvq+11Yp3amWb/fNXu5oVVNhWPPGXZ31hKdcpYsd/25fme x3MvW/D7tt++p+PFrglzVHPtc/shuzisjC9Y+FTF5nNn5t0SPfDQOFIjZHpB67dPl90uhS3c HtKosi165pInZlt6TecU/Pv6eVbHgmUFpybulD4je0CJpTgj0VCLuag4EQDN432+fwIAAA== Subject: [dpdk-dev] [PATCH v3 5/6] eal: add bounded PRNG performance tests 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Add best- and worst-case performance tests for rte_rand_max(). Signed-off-by: Mattias Rönnblom Acked-by: Bruce Richardson --- app/test/test_rand_perf.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/app/test/test_rand_perf.c b/app/test/test_rand_perf.c index 771713757..fe797ebfa 100644 --- a/app/test/test_rand_perf.c +++ b/app/test/test_rand_perf.c @@ -15,8 +15,13 @@ static volatile uint64_t vsum; #define ITERATIONS (100000000) +#define BEST_CASE_BOUND (1<<16) +#define WORST_CASE_BOUND (BEST_CASE_BOUND + 1) + enum rand_type { - rand_type_64 + rand_type_64, + rand_type_bounded_best_case, + rand_type_bounded_worst_case }; static const char * @@ -25,6 +30,10 @@ rand_type_desc(enum rand_type rand_type) switch (rand_type) { case rand_type_64: return "Full 64-bit [rte_rand()]"; + case rand_type_bounded_best_case: + return "Bounded average best-case [rte_rand_max()]"; + case rand_type_bounded_worst_case: + return "Bounded average worst-case [rte_rand_max()]"; default: return NULL; } @@ -46,6 +55,12 @@ test_rand_perf_type(enum rand_type rand_type) case rand_type_64: sum += rte_rand(); break; + case rand_type_bounded_best_case: + sum += rte_rand_max(BEST_CASE_BOUND); + break; + case rand_type_bounded_worst_case: + sum += rte_rand_max(WORST_CASE_BOUND); + break; } } @@ -68,6 +83,8 @@ test_rand_perf(void) printf("Pseudo-random number generation latencies:\n"); test_rand_perf_type(rand_type_64); + test_rand_perf_type(rand_type_bounded_best_case); + test_rand_perf_type(rand_type_bounded_worst_case); return 0; } -- 2.17.1