From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0043.outbound.protection.outlook.com [104.47.41.43]) by dpdk.org (Postfix) with ESMTP id 8F71A4C70 for ; Sun, 18 Mar 2018 14:13:05 +0100 (CET) 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=GXys+j4O5Eq8sdkXnmbqMJw85nxrrT7TfdvrQSEvMmA=; b=kBq2Q5zl+xwFxnDFtdtI0YNZEbqgsa0E0zKI5KedOa8T1b5Tf13sKVt9CpFw51EnbIkwGdoiZfi9Ld9EId1hA7CNHCPR94/0ypx/hPMFxJo35l5MHdORAP4bVHi3tbZNy3Iy8VVK/X/FTnzBiDDg7PyX8Vl6y0zRd6TQDh+LYzc= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; Received: from localhost.localdomain (111.93.218.67) by MWHPR07MB3469.namprd07.prod.outlook.com (2603:10b6:301:63::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.588.14; Sun, 18 Mar 2018 13:13:01 +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: Sun, 18 Mar 2018 18:42:14 +0530 Message-Id: <20180318131216.11699-2-pbhagavatula@caviumnetworks.com> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180318131216.11699-1-pbhagavatula@caviumnetworks.com> References: <20180318131216.11699-1-pbhagavatula@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: SG2PR0401CA0016.apcprd04.prod.outlook.com (2603:1096:3:1::26) To MWHPR07MB3469.namprd07.prod.outlook.com (2603:10b6:301:63::20) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f829330a-63b0-4e54-de6e-08d58cd1fb5f X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(2017052603328)(7153060)(7193020); SRVR:MWHPR07MB3469; X-Microsoft-Exchange-Diagnostics: 1; MWHPR07MB3469; 3:hxCUwmI+D8Q3jBZAc+iVb0OpBCfY8gfFEdfelAhBV/giLe4gb3RXkmVF0sRnU0WxQ+0RkGlPHP5APQlueXp+pX2/22ivPCpacW2lWPV4c48HL4HfCH1SpAZG7Uu+Buc/HDY0iWhKzrXHiyOE+ApC4x9B4F8kYBAbUCpOkqP0B8+fFgT+z8rtBZyidVx34h4YoxuDzl5SlKsKStFN9RllP0ESRfGVpDKwB+lvoyFcHOHmvd3NHXnGSt/5Ygcs+tes; 25:55896B9VTyQNy88HxKdK0Lpb70sFeYcu3+SBwlDYwI+nYqNWsBle+BrMeKygSV3m+CObBTL46JT5O3Xu+4Q67XevKqOodSOEPUe/FUTAaXL1hHSnX7c7wzdLCiWdvow6xHgtuwtOPRtiyFA/x5IZP9fOfjFuh9OYR2PfQmZSaQwee/sC1qyZ7fk/cuG5WFCNR3OvPtEb62UTLyCsNyW/8b1dw5/iDBIHUW649OJ5zXj6exoHtSfwgYf12yUBaecUY1RkrE1VlORY4xgx76Ihh2rJte4/vWH5k4DlrGCX2CtUg9k1mkGkb5GMKu9WyqBC+7QmLSlT79VPodP/zMY2vw==; 31:8CPlJVlZoIVwwzT0rw7xguWqmFEEbPmobsMwTz+0ruyUFPT2e54eEOb7Vy9cdRcunzn0BSCdARZS0aU6Za7eC0Lq68t7h+rMFyw5yQt3wKDehXLaAu070ukOGPuBImeIk7gMW6bdShYk0S6i8GLl5nfnyNlO9CbV73/KoY4WlnOGyHyJKdRhvSczLJF1b42rSj6PUFOxT3EXJFev/6L+ols1tYaWsfV4lu2C6Gc5l0Q= X-MS-TrafficTypeDiagnostic: MWHPR07MB3469: X-Microsoft-Exchange-Diagnostics: 1; MWHPR07MB3469; 20:90IYdkT2WAniO8GD8ToeQyIg4fSIOU9JGs3a5Z6Ybbkfc4L4mEI3Ki1dV7IvRCkb3keIKCR63K+XB1BCWQkWvd25BPFdid84yhbFlCnpM0VskT5mx6OPwfVAKyMnhAb8QRXs5IMVExYW+vAxTAFDu9Hwt+YA72yDaIuN1d3uq2nvmFYT6LcRwrLEDCITt8Z8XmXwPjhnaVBw5XArQBHcif9qaPNk63HIadGiikMFX8sYGs1HZIOp3vguI1/FG+g4mch9n0YOM/KM8gc/y9SRa/U3vZodHadjbkJ3W5ifkkKBqKWt9WwlqrR7Zy1hufhISCe29Gk/gsStUtZB0kKWPbkbR35TqT7zpjFWrX1O35z3fUsEouln0WzlKtoQHUY0uOGs8arBHhqZ5mjPeWDiKhFO6VMNFIh59QrGVrZbzGfcENXxDurDFQUeAuCsHQlJlm51yqsiuPHB3XBv8J/j/0VYWht87XXTDsl3Xfe2MvDQQk2+kB3RX7EJDATXGCDNwkyKFhIumdEYgd+68mCU8VI6ACBuY4HhlT99A+n5UBqXfyzTbE60jvn2siFuqnwnaZcUt3YJQWeQhZSvbVBJtzcE6Z8NgMe9+q1avjWLdNI=; 4:nzTypsTwXfhpJ54aoiPwrGN0JNEEjw0ZTrsnPeNRYIBAWmK4xAArKU4+ep2nGWhHJFf/MgGr2ze19o4mXFvdiLLJJeGqtScrro5N9MdYgY6YWxcBrOaVTKYXbxz7mGscDbgaitLpk87lMqc2Ru604SFTtP6NGeT5rtJwha+rF9h5OiZVPSHE5T/HOG8ZqDoVF/Sx27UaVbSy2KF0DXWhF0mJPNcvTT8jQTXmveJK1iC4NCqP1lGgVJ7NAefjpqXbpGIYk8rESJDFs4i8dPa9tQ== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(3002001)(3231221)(944501244)(52105095)(10201501046)(6041310)(20161123560045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(6072148)(201708071742011); SRVR:MWHPR07MB3469; BCL:0; PCL:0; RULEID:; SRVR:MWHPR07MB3469; X-Forefront-PRVS: 06157D541C X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(39850400004)(346002)(376002)(39380400002)(396003)(366004)(189003)(199004)(50466002)(81156014)(5660300001)(316002)(105586002)(6486002)(7736002)(305945005)(42882007)(6512007)(8676002)(50226002)(2906002)(68736007)(48376002)(6666003)(478600001)(16586007)(53936002)(5009440100003)(106356001)(72206003)(2950100002)(1857600001)(16526019)(66066001)(386003)(6506007)(59450400001)(47776003)(4326008)(52116002)(97736004)(36756003)(107886003)(81166006)(8936002)(25786009)(26005)(51416003)(76176011)(3846002)(6116002)(1076002)(42262002); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR07MB3469; H:localhost.localdomain; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR07MB3469; 23:74U7HF7BaLwU9bOuyxvRzU0QnpF2Z0X4iVMrXcRvN?= =?us-ascii?Q?aU4OL2SzXoPtCWJrOUXYhOp5aajnbjDqgWXO3I/ZvYf4rl/jqZWKZTNpEyUg?= =?us-ascii?Q?SUBmJxDTb1e6P2Ff0YAWiOAC8/eixR7+YPCVIB/RWO0L3nIRoGwzj4VyFMUf?= =?us-ascii?Q?4E/sPaFt9gLvUupqdv5Yk7N7ZgOiSA4sG/BD+JNJgnHjXwRbLWf0LCB1R+xz?= =?us-ascii?Q?7ciBJoAAV7Swge/JOuLDOt4BtA2MUAL5Za0JY5Dhz7Z+9PU86hOY5vdhyOgx?= =?us-ascii?Q?bvtGxdSugnMrp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R5/+vU8T6WuWTYJjzYwHjqQg1rTI8iEAbPKUhA9jBr3CSL/uieCUVhS/AqsoYMI3dvcGWnRAH3OXvF5G3lLykyZZc9tERGXzj6MI76VGEcAgWy/Z7+dO2cijWHRaJdu4Nty8O18GHXM7gFCviRe4Hb26TY7kc9469wnifSz9riz1tr0A1wTT/+j8WJcL33shUzsSYCuSTZ SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Mar 2018 13:13:01.9960 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f829330a-63b0-4e54-de6e-08d58cd1fb5f X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR07MB3469 Subject: [dpdk-dev] [PATCH 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: Sun, 18 Mar 2018 13:13:06 -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 | 2 ++ app/test-eventdev/test_perf_common.c | 61 +++++++++++++++++++++++++++++++++++- 3 files changed, 75 insertions(+), 1 deletion(-) diff --git a/app/test-eventdev/evt_options.c b/app/test-eventdev/evt_options.c index 49cd9c419..05d6de88b 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 x * bkt_tck_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 37debae84..03078b21b 100644 --- a/app/test-eventdev/evt_options.h +++ b/app/test-eventdev/evt_options.h @@ -32,6 +32,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 { @@ -65,6 +66,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; }; diff --git a/app/test-eventdev/test_perf_common.c b/app/test-eventdev/test_perf_common.c index 6ae146d91..072b5f8cf 100644 --- a/app/test-eventdev/test_perf_common.c +++ b/app/test-eventdev/test_perf_common.c @@ -128,6 +128,61 @@ 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; + 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, + .timeout_ticks = (opt->nb_bkt_tcks * opt->bkt_tck_nsec) / + opt->optm_bkt_tck_nsec, + }; + + 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) { @@ -136,8 +191,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.16.2