From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0088.outbound.protection.outlook.com [104.47.38.88]) by dpdk.org (Postfix) with ESMTP id 0E4AE1B26B for ; Wed, 10 Jan 2018 15:52:38 +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=lWcBDHCI69F57Eh+Wou8dLLWWfzYUvQw0qwQVh+WOTY=; b=XFhCMF1b5Dl8N8kxCnW8bfEGHWGAC3CZ3xlzxvFEA3URYK1dGCR2tMpLcoaKiD19JP5D9JhM9J368MQEsYVPNmjEfxS7X5V4fIKUUdpOrSn70Fvydp0XIuKyeiPVBxYKMSPNizlP9sp4z3NM/K9Phi5FmeGuxyEhM3lYfh6ZCgo= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; Received: from Pavan-LT.caveonetworks.com (111.93.218.67) by DM5PR07MB3466.namprd07.prod.outlook.com (10.164.153.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.386.5; Wed, 10 Jan 2018 14:52:33 +0000 From: Pavan Nikhilesh To: jerin.jacob@caviumnetworks.com, santosh.shukla@caviumnetworks.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: Wed, 10 Jan 2018 20:21:39 +0530 Message-Id: <20180110145144.28403-7-pbhagavatula@caviumnetworks.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180110145144.28403-1-pbhagavatula@caviumnetworks.com> References: <20171130072406.15605-1-pbhagavatula@caviumnetworks.com> <20180110145144.28403-1-pbhagavatula@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: BN6PR16CA0009.namprd16.prod.outlook.com (10.172.212.147) To DM5PR07MB3466.namprd07.prod.outlook.com (10.164.153.21) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: aa571ef3-09bf-4059-e2d5-08d55839ca48 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:DM5PR07MB3466; X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB3466; 3:m0azFOBHvPp/yG7+jG+gHA0Pt/j8WWBkFm1cqHUBmfqwEG5CIn1e88eKXHWRw0Lh7Txdo1WLnw36a2+9Dqm1UObzr5/n7u5peOamMGE8I87892zabrLGRbwP7XzTwHnIwlx5DoJ/ic2nhigBO/EbOZBlN/g722sfMROFK3PagAtXjcaei58/HLkb2z7p82FogjmOZjp1ut1lWvO4iLgQVVKCMMNOMeID+dQS5OUc0H9/FhCzNgpkYcgjgdqa/pVO; 25:whtEFbHjp7HrW8OL84kjxAn1igp0SRQwbIjucyWmcAg+fQbjs28wWDEW6512qRt5oOQv/N6/id5eSnoTbmdnPZYocBkFqLBMlQ4BrynB2xFvbYTPIC/msoDNSqPp49tiX9HnRaoAl82hk9zl+8fzmsQwBL/CON8hwiIIevIPWxWW8Elgat2J8wCkEr7IS7P25CjZW1HNPMim7aFEAdAMwB4SN6k9C5/uLDtoEeqi6OzrZ2ti8G55XvgQdUKmSEWhz4K66cU76EVntN4TCeL9F1E3GCakvgsizHejE5eDUFlz7w1y2f/E3rI1G4MhNleNOHNBqdXKz3IGkzc80Ipcnw==; 31:E9/d9RyR/APKyJ+AajTd7hVNJh/7WwuOv741Ekeuwg1hfvJJoIZiOL2BKvGWea4WzCy1TZELio1jM4xQ2zIrg2J48KaVORp0OJzPlqvVjEaKGGJT77Nhy0mK43k1UpFAmJOJjyyRatpt81v5UVbcXbrMjLmE7GkJ5q0KOrNNPTwgJCfvF+9o/y4xGrxE8ldeNJ1493dYGhba5yF6Tvn0dhEA1bwwoZgzYnHjZhMdT/s= X-MS-TrafficTypeDiagnostic: DM5PR07MB3466: X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB3466; 20:Z5CNg67JpdcGYRHIp9ZXYUF0ZvbwGIevFLfcTAtfYhpcJN5XsPR6k6N5em8+HpH118+/HZDM2A6xEohybtTkDWWxuQSvsgaC3GFarUSSsIxpgjcvMfBDKD9Rn7Pl0aUoFeEg11WNxx1kc2oKAycVBnUscCqShir6gIC8GkLBoIcullKilS7uBWeMLWC23UDAS9P7iOigHveeVFML9wvw78hi9UQcpgnVuBroy1Ze8CThOnivN6sBc6R0YcoRwdQHuW5+nFz8sSLw65fTCOe3QqwtSYSzncXGYPY2rn3OC3TAqfB329wucCo78ibKhrkLZXXdvCRoMRdfxVBfSobVJGaYOD4jVTIdmwXGYpFImMooovhYTGxWgdiT+Zd5CJN1cAVuG0162k134pF+2F45X2RW1cnxxczn3svdQnJnXumMGa0M7/uo1Tn5fBg7I9HjzpjvQWJRYf2K3FJ8RpeGOvhISrPmV+HyfOSkkEdPd85hsnO2vDvEppxa7v8MzEshOxltIeJakB4qrnms2c/breWTFuDcPvdHu1NjTL1otNU/VTZhU+Zw48TdTDd1Y6KFAtl7oi8zyDjrmuxClshNW78vkJg8uTuKOQp6ltDCQP0=; 4:+JFzCqCnVMn8Iz0rkEHrbkhj+JlsxdXa18Gu/iJG8WoYe8CwcxVWL/leIirkD1gpKuffnCEm02A9o457kTRXb8BTBYpL3tSoBFu9cQTbftxMj5KiRvnLzG9sXSQyrD93t/DO93UzbeFhETtDHalTqkgPSEvyWGq6usD4pHanT79ETgFp0KDbAp3doFme/00BwrKaFaJCY6TrCPtyMBIAOE0BnubUJpjK+OAlsgSUkS0Ygv/SneneQf/Ncy4FCvn/ZdoAWsmnPrLGdtpy7I+6BA== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(5005006)(8121501046)(10201501046)(3002001)(93006095)(3231023)(944501075)(6041268)(20161123560045)(20161123564045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(6072148)(201708071742011); SRVR:DM5PR07MB3466; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:DM5PR07MB3466; X-Forefront-PRVS: 0548586081 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39860400002)(346002)(366004)(376002)(396003)(39380400002)(199004)(189003)(76176011)(25786009)(107886003)(4326008)(2950100002)(106356001)(42882006)(8656006)(8676002)(59450400001)(105586002)(53936002)(6486002)(52116002)(53416004)(6512007)(50466002)(47776003)(5009440100003)(305945005)(68736007)(51416003)(386003)(6506007)(69596002)(36756003)(72206003)(2906002)(16586007)(50226002)(316002)(478600001)(7736002)(48376002)(3846002)(1076002)(6116002)(5660300001)(66066001)(16526018)(81166006)(97736004)(81156014)(8936002)(42262002); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR07MB3466; H:Pavan-LT.caveonetworks.com; 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; DM5PR07MB3466; 23:s7ssDujFS+X61RM9BCseOY739puAQ1mD2VL0qP2gN?= =?us-ascii?Q?YSuw1vtamc3Pewawxgf2hI42OsEhwwLsA9CSpiXvl0A/8l82edjOkzbfXZ4r?= =?us-ascii?Q?dMfcfdj9I6azSBGzJLjZABQIeVghR6+z4VIWOsJ2Fdqm/3FwWMRPoEWy67pd?= =?us-ascii?Q?okD3LV/oPmEEa5bKSJ6Ag3Snef8DyMbHdoZxXdHY07Yu7ZvnmxzCwMZTyrfL?= =?us-ascii?Q?puvK56jwwARZssmB0TuaNuIPvm5bDkiosQzx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vl6UPqxKRR5iTOW SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jan 2018 14:52:33.7478 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: aa571ef3-09bf-4059-e2d5-08d55839ca48 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR07MB3466 Subject: [dpdk-dev] [PATCH v3 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: Wed, 10 Jan 2018 14:52:39 -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 e212cb93d..c9463aea1 100644 --- a/app/test-eventdev/test_pipeline_common.c +++ b/app/test-eventdev/test_pipeline_common.c @@ -38,6 +38,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 985c9a008..481cb133b 100644 --- a/app/test-eventdev/test_pipeline_common.h +++ b/app/test-eventdev/test_pipeline_common.h @@ -60,6 +60,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.15.1