From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0075.outbound.protection.outlook.com [104.47.38.75]) by dpdk.org (Postfix) with ESMTP id 5464B1B7F4 for ; Tue, 3 Apr 2018 18:01:58 +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=WZKjjeKjmiKD0bfLfOmWG9nD4YTp7jQ0DsXR2LmctSc=; b=ghryxOV4r7v9ovA8svYHb0RjkA1FyugIacxfWus8Q7R2FCCGfJIzZGCr4BX0qa3aufhBLD1IMACPimJtnbC3hTXinKRm8xXA11KCGDLMqEljiU3wR/VFiBTQ4RmgUZs7ThVkz1Mg07U5llP1eoI68K7QrNT8eSx3judHLkMUse4= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; Received: from ltp-pvn.caveonetworks.com (111.93.218.67) by DM5PR07MB3465.namprd07.prod.outlook.com (2603:10b6:4:67::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.631.10; Tue, 3 Apr 2018 16:01:54 +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: Tue, 3 Apr 2018 21:31:32 +0530 Message-Id: <20180403160134.27355-2-pbhagavatula@caviumnetworks.com> X-Mailer: git-send-email 2.16.3 In-Reply-To: <20180403160134.27355-1-pbhagavatula@caviumnetworks.com> References: <20180318131216.11699-1-pbhagavatula@caviumnetworks.com> <20180403160134.27355-1-pbhagavatula@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: CO2PR04CA0090.namprd04.prod.outlook.com (2603:10b6:104:6::16) To DM5PR07MB3465.namprd07.prod.outlook.com (2603:10b6:4:67::20) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0dfe8b5a-7d29-4d25-8bbc-08d5997c399a X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(2017052603328)(7153060)(7193020); SRVR:DM5PR07MB3465; X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB3465; 3:DeR0o344x338Aw1RYTe/zDqVgz2tZhHafP0qyX/90qLz5uXwpEAx6a+WXBllsYeexvdZeNXA28+HCL82drdPQcfhsYToMBaMthTAqAQelo3cXFluwSEi5dnepy10q040XKo0d37Lv4QPIQTV48Dnt2sNwQ+6DBHfvCP59UOWhqBkCQOFXNs+vtNLI1d3x1DF+SaidVbFmDHP3/448GAbBinvh5jwx/hPuAm+z3ctH6p4aERe/tz5wwhE6/PS9itJ; 25:fP2fiy7otrKqjYJtIxqIQFahLMbtVP+lh/vs7s91Fa9kMlOosrb+HLE1j/QZ7IYgepNEHlmDb07ib+woTIhqNNwLnLyKuxHikItMOB/JwYqB2x6+3N+eFT4tCyxLawTCm1SPhBfG5yXvXxfYQsct6+xD7Rtp6WnPn2B7nq09KWuUQ+vsCIx18g8NPzXxqGlJgjh/JNVzZ9irOf2gH4dMp0l1BEFjua7y4Br+OaUb3guMpLTfDCxtX8SLqFmBbbD8DhVv60+5GF0Gh1UJVFque+GhyjcVkOORy2+OqlnDtKMKtuuZ+kXImtd64Lh2lYEKu+UNAMlMNtlmEeh3SFyWSw==; 31:msDd404GWC1vzvePwk7nBdQ1iHyV8yDRJ0IiXTx9SzNdRRO6AiQfPAJWWtL+fzTE7sHwhnsV1M3vv9QUHJdZht4RdPlm9Ju3Xu7/4/SHxlSz4OfsnRJ+XIo8NcqckihuWDnIcc2s8OpesKVpHX06kuBXGYA2NGtQj9o8g3Y8U5XhUEQ9c3FeNRt1t8khXMoElfTta6V1jadKb7QcB2JyuwKQGVPW1I5PWcGc17WbBH0= X-MS-TrafficTypeDiagnostic: DM5PR07MB3465: X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB3465; 20:OrLxHM5B7eGKDLmB9etWGTyvLrTAECoH5mTwQChMbZ4QMOJ4z3gzfhET9dCo4mI8jVCHugeTVNcGFyhG0ZNviydNOBKCYuaFD3m8XSO43xM3WRuYf+AVgICwDmWscsIEBjQmC9BmE0z42cxhY3dQosqWm9Sk0cgRHpUvotpbDuj6bBW79H0AE8GZ9ln5Vp4u5euxKJBUkGILd60/Zyq3W2p8UR4MNBb/x4dIKe8CGxWPily00ykNd4/hDJh1ws42Tan/Pnqg+tGLSCsA4X3HNnrX3ALENpFkNrE4Zj+hgS1Vcv6p9BH+htKUpvuu+W3TQ54nOl2Va36zBDL0sj1NhqNv7rdl0O2+e/B2xeXZA+5I5ooPPD9dwKhQXJUW1naRc20kOsPgl7qvId1JxoS3eeKPNfP5ik2uHwNWg/rWA1DHURC2HX0TBFLcuEDrGHeTrO52AeCAWGa07vdld0zlHEFZDXznr7wLtJjWfYo6P5a9mkEcmdR+jzFVNca9PtH/VdP+BqhHkJBP+bgKFnz+ty/xtzanw0o6qG1tzJcDUjxG4mJvUllfgdQNKr2rQQokGsvoomWpwzGndurueGd9WcAf4okA5uLuBLfdEPO2Hyg=; 4:USjqW6VA+TmCoRm8YpU3ofa2f5WZ2g8SXVJy4jd6yDkuA4QyHWeViHwQtOgos8p1PWrgVdIai6WKHDzo6r2wSytGAOULxqd6cZXjLaCiNWQVbPY+D2J7IeALRajJ90l0uu/q4JvbmCWP2QY7WPvXVi4nLljM+1T8dZqtU8Ncq4jYcyhX7m1XbgMrYcfn59NAnS5PqPD6KK5aFSKaCeuEhhjLkIC+bKJwSVvuRvb7RIzrd+w9liGpR6LrVYUNaZLTWOS6mXSEhtngAS/ZE+3thA== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(3002001)(10201501046)(3231221)(944501327)(52105095)(6041310)(20161123558120)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(6072148)(201708071742011); SRVR:DM5PR07MB3465; BCL:0; PCL:0; RULEID:; SRVR:DM5PR07MB3465; X-Forefront-PRVS: 0631F0BC3D X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(376002)(39860400002)(39380400002)(366004)(396003)(346002)(189003)(199004)(52116002)(50466002)(386003)(6506007)(5009440100003)(1076002)(6666003)(42882007)(6486002)(48376002)(2906002)(16526019)(25786009)(69596002)(59450400001)(51416003)(76176011)(446003)(4326008)(81166006)(81156014)(11346002)(106356001)(105586002)(68736007)(7736002)(5660300001)(53936002)(478600001)(6512007)(316002)(66066001)(47776003)(36756003)(97736004)(305945005)(1857600001)(72206003)(476003)(956004)(2616005)(8676002)(486005)(6116002)(3846002)(486005)(8936002)(16586007)(26005)(575784001)(50226002)(53416004)(107886003)(42262002); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR07MB3465; 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; DM5PR07MB3465; 23:uYmMNfYsxLb2ZvMdu6LFTD6FlAYsLpqB5Gr5c9CMX?= =?us-ascii?Q?OWhVSuk0mYU022fb5XlULgaNdexDir4bWIOtsTWCXPhvVWUYU5Lq0yg/3kmC?= =?us-ascii?Q?50pQrefYZO4de4aPcMn0KVRQvixhW7rr1FHC0wDzETyHu2a5K9U+wmj//ViJ?= =?us-ascii?Q?kBodpX8N9xQS/3pIm3ScJy3IV8ly3Ke9fkTB4IPeZinrnQAhwPCiI3UIp9N3?= =?us-ascii?Q?NyuCnbjFnkh8YEDliTe7JZC/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; 5:XwMXXdi3vPw2KldN9mpPPcNu916IGWGMeVErSbNY1dnD83E5v19LAsWQ9c3gfHTV2QOFNWnheyMvJaqimuIHtVmPoXnDJOdb9/Dz5dr+GFp4BApf8I5qow4pe3GVWMBxRAlbl/z+lTUe31xAbDRSrPSspNYUkc/035Dv0YeKL6E=; 24:4Q5pQwCg5rv0cXrO1nJRYHjMLWs/KeTIM4LgS8rCWx8LB5Xhrs8Losk675QZEgKCq1/hUBfyFpL1PkwCevKH3CBoWJ2fqvef1QCPCu9aRVM= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB3465; 7:lp8opODuXJsTdU2bjTzxmD8I25BpG+Ti74eNPKaPbaQjvXv8BONlTZfcrz8MhbK5pyni1EkUUhuOP5vPnHPhyc48PxhTX9jl4Py112i+AZ9nWNEt5elgnTKtLtwsGVuJf5JTCHYLxCgBFwF0taE5D4pW5F+laS3YSz7Qyjtv3YfbG1w8W+O0G41H2Lb5VGHJTRX5QK083x/lF256InbXwMgfJmOsxaSSElQ7Z4dPo1PAtq6b4Hme8AfciEz+Vpo9 X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Apr 2018 16:01:54.4566 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0dfe8b5a-7d29-4d25-8bbc-08d5997c399a X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR07MB3465 Subject: [dpdk-dev] [PATCH v2 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: Tue, 03 Apr 2018 16:01:58 -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 | 66 +++++++++++++++++++++++++++++++++++- 3 files changed, 80 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 39072eb5d..6d0db1dc5 100644 --- a/app/test-eventdev/test_perf_common.c +++ b/app/test-eventdev/test_perf_common.c @@ -132,6 +132,66 @@ 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->optm_bkt_tck_nsec ? + (opt->nb_bkt_tcks * opt->bkt_tck_nsec) + / opt->optm_bkt_tck_nsec : opt->nb_bkt_tcks; + + 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) { @@ -140,8 +200,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