From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0043.outbound.protection.outlook.com [104.47.37.43]) by dpdk.org (Postfix) with ESMTP id CCC941B00C for ; Mon, 18 Dec 2017 22:45:16 +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=4xPlVk1KvNH9BEe94ZRN7x2kDYHpQ4iggvaQLJ3THFs=; b=eXuLzjBv9KmdXzwXMTNdNWA29e0aHrG2ERnBAip8DigXyWTSnyarEXH5cnv9IKEEJERNqzsZsLHCprbIkBKoHSzpcdedYpoGWS2TyobjKbkeYf0hOEPkhMKSsHTeUFUnuNaUIYBe8c9+o/vCyaI+c31dKjoLKZ574NsmW1Zr8sw= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; Received: from localhost.localdomain (111.93.218.67) by DM5PR07MB3467.namprd07.prod.outlook.com (10.164.153.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.323.15; Mon, 18 Dec 2017 21:45:11 +0000 From: Pavan Nikhilesh To: jerin.jacob@caviumnetworks.com, santosh.shukla@caviumnetworks.com, bruce.richardson@intel.com, harry.van.haaren@intel.com, gage.eads@intel.com, hemant.agrawal@nxp.com, nipun.gupta@nxp.com, liang.j.ma@intel.com Cc: dev@dpdk.org, Pavan Nikhilesh Date: Tue, 19 Dec 2017 03:14:00 +0530 Message-Id: <20171218214405.26763-7-pbhagavatula@caviumnetworks.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20171218214405.26763-1-pbhagavatula@caviumnetworks.com> References: <20171130072406.15605-1-pbhagavatula@caviumnetworks.com> <20171218214405.26763-1-pbhagavatula@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: HK2PR02CA0163.apcprd02.prod.outlook.com (10.171.30.23) To DM5PR07MB3467.namprd07.prod.outlook.com (10.164.153.22) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 136fdce2-6882-48ee-0677-08d546609fab X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603307); SRVR:DM5PR07MB3467; X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB3467; 3:PeqrBdiIyMej5W0n1hEsgmDCIYprclDt4rXRmIleZSUKBR93tjVPshGR8BCDErgRfvMTIheZF4/LpJmuu4lWisXUCejbrXn/nJLwYOZw7/A6G/hWDJsZ5zq2K4Y6erdbb9DhLghWrtFL49CkuHkZ09b5TlIfWyU6eZxkd17WNdWZmp+AsyWXFypVypvWlXV3D1FFecQ5+hDHmGoaTc2P/aHzclk8vUZ73P2ZFNX2BBoxMcbP1T9sv+OquMz+imdh; 25:FN6QmJSRnOHb94sifQ5P4kf7VnK/lOeF6Cwc/+JkQtnS/B7GmfS+oXm1o0c9yxN7nu0GWMMLPKv6i5sYKe2r8l2w3kmNILgd7AF3gGh3mQzI8t6yhXAJ0OP/YjqLddGUKMyYkejA0OGyBKKP6gYq1vFG//73qowcHu7Gq7ZDb3z+2rdtX/uRNb4tkF/137zYG96nLfw/7/qo8gki8wFXORDQXN3EHOn0BNdLKPmxWDta8a7PvIPqbFY8M31tzOaPI2CPMYLWi+wvqGxOkw8r71GMoGDdW1wtUbgVnJOmq6uDw28xbvCgYGhSrSYfFdpIn1JK9JIISurR6NU3dGrDYQ==; 31:dBXESaeeEdVWIFiBjUwYpuCdDTzV9BaWeLhPGjYdE/2kqDmy2qVqvMBJHoYLPkLkSQv+GhhkyAJMJPx9BPLzJU2tC4UyMgQ9L8/qL12iahEtVJbwTULW0et/rERd4GFhwtZe8o1OshEUwumDZOFGb+xOCxoD69o0xLZSU514F1RQ1APGj1jmrMTtG/3ER8cmah9QJCIQv2NAlJpTwoNnTl6hgde24AKXCA4IZIpscEA= X-MS-TrafficTypeDiagnostic: DM5PR07MB3467: X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB3467; 20:7mfVBg6LviGOhkaUzxGBU7guvJ5hMg+ipgUCVhReXj2CnR5xHKcGR27R3+zihxee/yuUmVVyGgNAByDxRHeXo2hb2dqtn+JrIxHHj5bu1nEP+jH5s5ab8/eV9KpaHj6MXvXpfh0WJ7uOBq6VtxFtRWLRnwm3e4RWinhybIWoXYuIVcf5kt2196iGKKQR0RsVY79fLrMsaXH08xjZgGHqT4cnuLJpcdRnl/7hOdk7a99uEb584GWHBlI2Cj+nn3ITo6rLRu/4uffk7xhANybCCOpwumXaZG0gBkCTYipvsPObpauJxZ5duEd5R9ntUX+s1IV3a8DSnWmwCDDJN7zxe7wBJ59wcBxhbawUdvGrp7+/Kb4DW/uSzo2JIYmFGlSkVGKo7fLbrZgBQLxSug7nhgTxEOTmux8usbRIOngcs8/owF4caK+S1kpuPBGBfHjxx42/00nTe5j8VW6oz4pw/k6ly6hH/O/6w1IvV0t6YtdbYrybo79JSRbbtTi50o1q2A+Aq5H31UrzapG+PdBuCUMa0mV5gvY/utwiah+php6rjJkHHvEZW7+f+oKHcZLkyAFcijStzNYVDBJ+Il+QlQ1NimoyUunN9/Vs9dPrKmM=; 4:IFnTSpnwgKsYhONbJLMKTDfQSJHkwX9oN8i9aBl0wc0Birojq3y8wp7tqT6laT89/5kUXt3ed4T2bC6EoFbJrBeF0F9yfS24Whd0W0InRtyWUS0rvP0qmNmG8bBqZTcVR1It4XIcvr75VzNO2aQ7jgk+2ZAusoFTd6ct4WTgNCFdAtdk+VV951WsEPGWyAQbE661ZAvWn5QlmZgQhIqOBMlebryxd6OiTbxvN/cjvKHhn4xGRJO+MsjC0gXuly1cTAYPT4PxpM/Kbf1/qs1PRg== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(2401047)(8121501046)(5005006)(10201501046)(93006095)(3002001)(3231023)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123562025)(20161123564025)(20161123555025)(20161123560025)(6072148)(201708071742011); SRVR:DM5PR07MB3467; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:DM5PR07MB3467; X-Forefront-PRVS: 0525BB0ADF X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(396003)(366004)(376002)(39860400002)(346002)(199004)(189003)(4326008)(2906002)(53936002)(305945005)(25786009)(1076002)(8936002)(50226002)(16526018)(6506007)(386003)(68736007)(52116002)(478600001)(51416003)(48376002)(5009440100003)(3846002)(6116002)(72206003)(36756003)(6486002)(107886003)(8676002)(5660300001)(106356001)(105586002)(8656006)(2950100002)(42882006)(6512007)(6666003)(59450400001)(16586007)(7736002)(66066001)(47776003)(76176011)(50466002)(81166006)(81156014)(316002)(97736004)(42262002); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR07MB3467; H:localhost.localdomain; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX: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; DM5PR07MB3467; 23:iBwM5cFm5kb7whycvjh/Emk858zykispUgChrw9cE?= =?us-ascii?Q?GOP3V1/6cIgeVWa3mzuA2Sdb2jFaoow1+wd0X0UXw5fS0aI1GOVzkLO9boNj?= =?us-ascii?Q?scBtI+l29nStVGra08bxh1rGdTKjdZ+IANraZqNipttbUOXYhzcMy5a1kdvr?= =?us-ascii?Q?0FmkiQRshoxzGlFehnI4mGlVtSTmXS1uadSwQ3pw5Yvj84r/C4K10/aDUAEa?= =?us-ascii?Q?unNqZFvhIlVS2B6ZLGMr5mWVBVxWA27cKQ2f8TuiMuBKHvoshHcwuRB4K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adata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Dec 2017 21:45:11.6448 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 136fdce2-6882-48ee-0677-08d546609fab X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR07MB3467 Subject: [dpdk-dev] [PATCH v2 07/12] app/eventdev: launch pipeline lcores 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: Mon, 18 Dec 2017 21:45:17 -0000 The event master lcore's test termination and the logic to print the mpps are common for the queue and all types queue test. Move them as the common function. Signed-off-by: Pavan Nikhilesh --- app/test-eventdev/test_pipeline_common.c | 64 ++++++++++++++++++++++++++++++++ app/test-eventdev/test_pipeline_common.h | 2 + 2 files changed, 66 insertions(+) diff --git a/app/test-eventdev/test_pipeline_common.c b/app/test-eventdev/test_pipeline_common.c index df7521453..9a70943b6 100644 --- a/app/test-eventdev/test_pipeline_common.c +++ b/app/test-eventdev/test_pipeline_common.c @@ -65,6 +65,70 @@ pipeline_opt_dump(struct evt_options *opt, uint8_t nb_queues) evt_dump_producer_type(opt); } +static inline uint64_t +processed_pkts(struct test_pipeline *t) +{ + uint8_t i; + uint64_t total = 0; + + rte_smp_rmb(); + for (i = 0; i < t->nb_workers; i++) + total += t->worker[i].processed_pkts; + + return total; +} + +int +pipeline_launch_lcores(struct evt_test *test, struct evt_options *opt, + int (*worker)(void *)) +{ + int ret, lcore_id; + struct test_pipeline *t = evt_test_priv(test); + + int port_idx = 0; + /* launch workers */ + RTE_LCORE_FOREACH_SLAVE(lcore_id) { + if (!(opt->wlcores[lcore_id])) + continue; + + ret = rte_eal_remote_launch(worker, + &t->worker[port_idx], lcore_id); + if (ret) { + evt_err("failed to launch worker %d", lcore_id); + return ret; + } + port_idx++; + } + + uint64_t perf_cycles = rte_get_timer_cycles(); + const uint64_t perf_sample = rte_get_timer_hz(); + + static float total_mpps; + static uint64_t samples; + + uint64_t prev_pkts = 0; + + while (t->done == false) { + const uint64_t new_cycles = rte_get_timer_cycles(); + + if ((new_cycles - perf_cycles) > perf_sample) { + const uint64_t curr_pkts = processed_pkts(t); + + float mpps = (float)(curr_pkts - prev_pkts)/1000000; + + prev_pkts = curr_pkts; + perf_cycles = new_cycles; + total_mpps += mpps; + ++samples; + printf(CLGRN"\r%.3f mpps avg %.3f mpps"CLNRM, + mpps, total_mpps/samples); + fflush(stdout); + } + } + printf("\n"); + return 0; +} + int pipeline_opt_check(struct evt_options *opt, uint64_t nb_queues) { diff --git a/app/test-eventdev/test_pipeline_common.h b/app/test-eventdev/test_pipeline_common.h index 412c6095e..26d265a3d 100644 --- a/app/test-eventdev/test_pipeline_common.h +++ b/app/test-eventdev/test_pipeline_common.h @@ -87,6 +87,8 @@ int pipeline_event_rx_adapter_setup(struct evt_options *opt, uint8_t stride, int pipeline_mempool_setup(struct evt_test *test, struct evt_options *opt); int pipeline_event_port_setup(struct evt_test *test, struct evt_options *opt, uint16_t nb_queues, const struct rte_event_port_conf p_conf); +int pipeline_launch_lcores(struct evt_test *test, struct evt_options *opt, + int (*worker)(void *)); void pipeline_opt_dump(struct evt_options *opt, uint8_t nb_queues); void pipeline_test_destroy(struct evt_test *test, struct evt_options *opt); void pipeline_eventdev_destroy(struct evt_test *test, struct evt_options *opt); -- 2.14.1