From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0082.outbound.protection.outlook.com [104.47.37.82]) by dpdk.org (Postfix) with ESMTP id 5B9891B2EC for ; Tue, 16 Jan 2018 16:40:58 +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=mORRS+/3jdWMdnUtIAOy6IXIQCv6SwFbQoFIHv1iBCXhb7PzrsTxqu+/V6Q3G/s8IW8OjtbucbXBvLifvRVgCqJQNwJVV4MYs4CWsieqwCAkBBKXtcjrRna6TasHwOyhOySTcvX/8JuKHvjLyJqia087oAz7pR3SRh0OEH5XOPs= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; Received: from Pavan-LT.caveonetworks.com (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 15:40: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 21:09:57 +0530 Message-Id: <20180116154003.3762-8-pbhagavatula@caviumnetworks.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180116154003.3762-1-pbhagavatula@caviumnetworks.com> References: <20171130072406.15605-1-pbhagavatula@caviumnetworks.com> <20180116154003.3762-1-pbhagavatula@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: MWHPR02CA0016.namprd02.prod.outlook.com (10.168.209.154) To CY4PR07MB3464.namprd07.prod.outlook.com (10.171.252.145) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1d3cfc90-d987-4665-92dc-08d55cf78929 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:E219khZ0UB1lgN7Uv/AWBu7CJP9jBgXPHVTKvMP14q0maXXhPtr6xv5ERRGWw/WMDhP5cX1syuEPC5L4+ABxbrwXoGYTXJY2wmOoanhRfT31GCVZXIfBNTszDEnSbIrO9B/FVWZoabWR5Y9vKFJgNDDF+mGVOD2y/xLdGgNJDg+VsF5d/8R2EjC/7ORd69XevL8sozd6JYHnsqUvBwYv/3Zt+YaS6gF+UUE2VD4/ZOIovTuVoJq9aWru0lp0Z62a; 25:ktn05grBN/A2uJu513jIdPYlddAMKE62fNJWXx5fwBxeCgyTFf4x5bAjxCrol9ZGbDzcosnS7HkSLzO0EllMc91NczVBjVs9vTR2nXnLB9IYHbePqkrrkVzdqxrO9RMWcrAg19smxNKO47XmdS1wpS6NBo8hgtOADDTD/jb75hllndnVUFRgG55xmXP26KL6ArrSvgiOY11a+F5TXQJyL2jqQKkVRgIYorN4DlPSIbGKmAPs1WEbvzjX+vOKPOJBOQDLW5yotG7MH/Dxc+mfk4tcCHzj5UvkhSPzftCidjq4SnNLZ/hpomRe+qKbbRhcawqqzizasr+PV6ukgNv9XA==; 31:Z3FGIEUPBlEtZR1zpAUeoNFNMBbP88WntUkm7oHFw6F6W1u5OYFA/90hH5m8gWRtNSdgYtyqFxVygt3S4KXhqtiJU75UlCw8P+pas3ocjJHWt9mfNp/pr0RA75fkljkbg5vOOYIanI2CqmRI2fXnjDMSZn1/nu1YT9ANLXd4ILCxSEx+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ft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(5005006)(8121501046)(93006095)(3231023)(944501161)(10201501046)(3002001)(6041268)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(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)(39860400002)(366004)(346002)(39380400002)(396003)(376002)(189003)(199004)(81166006)(97736004)(8676002)(6116002)(5009440100003)(52116002)(305945005)(8936002)(107886003)(1076002)(51416003)(81156014)(25786009)(8656006)(4326008)(50466002)(50226002)(6486002)(5660300001)(3846002)(7736002)(16526018)(68736007)(69596002)(42882006)(106356001)(26005)(76176011)(53936002)(6512007)(59450400001)(47776003)(48376002)(16586007)(386003)(6506007)(66066001)(72206003)(2950100002)(36756003)(2906002)(478600001)(105586002)(316002)(53416004)(42262002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR07MB3464; H:Pavan-LT.caveonetworks.com; 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:iEtraO43jyMhON7sigLGhxC4AEk+HJ5aSnraL3NSq?= =?us-ascii?Q?W/X0sNRevvMRVURczQxKchY2G1rUCmrJOqYsK37yOu/uOnZa4pBVdPJs+fyn?= =?us-ascii?Q?WnruJd4zNVNJiEqpqJO4T+Lk3FbH+xB7ISd+WuzSqJFJteBSPPsUk+p9fSmQ?= =?us-ascii?Q?Dxnv/8jE72eCLPpLu4P2TD7Lb1sYi+nNJ+qKKzXSFE6zw6WJHaXetaal9CWL?= =?us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dMk4FwbrB/zCYiqt5Dqnr4N/BQ8X3CjBcoTIhsufm14gKCNH2H1ZuHvKIc5pbXHgcDp+L SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jan 2018 15:40:54.4423 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1d3cfc90-d987-4665-92dc-08d55cf78929 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 v6 08/14] 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 15:40:58 -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