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 11527A00E6 for ; Tue, 14 May 2019 11:22:14 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 19B165B1E; Tue, 14 May 2019 11:22:01 +0200 (CEST) Received: from sessmg22.ericsson.net (sessmg22.ericsson.net [193.180.251.58]) by dpdk.org (Postfix) with ESMTP id 9735F5398 for ; Tue, 14 May 2019 11:21:59 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; d=ericsson.com; s=mailgw201801; c=relaxed/relaxed; q=dns/txt; i=@ericsson.com; t=1557825719; x=1560417719; 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=cwrPbjMAT3il4k78wG9lzwzwSG8Oavy1VOkP1FU19EXVcgVXaPfKF+vE4XHnyI8x C+HcqQbnNppeaxBq0gwpxvhrROzj/RrpjkCRXq+8hmvOVYv/KCCLAFiT7mJsvsQ6 JMj0LGzUqRrFzJ2T42GKa+qMq9qfsmXt5sb5Ha/zcfQ=; X-AuditID: c1b4fb3a-709ff7000000189f-ca-5cda88b73ad5 Received: from ESESBMB501.ericsson.se (Unknown_Domain [153.88.183.114]) by sessmg22.ericsson.net (Symantec Mail Security) with SMTP id FC.2B.06303.7B88ADC5; Tue, 14 May 2019 11:21:59 +0200 (CEST) Received: from ESESSMR504.ericsson.se (153.88.183.126) by ESESBMB501.ericsson.se (153.88.183.168) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Tue, 14 May 2019 11:21:59 +0200 Received: from ESESSMB505.ericsson.se (153.88.183.166) by ESESSMR504.ericsson.se (153.88.183.126) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Tue, 14 May 2019 11:21:59 +0200 Received: from selio1a020.lmera.ericsson.se (153.88.183.153) by smtp.internal.ericsson.com (153.88.183.193) with Microsoft SMTP Server id 15.1.1713.5 via Frontend Transport; Tue, 14 May 2019 11:21:58 +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 x4E9LQN9027252; Tue, 14 May 2019 11:21:58 +0200 (CEST) From: =?UTF-8?q?Mattias=20R=C3=B6nnblom?= To: CC: , , , , =?UTF-8?q?Mattias=20R=C3=B6nnblom?= Date: Tue, 14 May 2019 11:20:45 +0200 Message-ID: <20190514092046.30808-6-mattias.ronnblom@ericsson.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190514092046.30808-1-mattias.ronnblom@ericsson.com> References: <20190508181014.7dde7580@xps13> <20190514092046.30808-1-mattias.ronnblom@ericsson.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrOLMWRmVeSWpSXmKPExsUyM2J7ke72jlsxBhP+i1vcWGVvsX1FF5vF u0/bmSxuNZ9ks1h8R86B1ePXgqWsHov3vGTy6Dk5j8nj/b6rbB5Xvq9mDGCN4rJJSc3JLEst 0rdL4Mr4ce03c8EG3orP146yNzB2cXcxcnJICJhInLn5l6mLkYtDSOAoo8SzdVNZIJxvjBI3 /7xhhXNebN/AAtIiJHCRUeLqi0iIxGVGiWu75oAl2AQ8JSa/6wazRQSEJJZ+vMwOUsQssJdR 4tW6eWAJYQEbiVsfVzF3MXJwsAioSlw8qAYS5hVwktg7ZRMzxE3yEqs3HACzOQWcJSZNucUO sThF4k/PIxaIekGJkzOfgNnMApoSrdt/s0PY8hLNW2czQ9RrSdxf8oV5AqPwLCQts5C0zELS soCReRWjaHFqcXFuupGRXmpRZnJxcX6eXl5qySZGYHQc3PLbagfjweeOhxgFOBiVeHhj02/F CLEmlhVX5h5ilOBgVhLhjVK8ESPEm5JYWZValB9fVJqTWnyIUZqDRUmcN3r1nhghgfTEktTs 1NSC1CKYLBMHp1QDo9d7lpBpYVP27JIOjzw37W6d0IGtkqqLuHPU/VOrtHorj059pOfDPte7 9sn0rUyOTkvXJbWc3CS9akGrC4PP1Ckq5s+4LF7FTzh6w4BRyTNrwj3LJzxltyb8kuW1/1di 25g976bVhz2XFXem8lqkrNG4mb3w8NGejF71XMlcrd5lz59N8Nl9RImlOCPRUIu5qDgRAOmP Dz6KAgAA Subject: [dpdk-dev] [PATCH 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" Message-ID: <20190514092045.7I4RP3R6Kva7gXUc6kc--GE--5GnZrBFnSd9u_FtJwY@z> 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