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 7C508A00E6 for ; Thu, 16 May 2019 19:56:07 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E11BD7D4A; Thu, 16 May 2019 19:55:34 +0200 (CEST) Received: from sessmg22.ericsson.net (sessmg22.ericsson.net [193.180.251.58]) by dpdk.org (Postfix) with ESMTP id D64335F19 for ; Thu, 16 May 2019 19:55:21 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; d=ericsson.com; s=mailgw201801; c=relaxed/relaxed; q=dns/txt; i=@ericsson.com; t=1558029321; x=1560621321; 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=emEpPp6la2DesqpGTlZk9fmNqO+dTPyXy9NhN852tTA=; b=WR+Exi3u2IWV6NpyUWI1oHR6vjQruQTnfU4fWPtmvDHNuc4WLqLiQSvwYO2dsUiU 61N5G9h6dFmEOmaGctF8LG8E98t2HR2DsnNchb7Q/MEqIPxmbknqzT6E44VpsVqS 3eC6Tto4cm/Jak/7AEfjlZKX3bpL/XyxxiEhC2biNUw=; X-AuditID: c1b4fb3a-709ff7000000189f-e8-5cdda4092d86 Received: from ESESSMB501.ericsson.se (Unknown_Domain [153.88.183.119]) by sessmg22.ericsson.net (Symantec Mail Security) with SMTP id 41.DB.06303.904ADDC5; Thu, 16 May 2019 19:55:21 +0200 (CEST) Received: from ESESBMB501.ericsson.se (153.88.183.168) 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; Thu, 16 May 2019 19:55:21 +0200 Received: from selio1a020.lmera.ericsson.se (153.88.183.153) by smtp.internal.ericsson.com (153.88.183.184) with Microsoft SMTP Server id 15.1.1713.5 via Frontend Transport; Thu, 16 May 2019 19:55:21 +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 x4GHtHcx023701; Thu, 16 May 2019 19:55:21 +0200 (CEST) From: =?UTF-8?q?Mattias=20R=C3=B6nnblom?= To: CC: , , =?UTF-8?q?Mattias=20R=C3=B6nnblom?= Date: Thu, 16 May 2019 19:55:09 +0200 Message-ID: <20190516175510.27154-6-mattias.ronnblom@ericsson.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190516175510.27154-1-mattias.ronnblom@ericsson.com> References: <20190514092046.30808-1-mattias.ronnblom@ericsson.com> <20190516175510.27154-1-mattias.ronnblom@ericsson.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrOLMWRmVeSWpSXmKPExsUyM2J7uS7nkrsxBp/fG1jcWGVv8e7TdiaL xXfkHJg9fi1YyuqxeM9LJo+ek/OYApijuGxSUnMyy1KL9O0SuDJ+XPvNXLCBt+LztaPsDYxd 3F2MnBwSAiYSZ99uYOli5OIQEjjKKLHr000o5xujxOHbx9khnIuMEls3r2SEcC4zSszuOscC 0s8m4Ckx+V03mC0iICSx9ONlsA5mgVZGiR0PG1m7GDk4hAXsJXr6NEBqWARUJd7PeMgOYvMK OEmsntHACnGHvMTqDQeYQWxOAWeJq+cPgMWFBKolfnatYYKoF5Q4OfMJ2C5mAU2J1u2/2SFs eYnmrbOZIeq1JO4v+cI8gVFoFpKWWUhaZiFpWcDIvIpRtDi1uDg33chIL7UoM7m4OD9PLy+1 ZBMjMLgPbvlttYPx4HPHQ4wCHIxKPLyxc+7GCLEmlhVX5h5ilOBgVhLh3fD+dowQb0piZVVq UX58UWlOavEhRmkOFiVx3ujVe2KEBNITS1KzU1MLUotgskwcnFINjDyzV0QrW5xIUUj+KCqz 8A+fgfHmFf+mPL2zmtF+xz2nVT+vVWoemzrtyWfvihdLw5qnbXMU4qgs2P27eeXKhvRVqSUH lpg+2Hh4xamaieWWjQeLWLc3z3QRjPqycv8Ehe2T54auixYxnX/g312ORe6FT+YcLZRSkDic VloscqerYFtB2ffmCSeVWIozEg21mIuKEwGuxg6jagIAAA== Subject: [dpdk-dev] [PATCH v2 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 --- 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