From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0046.outbound.protection.outlook.com [104.47.41.46]) by dpdk.org (Postfix) with ESMTP id A49F21B33C for ; Tue, 16 Jan 2018 18:48:03 +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=ZoBkJRm5MCc7uS9w4a2AoVc/OuNEXuotK/cldub70SE=; b=JSniX0CrC382ONWsdHurbv6LsuzF/264o7RcY9A3+wYngdBtsnapfdE0dze2/N8Wy4+8KGGOy0kLRFkUN4LeZZiz9vZUL01Z3lwzX9nrC8FtU6CqSI4JGgSTG63u3RslWqFlYwX/u4pvzoGL7q4rEFNBpHbnamU91+jHkbRPBsM= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; Received: from localhost.localdomain (111.93.218.67) by CY4PR07MB3464.namprd07.prod.outlook.com (10.171.252.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.407.7; Tue, 16 Jan 2018 17:47:54 +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: Tue, 16 Jan 2018 23:16:00 +0530 Message-Id: <20180116174607.10821-8-pbhagavatula@caviumnetworks.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180116174607.10821-1-pbhagavatula@caviumnetworks.com> References: <20171130072406.15605-1-pbhagavatula@caviumnetworks.com> <20180116174607.10821-1-pbhagavatula@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: HK2PR02CA0158.apcprd02.prod.outlook.com (10.171.30.18) To CY4PR07MB3464.namprd07.prod.outlook.com (10.171.252.145) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b92ad045-b0e4-4f53-db9e-08d55d0947ef X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:CY4PR07MB3464; X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3464; 3:ND93p8uZYaG7BAKqDYiGohrUTYzXcUwwbjBy4mE33hY95n55D9hxYe3EwDZ0Th7HKrUq7WmYdLDrelb/Y7yho2wvxZHJijojPxrS2LmaEIGij4aaKB4F6dO2MQGoMKITPubsbA0kfyrEuvnfeiXmIq+tdCp/+yqStRJTxXb132usn1nnteBk/84M2Rx/pO/MImrNFg/yBVdEH/F0PfeW0Yx4G4PE6hgmT1wdIqvuzkL1EtIhCkCc21XqWDm+EpKO; 25:5ogK/2EKybXnL4/yJSjCwQuxaLw/lvjPpt0IizZkGqeH81Yv4mHsTEAQ+E9wlmLxR8LII1tkRGJlGCGYQ6mwrxSq7Tb0w4Ox+skHTqflEKdhX8IpJHBWV0jkDwMMuK77xCjjXRcgDRjgv7svO5w3THSweYGy9rkrTSyhJB7rvq7ZbFAVa8yw7V7EidLwqaH/LLeyZKZfxhCtA8RD1OjCKkelqLp+BChdNnckoIJLafQZC5dVIZA9K8H45nFikhi8Wip4Omelo/T0nPXey+hVntMbGcrnGbPRGMs7SFwJZMGyrIzO44pfDO7KsDtNZ5wBDv1Y8tXZdXuaZbijVBRuLA==; 31:qpn9XQQ8HRvxR/QqHz+F58mzwFtiRTOyHEylVYjkGS49vTnNFTVKdSTRfjGjtBLnO1ETT2gn4rA6w0oAdnP2dZTsIaZI6BMusuRGceHxuhBZbpmahmul1SR13f1B541Cn4MYruc/7Q4Sj6O4LOe1lgobFlez68fkzP2iBx7BIl5LGF5aIRPVh6aEN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hlN X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(5005006)(8121501046)(3231023)(944501161)(93006095)(3002001)(10201501046)(6041268)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123560045)(20161123562045)(20161123558120)(6072148)(201708071742011); SRVR:CY4PR07MB3464; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:CY4PR07MB3464; X-Forefront-PRVS: 0554B1F54F X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(346002)(366004)(39860400002)(376002)(39380400002)(396003)(189003)(199004)(81166006)(97736004)(8676002)(6116002)(5009440100003)(52116002)(305945005)(8936002)(107886003)(1076002)(51416003)(81156014)(25786009)(8656006)(4326008)(50466002)(6486002)(5660300001)(3846002)(7736002)(50226002)(16526018)(68736007)(106356001)(26005)(76176011)(53936002)(6512007)(59450400001)(47776003)(48376002)(16586007)(386003)(6506007)(66066001)(72206003)(2950100002)(36756003)(2906002)(105586002)(478600001)(316002)(6666003)(42882006)(42262002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR07MB3464; 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; CY4PR07MB3464; 23:7rIrV812R2vpXvMOa1yf9Bsx4CK2HoKX1vY1ZqMgM?= =?us-ascii?Q?mRHhbOAyQRkCvDP95ml0aIRJDmLET7a4/ssNt9YGLW5drB8NJKb0FllygILf?= =?us-ascii?Q?enbajbi/73w9qFfbMDunKJver69UWpi+4FLKChO/kGeBJRAuNvOGXPsdO4/X?= =?us-ascii?Q?w4CBS0rNE0CYW2kS9P8bNXhvMMierR4mFqPZPmP22lg0wbJ14DS3dGPWQbVg?= =?us-ascii?Q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fWG4GXiYvdCEempSj6L0TjQ5rHACiNLXXYtA0Y7XKPo3mzvd3sXzvEb4JJuDGcxMK54mjl0tRaNLcvI1hcpl SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jan 2018 17:47:54.6408 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b92ad045-b0e4-4f53-db9e-08d55d0947ef X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR07MB3464 Subject: [dpdk-dev] [PATCH v7 08/15] 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: Tue, 16 Jan 2018 17:48:04 -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 Acked-by: Harry van Haaren --- app/test-eventdev/test_pipeline_common.c | 67 ++++++++++++++++++++++++++++++++ app/test-eventdev/test_pipeline_common.h | 2 + 2 files changed, 69 insertions(+) diff --git a/app/test-eventdev/test_pipeline_common.c b/app/test-eventdev/test_pipeline_common.c index 98df423ae..6cad9357b 100644 --- a/app/test-eventdev/test_pipeline_common.c +++ b/app/test-eventdev/test_pipeline_common.c @@ -90,6 +90,73 @@ 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(); + if (t->mt_unsafe) + total = t->tx_service.processed_pkts; + else + 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 acbf688fb..db2517baf 100644 --- a/app/test-eventdev/test_pipeline_common.h +++ b/app/test-eventdev/test_pipeline_common.h @@ -76,6 +76,8 @@ 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, uint8_t *queue_arr, uint8_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