From patchwork Fri Jun 28 09:01:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Mattias_R=C3=B6nnblom?= X-Patchwork-Id: 55588 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C77971B9BD; Fri, 28 Jun 2019 11:01:43 +0200 (CEST) Received: from sessmg23.ericsson.net (sessmg23.ericsson.net [193.180.251.45]) by dpdk.org (Postfix) with ESMTP id 0C5AC1B99B for ; Fri, 28 Jun 2019 11:01:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; d=ericsson.com; s=mailgw201801; c=relaxed/relaxed; q=dns/txt; i=@ericsson.com; t=1561712490; x=1564304490; 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=WBYmIqQhbRTnvwGw2ROPQfatvOm/vizU2IxNDVhIsV7cSsHUujiqnTvh/UALpyby ApcMKRvrtpO7sQpc3P9FU5rRuKOXESGlantuRlDo5hjjXDU1LLVD6xeMTqNOzVWS oZLrx4m2p/mmy+wksOEMm64X/p67Q/0dmHl6tgLDCms=; X-AuditID: c1b4fb2d-195ff70000001a6d-06-5d15d76a8bac Received: from ESESBMB503.ericsson.se (Unknown_Domain [153.88.183.116]) by sessmg23.ericsson.net (Symantec Mail Security) with SMTP id 55.5C.06765.A67D51D5; Fri, 28 Jun 2019 11:01:30 +0200 (CEST) Received: from ESESSMR502.ericsson.se (153.88.183.110) by ESESBMB503.ericsson.se (153.88.183.116) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Fri, 28 Jun 2019 11:01:29 +0200 Received: from ESESSMB505.ericsson.se (153.88.183.166) by ESESSMR502.ericsson.se (153.88.183.110) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Fri, 28 Jun 2019 11:01:29 +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; Fri, 28 Jun 2019 11:01:29 +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 x5S91SYZ019342; Fri, 28 Jun 2019 11:01:29 +0200 (CEST) From: =?utf-8?q?Mattias_R=C3=B6nnblom?= To: CC: , , , , , =?utf-8?q?Mattias_R=C3=B6nnblom?= Date: Fri, 28 Jun 2019 11:01:24 +0200 Message-ID: <20190628090124.16849-6-mattias.ronnblom@ericsson.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190628090124.16849-1-mattias.ronnblom@ericsson.com> References: <20190605104400.24484-1-mattias.ronnblom@ericsson.com> <20190628090124.16849-1-mattias.ronnblom@ericsson.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpikeLIzCtJLcpLzFFi42KZGbG9RDfrumisweujUhY3VtlbbF/RxWbx 7tN2JotbzSfZLBbfkbP49OAEiwObx68FS1k9Fu95yeRx7OY0do+ek/OYPN7vu8rmceX7asYA tigum5TUnMyy1CJ9uwSujDkfO1kLXvJWdL5uZWlg3MfdxcjJISFgInF97262LkYuDiGBo4wS x3a/Z4FwvjFKPG58zQjnrOt7C5W5yCixYPIWdgjnMqPE75dX2ECGsQl4Skx+180CYosICEks /XgZrIhZ4BqjxNdLL5i7GDk4hAXsJc71eILUsAioSjxrfM8IYvMKOEkcfXaLDeIoeYnVGw4w g9icAs4SXWt72UFsIYFqiZ8nHrJB1AtKnJz5BGwXs4CmROv23+wQtrxE89bZzBD1WhL3l3xh nsAoPAtJyywkLbOQtCxgZF7FKFqcWlycm25krJdalJlcXJyfp5eXWrKJERgzB7f81t3BuPq1 4yFGAQ5GJR5ew92isUKsiWXFlbmHGCU4mJVEeCXPicQK8aYkVlalFuXHF5XmpBYfYpTmYFES 513v/S9GSCA9sSQ1OzW1ILUIJsvEwSnVwKj7cWX5mmSWOqu4PzdVFytr8LQw/5Ra4N4r+Lnu hPIOIdHOv9xCnko8nc7K3oYlKWUT65yUHvKud3mj7aJ9xdV9Zf6K9QKPT3EVvuw856TxMvaR yeL7sXu97txel1Ja84Ij7LPfymvBV+44x3MWxxass71sZ5G1u+NHf3LiuibWlWKnCh9ZKbEU ZyQaajEXFScCALSjOzyVAgAA Subject: [dpdk-dev] [PATCH v4 5/5] 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; }