From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0078.outbound.protection.outlook.com [104.47.33.78]) by dpdk.org (Postfix) with ESMTP id 60D341C73A for ; Fri, 6 Apr 2018 16:56:24 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=7TYQBpaTiAkHiaK+m9hcHWDik/cv09CiuBnWpq6Oh74=; b=iOpTRmJWKsZJ3qd+WpiXmgjiy3EWlNVUDQ8Timd7vgbyXCzMG7PJXIxgPsleL0URrzKYygdmSFRdYW5VUDgj2TGXQQ4G+nxt38URrkWuRIYvKnW9ynpuV39hM6Wc0/XoPuXwCduch0jHW/eLV/QBbjnfCCLsho/aGJ89Qzud+vE= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; Received: from ltp-pvn.caveonetworks.com (111.93.218.67) by MWHPR07MB3471.namprd07.prod.outlook.com (2603:10b6:301:63::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.653.12; Fri, 6 Apr 2018 14:56:21 +0000 From: Pavan Nikhilesh To: jerin.jacob@caviumnetworks.com, santosh.shukla@caviumnetworks.com, erik.g.carrillo@intel.com Cc: dev@dpdk.org, Pavan Nikhilesh Date: Fri, 6 Apr 2018 20:25:20 +0530 Message-Id: <20180406145522.7775-2-pbhagavatula@caviumnetworks.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180406145522.7775-1-pbhagavatula@caviumnetworks.com> References: <20180318131216.11699-1-pbhagavatula@caviumnetworks.com> <20180406145522.7775-1-pbhagavatula@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: BMXPR01CA0031.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:c::17) To MWHPR07MB3471.namprd07.prod.outlook.com (2603:10b6:301:63::22) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 041fa71f-f572-444e-4ad8-08d59bce906d X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(2017052603328)(7153060)(7193020); SRVR:MWHPR07MB3471; X-Microsoft-Exchange-Diagnostics: 1; MWHPR07MB3471; 3:/OysCAiPBhtOmQSNk3cKTRUCxtCuaBX5b9yi1toi2VuAP+tRsilkNXNqnPI4BZk8M6PKO/HdCCv1X2+aMn06wjevL7akqJy9Q7urKRtMdQC9Kmj2la2sqqpUJAb2Tj4632Fo31vWsXKYMbTVEjYWLpVmk22CpY9DEWAAvZHE5RaJkNDPGP6m6MgRn71yyw/F8xwO6wW0YjdIvC9W9xWcwSH3yUmKjx9WMBA83rfc7chi+09HKpPrFAmUdOue5f90; 25:GRtU1kacWPQ55IflfUKFn3VknKZpkBpA+4OPuv+NwZ+KBdzVAaQbdC5WQEXDd3Jj6/OfKiPSI6f7RM/Hqoev1iyBSlnJmSe+XMxsD9ydYcAI0NGWrc9kL42ExEijZf2TYaCVegGCwQrgsRBZFuvIoTlP8sP8rzIzm54C3c7qxI04VwRzuw/p1lMFlnBPPw8FsQ+f0wCxyEwrus+81jHyo0IWTYXPpS2cYtOEyTV0uFmQaJaPVfkl5n35KbpGXbAArqQX1YX8fb+5SaouPZUVrjwmcBLjMuqYdADEYyBSIuqsw99aVlR+BZKLeZbR7pddNrFVLuxYLOCrFrZEkyQTcQ==; 31:OygB6JdGxCW99A7DFMxnOLFWPZm5kncpb+rxv0NpjiWYcw3oeiKW9Vvb1b3e0zy5z4U+s4GHCDSi/indk8zWKKBP4SgkHTUENLRPms0fe5ime5AqYrz8k7qqc+D3zYlTLZZPzUoPbiHTRcxPrm/OiYr3U++xrusGaU/TEa0iqvacw69Ltuqeleg9QPrdxnYlXRNIF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exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(3231221)(944501327)(52105095)(3002001)(10201501046)(6041310)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123560045)(20161123562045)(6072148)(201708071742011); SRVR:MWHPR07MB3471; BCL:0; PCL:0; RULEID:; SRVR:MWHPR07MB3471; X-Forefront-PRVS: 0634F37BFF X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39860400002)(376002)(39380400002)(346002)(396003)(366004)(189003)(199004)(53416004)(106356001)(8676002)(25786009)(68736007)(81166006)(305945005)(48376002)(3846002)(7736002)(6116002)(66066001)(47776003)(478600001)(4326008)(2906002)(8936002)(52116002)(50466002)(105586002)(50226002)(69596002)(1076002)(81156014)(5660300001)(1857600001)(51416003)(16586007)(36756003)(6512007)(76176011)(16526019)(97736004)(107886003)(5009440100003)(42882007)(316002)(6486002)(53936002)(72206003)(6506007)(26005)(476003)(486006)(11346002)(956004)(2616005)(446003)(386003)(42262002); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR07MB3471; H:ltp-pvn.caveonetworks.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR07MB3471; 23:bPnevZJ1C2tcUp0k72VPX1ctuyBBzeXH6JMRCHDYP?= =?us-ascii?Q?OB75LhsX0z6IOp+bhP2gO3/Cu4p/2BTHybMbClmrWic1RwM2HV45gd8ttjZ0?= =?us-ascii?Q?pmpJyoJxmDUErUHcMeLehCyv5leVUIeADQbbBTqNtxuQHqrbw1tsNF/0vszs?= =?us-ascii?Q?TvL+03qNz3q+fVrqKQldt+ff9cCJBdFMR40ry7vgc7pb5zHg5mZLBJXITfdT?= =?us-ascii?Q?7D8SjYmmsVJurPAJpzSpnOfWFfK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T/eVWyNbyjVyvNrWCFepdh9yz7v+DNmik4pKr6sJoUHylq+YUv+Bd6Ij1vy04YviMXEKqxY=; 24:BseWNf8zb8i95jvKUrCw5s7388K8AXX7wj/ThkZTtr4ujvK7JaGXXdav4nTl0VIDMzS4ARrPW+Y4xOTJg9tCt9yWvokZW9sprJAQe8hR7xE= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; MWHPR07MB3471; 7:X2yg39I36eC7M8aen6WsqeemQ+tgqV02WZy7QXgcJCmHDiLX6J4B+pASakV0gTr/6em0BaqlQhUVYiSSJcg9Nx7TTd+24PSfZ34q2JTY0LlsRxDb2Ga2l+8lI7lAXcRDsg73XOU2o7JmIJcKrpwI12BpTBryk5703HTb6k+xWgC4D1bvsGDHSWNIjlCTvyuLjdablMHtTYd88/0KvwLNq3w7kUBq3r41eebF3OF0N34oeRca0qf1sMBrIArQWIA1 X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Apr 2018 14:56:21.3786 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 041fa71f-f572-444e-4ad8-08d59bce906d X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR07MB3471 Subject: [dpdk-dev] [PATCH v4 2/4] app/eventdev: add burst mode for event timer adapter 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: , X-List-Received-Date: Fri, 06 Apr 2018 14:56:24 -0000 Add burst mode for event timer adapter that can be selected by passing --prod_type_timerdev_burst. Signed-off-by: Pavan Nikhilesh --- app/test-eventdev/evt_options.c | 13 ++++++ app/test-eventdev/evt_options.h | 8 +++- app/test-eventdev/test_perf_common.c | 67 +++++++++++++++++++++++++++- 3 files changed, 86 insertions(+), 2 deletions(-) diff --git a/app/test-eventdev/evt_options.c b/app/test-eventdev/evt_options.c index 47e37bc9b..1b60eb2ef 100644 --- a/app/test-eventdev/evt_options.c +++ b/app/test-eventdev/evt_options.c @@ -98,6 +98,15 @@ evt_parse_timer_prod_type(struct evt_options *opt, const char *arg __rte_unused) return 0; } +static int +evt_parse_timer_prod_type_burst(struct evt_options *opt, + const char *arg __rte_unused) +{ + opt->prod_type = EVT_PROD_TYPE_EVENT_TIMER_ADPTR; + opt->timdev_use_burst = 1; + return 0; +} + static int evt_parse_test_name(struct evt_options *opt, const char *arg) { @@ -185,6 +194,8 @@ usage(char *program) "\t--prod_type_timerdev : use event timer device as producer.\n" "\t expity_nsec would be the timeout\n" "\t in ns.\n" + "\t--prod_type_timerdev_burst : use timer device as producer\n" + "\t burst mode.\n" ); printf("available tests:\n"); evt_test_dump_names(); @@ -247,6 +258,7 @@ static struct option lgopts[] = { { EVT_QUEUE_PRIORITY, 0, 0, 0 }, { EVT_PROD_ETHDEV, 0, 0, 0 }, { EVT_PROD_TIMERDEV, 0, 0, 0 }, + { EVT_PROD_TIMERDEV_BURST, 0, 0, 0 }, { EVT_HELP, 0, 0, 0 }, { NULL, 0, 0, 0 } }; @@ -272,6 +284,7 @@ evt_opts_parse_long(int opt_idx, struct evt_options *opt) { EVT_QUEUE_PRIORITY, evt_parse_queue_priority}, { EVT_PROD_ETHDEV, evt_parse_eth_prod_type}, { EVT_PROD_TIMERDEV, evt_parse_timer_prod_type}, + { EVT_PROD_TIMERDEV_BURST, evt_parse_timer_prod_type_burst}, }; for (i = 0; i < RTE_DIM(parsermap); i++) { diff --git a/app/test-eventdev/evt_options.h b/app/test-eventdev/evt_options.h index b51d8d5b3..e5e632783 100644 --- a/app/test-eventdev/evt_options.h +++ b/app/test-eventdev/evt_options.h @@ -33,6 +33,7 @@ #define EVT_QUEUE_PRIORITY ("queue_priority") #define EVT_PROD_ETHDEV ("prod_type_ethdev") #define EVT_PROD_TIMERDEV ("prod_type_timerdev") +#define EVT_PROD_TIMERDEV_BURST ("prod_type_timerdev_burst") #define EVT_HELP ("help") enum evt_prod_type { @@ -66,6 +67,7 @@ struct evt_options { uint32_t fwd_latency:1; uint32_t q_priority:1; enum evt_prod_type prod_type; + uint8_t timdev_use_burst; uint8_t timdev_cnt; }; @@ -275,7 +277,11 @@ evt_dump_producer_type(struct evt_options *opt) evt_dump("nb_ethdev", "%d", rte_eth_dev_count()); break; case EVT_PROD_TYPE_EVENT_TIMER_ADPTR: - snprintf(name, EVT_PROD_MAX_NAME_LEN, + if (opt->timdev_use_burst) + snprintf(name, EVT_PROD_MAX_NAME_LEN, + "Event timer adapter burst mode producer"); + else + snprintf(name, EVT_PROD_MAX_NAME_LEN, "Event timer adapter producer"); evt_dump("nb_timer_adapters", "%d", opt->nb_timer_adptrs); evt_dump("max_tmo_nsec", "%"PRIu64"", opt->max_tmo_nsec); diff --git a/app/test-eventdev/test_perf_common.c b/app/test-eventdev/test_perf_common.c index b6cc00e60..a74ab9a9e 100644 --- a/app/test-eventdev/test_perf_common.c +++ b/app/test-eventdev/test_perf_common.c @@ -133,6 +133,67 @@ perf_event_timer_producer(void *arg) return 0; } +static inline int +perf_event_timer_producer_burst(void *arg) +{ + int i; + struct prod_data *p = arg; + struct test_perf *t = p->t; + struct evt_options *opt = t->opt; + uint32_t flow_counter = 0; + uint64_t count = 0; + uint64_t arm_latency = 0; + const uint8_t nb_timer_adptrs = opt->nb_timer_adptrs; + const uint32_t nb_flows = t->nb_flows; + const uint64_t nb_timers = opt->nb_timers; + struct rte_mempool *pool = t->pool; + struct perf_elt *m[BURST_SIZE + 1] = {NULL}; + struct rte_event_timer_adapter **adptr = t->timer_adptr; + uint64_t timeout_ticks = opt->expiry_nsec / opt->timer_tick_nsec; + + timeout_ticks = opt->optm_timer_tick_nsec ? + (timeout_ticks * opt->timer_tick_nsec) + / opt->optm_timer_tick_nsec : timeout_ticks; + timeout_ticks += timeout_ticks ? 0 : 1; + const struct rte_event_timer tim = { + .ev.op = RTE_EVENT_OP_NEW, + .ev.queue_id = p->queue_id, + .ev.sched_type = t->opt->sched_type_list[0], + .ev.priority = RTE_EVENT_DEV_PRIORITY_NORMAL, + .ev.event_type = RTE_EVENT_TYPE_TIMER, + .state = RTE_EVENT_TIMER_NOT_ARMED, + .timeout_ticks = timeout_ticks, + }; + + if (opt->verbose_level > 1) + printf("%s(): lcore %d\n", __func__, rte_lcore_id()); + + while (count < nb_timers && t->done == false) { + if (rte_mempool_get_bulk(pool, (void **)m, BURST_SIZE) < 0) + continue; + for (i = 0; i < BURST_SIZE; i++) { + rte_prefetch0(m[i + 1]); + m[i]->tim = tim; + m[i]->tim.ev.flow_id = flow_counter++ % nb_flows; + m[i]->tim.ev.event_ptr = m[i]; + m[i]->timestamp = rte_get_timer_cycles(); + } + rte_event_timer_arm_tmo_tick_burst( + adptr[flow_counter % nb_timer_adptrs], + (struct rte_event_timer **)m, + tim.timeout_ticks, + BURST_SIZE); + arm_latency += rte_get_timer_cycles() - m[i - 1]->timestamp; + count += BURST_SIZE; + } + fflush(stdout); + rte_delay_ms(1000); + printf("%s(): lcore %d Average event timer arm latency = %.3f us\n", + __func__, rte_lcore_id(), (float)(arm_latency / count) / + (rte_get_timer_hz() / 1000000)); + return 0; +} + static int perf_producer_wrapper(void *arg) { @@ -141,8 +202,12 @@ perf_producer_wrapper(void *arg) /* Launch the producer function only in case of synthetic producer. */ if (t->opt->prod_type == EVT_PROD_TYPE_SYNT) return perf_producer(arg); - else if (t->opt->prod_type == EVT_PROD_TYPE_EVENT_TIMER_ADPTR) + else if (t->opt->prod_type == EVT_PROD_TYPE_EVENT_TIMER_ADPTR && + !t->opt->timdev_use_burst) return perf_event_timer_producer(arg); + else if (t->opt->prod_type == EVT_PROD_TYPE_EVENT_TIMER_ADPTR && + t->opt->timdev_use_burst) + return perf_event_timer_producer_burst(arg); return 0; } -- 2.17.0