From patchwork Mon Sep 3 11:00:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 145783 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp2344226ljw; Mon, 3 Sep 2018 04:00:34 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYOK4es0Xf9UbB+dGaie6r8qUMjSKKwVxhPW9c86qByYhSzycqw2j4a90fsTnXiFUGOAT9O X-Received: by 2002:a37:5941:: with SMTP id n62-v6mr7359912qkb.74.1535972434452; Mon, 03 Sep 2018 04:00:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535972434; cv=none; d=google.com; s=arc-20160816; b=wmmd/gGiABc3Llv4NJ2gzX7JsZZG8EtGma/DdtJl970Cj33TRXMmWPxl6w0UvX9ZH/ YfzRVxdKIj66iHEmbAx4wJ3PwyIqJcLSXatXrCEitlSn1KLco2Izw6uztzFOrexbE0Na Z6tNnLXul1VfzcZspjE+3RmPsrsViNdBhpGaw7Dmt0B813E3HGSOLU+Y3vCBaKb3QaLs dkAD2dApt2i+4KRrD452CelDBtF01nhMRetf9kuZaz0mjy6n9KcEuSkxOoVdd8XP/dAb bBgNgFo9UYjRUKmAnk/qrJhHfxhyVAAjqNIODpGTTXXKzcPDUP7FFa+fvyfiOQ4piLkd Q/hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=83wgoqLgiUsRbx3wLyJqGYd5Nthoeh+5QNxA3GXaQa0=; b=XMiBXT+tcl8rzLlHjBKqPhJvU04pOoWfClTsEXgqFRmvjWKBmCjH2IAe/gEuaZHW/3 26i7+Pcsbk7nOYUeK8Ga9ZTnjSvipT2Y9lEakWBKaXji0uQAHOyS3wBcUTrRU7fWreOH kANhqaqKAtxYOG0wIwrH71vKpai40eFur3VRt+pkAIUVyG+NpXZeLScV6s9XqI+TAdmZ HagoAPsmyDdOTuUIOtrBypV9uI6VQpgBGGtUQUT8P5faxQaAOJ1ttPu4/OLenZLGEq/y u9Hl8KVqrfIIdQdU7JtQZQ5LjThnjLSAnbRWVh65Qa741wfCpoIbXvO58nUkndb8MDLy DVJQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id g11-v6si3116877qtk.14.2018.09.03.04.00.33; Mon, 03 Sep 2018 04:00:34 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id B81E560949; Mon, 3 Sep 2018 11:00:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-3.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_LOW autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 61B83607C8; Mon, 3 Sep 2018 11:00:21 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 3E204608B3; Mon, 3 Sep 2018 11:00:16 +0000 (UTC) Received: from forward101o.mail.yandex.net (forward101o.mail.yandex.net [37.140.190.181]) by lists.linaro.org (Postfix) with ESMTPS id B8BD5607FD for ; Mon, 3 Sep 2018 11:00:12 +0000 (UTC) Received: from mxback2g.mail.yandex.net (mxback2g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:163]) by forward101o.mail.yandex.net (Yandex) with ESMTP id E3D8B1344DA1 for ; Mon, 3 Sep 2018 14:00:10 +0300 (MSK) Received: from smtp1p.mail.yandex.net (smtp1p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:6]) by mxback2g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id smNEUAsFGa-0AYCIELZ; Mon, 03 Sep 2018 14:00:10 +0300 Received: by smtp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id fhlYYakcOz-09IGifgX; Mon, 03 Sep 2018 14:00:09 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Mon, 3 Sep 2018 11:00:06 +0000 Message-Id: <1535972408-4918-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1535972408-4918-1-git-send-email-odpbot@yandex.ru> References: <1535972408-4918-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 687 Subject: [lng-odp] [PATCH v2 1/3] test: sched_perf: total number of queues option X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" From: Petri Savolainen Change -q option to be the total number of queues with events. There's no need to limit the number of queues to a multiple of worker thread count. Also, add an option for number of dummy (empty) queues. This enables testing scheduler performance when all created queues are not used. Signed-off-by: Petri Savolainen --- /** Email created from pull request 687 (psavol:master-test-sched-perf-options) ** https://github.com/Linaro/odp/pull/687 ** Patch: https://github.com/Linaro/odp/pull/687.patch ** Base sha: 97fc51b1e5b3fcea9db99ba63c10bda47f79341a ** Merge commit sha: 742c63f02e193181bd9172aeb63cf6d3d1de2e40 **/ test/performance/odp_sched_perf.c | 42 +++++++++++++++++++------------ 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/test/performance/odp_sched_perf.c b/test/performance/odp_sched_perf.c index ac2b9005b..d5fceede9 100644 --- a/test/performance/odp_sched_perf.c +++ b/test/performance/odp_sched_perf.c @@ -14,12 +14,12 @@ #include #include -#define MAX_QUEUES_PER_CPU 1024 -#define MAX_QUEUES (ODP_THREAD_COUNT_MAX * MAX_QUEUES_PER_CPU) +#define MAX_QUEUES (256 * 1024) typedef struct test_options_t { uint32_t num_cpu; uint32_t num_queue; + uint32_t num_dummy; uint32_t num_event; uint32_t num_round; uint32_t max_burst; @@ -60,10 +60,11 @@ static void print_usage(void) "Usage: odp_sched_perf [options]\n" "\n" " -c, --num_cpu Number of CPUs (worker threads). 0: all available CPUs. Default: 1.\n" - " -q, --num_queue Number of queues per CPU. Default: 1.\n" - " -e, --num_event Number of events per queue\n" + " -q, --num_queue Number of queues. Default: 1.\n" + " -d, --num_dummy Number of empty queues. Default: 0.\n" + " -e, --num_event Number of events per queue. Default: 100.\n" " -r, --num_round Number of rounds\n" - " -b, --burst Maximum number of events per operation\n" + " -b, --burst Maximum number of events per operation. Default: 100.\n" " -t, --type Queue type. 0: parallel, 1: atomic, 2: ordered. Default: 0.\n" " -h, --help This help\n" "\n"); @@ -78,6 +79,7 @@ static int parse_options(int argc, char *argv[], test_options_t *test_options) static const struct option longopts[] = { {"num_cpu", required_argument, NULL, 'c'}, {"num_queue", required_argument, NULL, 'q'}, + {"num_dummy", required_argument, NULL, 'd'}, {"num_event", required_argument, NULL, 'e'}, {"num_round", required_argument, NULL, 'r'}, {"burst", required_argument, NULL, 'b'}, @@ -86,10 +88,11 @@ static int parse_options(int argc, char *argv[], test_options_t *test_options) {NULL, 0, NULL, 0} }; - static const char *shortopts = "+c:q:e:r:b:t:h"; + static const char *shortopts = "+c:q:d:e:r:b:t:h"; test_options->num_cpu = 1; test_options->num_queue = 1; + test_options->num_dummy = 0; test_options->num_event = 100; test_options->num_round = 100000; test_options->max_burst = 100; @@ -108,6 +111,9 @@ static int parse_options(int argc, char *argv[], test_options_t *test_options) case 'q': test_options->num_queue = atoi(optarg); break; + case 'd': + test_options->num_dummy = atoi(optarg); + break; case 'e': test_options->num_event = atoi(optarg); break; @@ -129,15 +135,15 @@ static int parse_options(int argc, char *argv[], test_options_t *test_options) } } - if (test_options->num_queue > MAX_QUEUES_PER_CPU) { - printf("Error: Too many queues per worker. Max supported %i\n.", - MAX_QUEUES_PER_CPU); + if ((test_options->num_queue + test_options->num_dummy) > MAX_QUEUES) { + printf("Error: Too many queues. Max supported %i\n.", + MAX_QUEUES); ret = -1; } - test_options->tot_queue = test_options->num_queue * - test_options->num_cpu; - test_options->tot_event = test_options->tot_queue * + test_options->tot_queue = test_options->num_queue + + test_options->num_dummy; + test_options->tot_event = test_options->num_queue * test_options->num_event; return ret; @@ -182,6 +188,7 @@ static int create_pool(test_global_t *global) test_options_t *test_options = &global->test_options; uint32_t num_cpu = test_options->num_cpu; uint32_t num_queue = test_options->num_queue; + uint32_t num_dummy = test_options->num_dummy; uint32_t num_event = test_options->num_event; uint32_t num_round = test_options->num_round; uint32_t max_burst = test_options->max_burst; @@ -190,11 +197,12 @@ static int create_pool(test_global_t *global) printf("\nScheduler performance test\n"); printf(" num cpu %u\n", num_cpu); - printf(" queues per cpu %u\n", num_queue); + printf(" num queues %u\n", num_queue); + printf(" num empty queues %u\n", num_dummy); + printf(" total queues %u\n", tot_queue); printf(" events per queue %u\n", num_event); printf(" max burst size %u\n", max_burst); - printf(" num queues %u\n", tot_queue); - printf(" num events %u\n", tot_event); + printf(" total events %u\n", tot_event); printf(" num rounds %u\n", num_round); if (odp_pool_capability(&pool_capa)) { @@ -234,6 +242,7 @@ static int create_queues(test_global_t *global) uint32_t i, j; test_options_t *test_options = &global->test_options; uint32_t num_event = test_options->num_event; + uint32_t num_queue = test_options->num_queue; uint32_t tot_queue = test_options->tot_queue; int type = test_options->queue_type; odp_pool_t pool = global->pool; @@ -285,7 +294,8 @@ static int create_queues(test_global_t *global) } } - for (i = 0; i < tot_queue; i++) { + /* Store events into queues. Dummy queues are left empty. */ + for (i = 0; i < num_queue; i++) { queue = global->queue[i]; for (j = 0; j < num_event; j++) { From patchwork Mon Sep 3 11:00:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 145784 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp2346709ljw; Mon, 3 Sep 2018 04:02:26 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZ576NfxjfX0MEQaJTs1i+UzjKMlSB9S/wJYo54XBhS9LuF1TqcIua+3utFilX1uFF3fHQ4 X-Received: by 2002:a37:30d5:: with SMTP id w204-v6mr23970845qkw.317.1535972546168; Mon, 03 Sep 2018 04:02:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535972546; cv=none; d=google.com; s=arc-20160816; b=ohettNx6uxXwuJ6UxcCHorJKDzOwEvcFtToMlzS7t3az0x94e57P4Q/QsaawBTZtLz 3ajwVhtYB1pdrS+bPjLhz8eYt3WUM/Bwb9wQUyCDne/dS7Ns0gKW0KYIl3MZ750FMvgP QQDldRqClClJGBes4uJGXgL0DpsEsZ4YxRggj5p5fXOrjcffrMUs7oAmTmtlaLc6otUz DhkwohMfRRnt4bO2ava5ea5JslG6rHB6P9N+3nlbMdmGymE3NdDoWwBzi3wF4EPKax+O gxxHhGe0gSINubACyyFA0x1/Hz60vzJC4rilkIgkiJqXujr/Efe5F38CzOO8xBzaSiyX H/ew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=fqnF3RPS3DNLlPxPyDsd4z+0lozPRi99+4/nT3Hs//Y=; b=MJMQI1GwUkPJZsXn2zIR5al7b+wol1U8a+ASyt0Dhj6BcoN6qFC483433uj+IqfpFy 11JZRuyUVzHp1vhoF1uBKJV04nuIii9uJK+fAcrMNVucu9JSyfdh55cgkjgXvjYze4r5 Pq6xHO4k3B2Dr6F7RJog30lsLJcfOYT7+oVnWWzDrHfHKxtqP+ywlFqA2dOIU9PQ0ZJX pmIafwqLT8+c97c0Up8Xhh0Y4T0AFqE+89YpVpR163ZB1KXc6z43LUpKANN0GaE4zkM0 zXymoFDyPFt6iZUbrH2BDNQZIPdszPBoPZ9ZTntEpnIc1irCGq4KLRdlE+0D124oBLGr 5rOA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id i19-v6si3348974qvc.125.2018.09.03.04.02.25; Mon, 03 Sep 2018 04:02:26 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id D1450608B3; Mon, 3 Sep 2018 11:02:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-3.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_LOW autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 54F0560911; Mon, 3 Sep 2018 11:00:36 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 985206080E; Mon, 3 Sep 2018 11:00:17 +0000 (UTC) Received: from forward102p.mail.yandex.net (forward102p.mail.yandex.net [77.88.28.102]) by lists.linaro.org (Postfix) with ESMTPS id 4E074607C8 for ; Mon, 3 Sep 2018 11:00:13 +0000 (UTC) Received: from mxback11j.mail.yandex.net (mxback11j.mail.yandex.net [IPv6:2a02:6b8:0:1619::84]) by forward102p.mail.yandex.net (Yandex) with ESMTP id B143A4305B63 for ; Mon, 3 Sep 2018 14:00:11 +0300 (MSK) Received: from smtp1p.mail.yandex.net (smtp1p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:6]) by mxback11j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id uwOgxlGGfG-0BQ0t9Gr; Mon, 03 Sep 2018 14:00:11 +0300 Received: by smtp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id fhlYYakcOz-0BIGNSrm; Mon, 03 Sep 2018 14:00:11 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Mon, 3 Sep 2018 11:00:07 +0000 Message-Id: <1535972408-4918-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1535972408-4918-1-git-send-email-odpbot@yandex.ru> References: <1535972408-4918-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 687 Subject: [lng-odp] [PATCH v2 2/3] test: sched_perf: add event forward option X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" From: Petri Savolainen Added -f option to enable event forwarding between queues. By default, an event is sent back to the queue it was received from. When forwaring is enabled, it's sent to the next queue. Signed-off-by: Petri Savolainen --- /** Email created from pull request 687 (psavol:master-test-sched-perf-options) ** https://github.com/Linaro/odp/pull/687 ** Patch: https://github.com/Linaro/odp/pull/687.patch ** Base sha: 97fc51b1e5b3fcea9db99ba63c10bda47f79341a ** Merge commit sha: 742c63f02e193181bd9172aeb63cf6d3d1de2e40 **/ test/performance/odp_sched_perf.c | 52 ++++++++++++++++++++++++++++--- 1 file changed, 48 insertions(+), 4 deletions(-) diff --git a/test/performance/odp_sched_perf.c b/test/performance/odp_sched_perf.c index d5fceede9..d80f77494 100644 --- a/test/performance/odp_sched_perf.c +++ b/test/performance/odp_sched_perf.c @@ -24,6 +24,8 @@ typedef struct test_options_t { uint32_t num_round; uint32_t max_burst; int queue_type; + int forward; + uint32_t queue_size; uint32_t tot_queue; uint32_t tot_event; @@ -66,6 +68,7 @@ static void print_usage(void) " -r, --num_round Number of rounds\n" " -b, --burst Maximum number of events per operation. Default: 100.\n" " -t, --type Queue type. 0: parallel, 1: atomic, 2: ordered. Default: 0.\n" + " -f, --forward 0: Keep event in the original queue, 1: Forward event to the next queue. Default: 0.\n" " -h, --help This help\n" "\n"); } @@ -84,11 +87,12 @@ static int parse_options(int argc, char *argv[], test_options_t *test_options) {"num_round", required_argument, NULL, 'r'}, {"burst", required_argument, NULL, 'b'}, {"type", required_argument, NULL, 't'}, + {"forward", required_argument, NULL, 'f'}, {"help", no_argument, NULL, 'h'}, {NULL, 0, NULL, 0} }; - static const char *shortopts = "+c:q:d:e:r:b:t:h"; + static const char *shortopts = "+c:q:d:e:r:b:t:f:h"; test_options->num_cpu = 1; test_options->num_queue = 1; @@ -97,6 +101,7 @@ static int parse_options(int argc, char *argv[], test_options_t *test_options) test_options->num_round = 100000; test_options->max_burst = 100; test_options->queue_type = 0; + test_options->forward = 0; while (1) { opt = getopt_long(argc, argv, shortopts, longopts, &long_index); @@ -126,6 +131,9 @@ static int parse_options(int argc, char *argv[], test_options_t *test_options) case 't': test_options->queue_type = atoi(optarg); break; + case 'f': + test_options->forward = atoi(optarg); + break; case 'h': /* fall through */ default: @@ -146,6 +154,12 @@ static int parse_options(int argc, char *argv[], test_options_t *test_options) test_options->tot_event = test_options->num_queue * test_options->num_event; + test_options->queue_size = test_options->num_event; + + /* When forwarding, all events may end up into a single queue. */ + if (test_options->forward) + test_options->queue_size = test_options->tot_event; + return ret; } @@ -194,6 +208,8 @@ static int create_pool(test_global_t *global) uint32_t max_burst = test_options->max_burst; uint32_t tot_queue = test_options->tot_queue; uint32_t tot_event = test_options->tot_event; + uint32_t queue_size = test_options->queue_size; + int forward = test_options->forward; printf("\nScheduler performance test\n"); printf(" num cpu %u\n", num_cpu); @@ -201,9 +217,11 @@ static int create_pool(test_global_t *global) printf(" num empty queues %u\n", num_dummy); printf(" total queues %u\n", tot_queue); printf(" events per queue %u\n", num_event); + printf(" queue size %u\n", queue_size); printf(" max burst size %u\n", max_burst); printf(" total events %u\n", tot_event); printf(" num rounds %u\n", num_round); + printf(" forward events %i\n", forward ? 1 : 0); if (odp_pool_capability(&pool_capa)) { printf("Error: Pool capa failed.\n"); @@ -242,6 +260,7 @@ static int create_queues(test_global_t *global) uint32_t i, j; test_options_t *test_options = &global->test_options; uint32_t num_event = test_options->num_event; + uint32_t queue_size = test_options->queue_size; uint32_t num_queue = test_options->num_queue; uint32_t tot_queue = test_options->tot_queue; int type = test_options->queue_type; @@ -271,8 +290,8 @@ static int create_queues(test_global_t *global) } if (queue_capa.sched.max_size && - num_event > queue_capa.sched.max_size) { - printf("Max events per queue %u\n", queue_capa.sched.max_size); + queue_size > queue_capa.sched.max_size) { + printf("Max queue size %u\n", queue_capa.sched.max_size); return -1; } @@ -281,7 +300,7 @@ static int create_queues(test_global_t *global) queue_param.sched.prio = ODP_SCHED_PRIO_DEFAULT; queue_param.sched.sync = sync; queue_param.sched.group = ODP_SCHED_GROUP_ALL; - queue_param.size = num_event; + queue_param.size = queue_size; for (i = 0; i < tot_queue; i++) { queue = odp_queue_create(NULL, &queue_param); @@ -298,6 +317,19 @@ static int create_queues(test_global_t *global) for (i = 0; i < num_queue; i++) { queue = global->queue[i]; + if (test_options->forward) { + uint32_t next = i + 1; + + if (next == num_queue) + next = 0; + + if (odp_queue_context_set(queue, &global->queue[next], + sizeof(odp_queue_t))) { + printf("Error: Context set failed %u\n", i); + return -1; + } + } + for (j = 0; j < num_event; j++) { buf = odp_buffer_alloc(pool); @@ -349,10 +381,12 @@ static int test_sched(void *arg) uint64_t events, enqueues; odp_time_t t1, t2; odp_queue_t queue; + odp_queue_t *next; test_global_t *global = arg; test_options_t *test_options = &global->test_options; uint32_t num_round = test_options->num_round; uint32_t max_burst = test_options->max_burst; + int forward = test_options->forward; odp_event_t ev[max_burst]; thr = odp_thread_id(); @@ -378,6 +412,11 @@ static int test_sched(void *arg) events += num; i = 0; + if (odp_unlikely(forward)) { + next = odp_queue_context(queue); + queue = *next; + } + while (num) { num_enq = odp_queue_enq_multi(queue, &ev[i], num); @@ -430,6 +469,11 @@ static int test_sched(void *arg) if (ev[0] == ODP_EVENT_INVALID) break; + if (odp_unlikely(forward)) { + next = odp_queue_context(queue); + queue = *next; + } + odp_queue_enq(queue, ev[0]); } From patchwork Mon Sep 3 11:00:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 145785 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp2346916ljw; Mon, 3 Sep 2018 04:02:36 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYNMNbU7HaxDi2wxXs0W/Y/qsJE0+I2HwdFz/+hMTVltBFItSuX/nCSlSLD5Y5YaRWDn+ZL X-Received: by 2002:ac8:47cf:: with SMTP id d15-v6mr25432527qtr.24.1535972556226; Mon, 03 Sep 2018 04:02:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535972556; cv=none; d=google.com; s=arc-20160816; b=g+KLhG01f2GY7NaZ4FX9bSyv/UhuQdGBupsJG0nX4xX6FpRcMK5K11hv45UNcll61R GTziewhH6UD5Xf5evvdAr8jEpXNz1Wkj7xEGas4MRrhUhDbbeMunA/INrnyJAZOnmvNP l/fw1Oe2/MAAldMeft9swvC1aQyYhSdQo/enQwnD2p3vE2Zjv/8C0fhFfGV0yOws98DO Yst1hut+WwPuse4l7kA6E/SvTYi/huWnUnOzo/PGZ+maFg9cA8ONhCTyOKfSpjOL6Ra5 gFmk1YCmsiN5l3WSQ4iXIic5qpLB3dAaw7X3Br26FWYXVe86lNYyp5q5IE+lqyzb0fVo s7JA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=sMfcyqXyglBaAaVboO36FN+nIqHP/Wmi9LAaJKxBohs=; b=afsZJSN3kRVgivolBAl893/aoV5mjfMlNiRt9pjbSyYGSL8iB9OQ6trBInLZuhLyBI lsSfey+h/z3o+weP7i5gPVyE2zbBMTxM+pD3tlW2pIdoTAUnEbs2YWkYfHRGu7u9VVnt 3cx0PEK4XZKC9wrCqrsueMUpKqyx6vWhr5ZZnm6akoc72TO9DQdxz4tRg1h8ML0qJvZS TzcAIlnrYrORst+v0bb8zd6QxDB05HEqTJBRCc5EYnrEfmZFGP2DxL/L81y54d1KCCMX Qabm03JElUyOFUOZkrPdLRL3DhrAFP5RZmBnvQY4tbYRwLy/YCcO6oKtXywxRmcxhP6i KyBQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id f24-v6si2536929qkm.396.2018.09.03.04.02.35; Mon, 03 Sep 2018 04:02:36 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id D2F6C60932; Mon, 3 Sep 2018 11:02:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-3.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_LOW autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 0CA8E607C8; Mon, 3 Sep 2018 11:00:41 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id D6F65607FD; Mon, 3 Sep 2018 11:00:18 +0000 (UTC) Received: from forward100p.mail.yandex.net (forward100p.mail.yandex.net [77.88.28.100]) by lists.linaro.org (Postfix) with ESMTPS id 741A96088A for ; Mon, 3 Sep 2018 11:00:14 +0000 (UTC) Received: from mxback18j.mail.yandex.net (mxback18j.mail.yandex.net [IPv6:2a02:6b8:0:1619::94]) by forward100p.mail.yandex.net (Yandex) with ESMTP id 8B7845103EAD for ; Mon, 3 Sep 2018 14:00:12 +0300 (MSK) Received: from smtp1p.mail.yandex.net (smtp1p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:6]) by mxback18j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id IyHZq9dgOq-0Cim6eVi; Mon, 03 Sep 2018 14:00:12 +0300 Received: by smtp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id fhlYYakcOz-0BI4VtmI; Mon, 03 Sep 2018 14:00:11 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Mon, 3 Sep 2018 11:00:08 +0000 Message-Id: <1535972408-4918-4-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1535972408-4918-1-git-send-email-odpbot@yandex.ru> References: <1535972408-4918-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 687 Subject: [lng-odp] [PATCH v2 3/3] test: sched_perf: total events per second X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" From: Petri Savolainen Added result for events per second over all workers. Signed-off-by: Petri Savolainen --- /** Email created from pull request 687 (psavol:master-test-sched-perf-options) ** https://github.com/Linaro/odp/pull/687 ** Patch: https://github.com/Linaro/odp/pull/687.patch ** Base sha: 97fc51b1e5b3fcea9db99ba63c10bda47f79341a ** Merge commit sha: 742c63f02e193181bd9172aeb63cf6d3d1de2e40 **/ test/performance/odp_sched_perf.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/performance/odp_sched_perf.c b/test/performance/odp_sched_perf.c index d80f77494..bbd76c86c 100644 --- a/test/performance/odp_sched_perf.c +++ b/test/performance/odp_sched_perf.c @@ -564,6 +564,9 @@ static void print_stat(test_global_t *global) (1000.0 * rounds_ave) / nsec_ave); printf(" events per sec: %.3f M\n\n", (1000.0 * events_ave) / nsec_ave); + + printf("TOTAL events per sec: %.3f M\n\n", + (1000.0 * events_sum) / nsec_ave); } int main(int argc, char **argv)