From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0058.outbound.protection.outlook.com [104.47.41.58]) by dpdk.org (Postfix) with ESMTP id 5D5AA1B2C7 for ; Tue, 16 Jan 2018 16:18:39 +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=JtvoTRaSIhSBFp2QCYctwW00d35MUx4NagDJEi1di+Y=; b=osviT+zb4NLEztX9e3AIRhcoSUNxGUt8XpmhMlBZbhpgz1F5Hdpjl2x7rXllS0gImHBXM8eglTApMxwL54veGp909igmehEbQq5ApMEy71QYOOsIUgwnzFoPAaF+p4vyp4gE5rBT1kUOi16CH9kd7NgyUYsHrFHhiu0NW6/jbyE= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; Received: from Pavan-LT.caveonetworks.com (111.93.218.67) by MWHPR07MB3469.namprd07.prod.outlook.com (10.164.192.20) 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:18:35 +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 20:47:23 +0530 Message-Id: <20180116151728.566-8-pbhagavatula@caviumnetworks.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180116151728.566-1-pbhagavatula@caviumnetworks.com> References: <20171130072406.15605-1-pbhagavatula@caviumnetworks.com> <20180116151728.566-1-pbhagavatula@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: MWHPR21CA0059.namprd21.prod.outlook.com (10.172.93.149) To MWHPR07MB3469.namprd07.prod.outlook.com (10.164.192.20) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8ec65bc6-f133-4f49-8a89-08d55cf46aea X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:MWHPR07MB3469; X-Microsoft-Exchange-Diagnostics: 1; MWHPR07MB3469; 3:58ZxqB5LS5bvusoMSKTOasmJU6zBIRY2w4JxmFRN/NLxIW+tatqYIAH3jW2wupw/Atxf36YxZbiyNmAwnGT2/jfES/RQ1rhx9acqPuqImQhbnSvX4PsxlPjXiIa5Kkcyq5PpBvLekylLk4MyDvdVQWcM/9hbEcb1HEbvnbihWiFZGq7ELzEnYsPel7arp/8ObY8SzN3bdOrosFqzuxI60cnoh/4yjMEJQpdNw+9UwB/nH/GKT0ZBJf0wfmBRTuTR; 25:4ComYgVXc/RhbTNt3LWVp7VG/D/Sfc5nrJCNXt0tePhG/El7BmQmJHq8Et7KrseDI9iWa+dHQOIXraaSY1Lkl8I3Zjicae4atmaLg/5FR1pMKjYRnLf28lqsFgZ1cQLeOkcxr0BlV8oBYeaVnmcIGAnLT+5XMyxZbqeNeoXQYTP9aEv42/YPXQKIWiwCY42WfyWuu2m8ITTbWeIbY/QWwWIXhTaZF67Uvf3m/0x0WWAO+HWphFyCnpKddgoJ30oUiLkDBzGc/e+vfI9xd6eqSxjqXELH+R8JDapaPPHWzeoxC47nczvFHOIYeQoDiJTT0QbGP4btTV6UaYE894thdg==; 31:kqR7xXrZDf/tW4eypnlZ+r3s/nyPuWKRKZ3YfnIxTrDon7YtgkEt0214AGvUFneU8iXpV5dSxe7JRRyVBlveZF4dmsTKuzDazJ+MrYB3YF2YpbLpayh1pg51ezEo5k5RGxLg2T5Q/3nrgwNNAAW2ipiuCv4zs6U+1HrnE11EDSWiMX62hiH1TqRQK7Nn0sK6x9LbOmGBH2oqiOOK+VvQz6Eo+O1xV455EXQ4dK6TctU= X-MS-TrafficTypeDiagnostic: MWHPR07MB3469: X-Microsoft-Exchange-Diagnostics: 1; MWHPR07MB3469; 20:sWlcdoNf8Z5Z4ipkluZIxKrWwJn37RZXgiCq4ZeA7J/NXOsfOCtP5kE25XlS1AD59mYDWYcxvIvVyP9t3Qv+ZXYp23N2VOziUR1QSwlHsu9iCzBfHo5qbP0I5CTpVF2JY40e/VzjI5DYB7+TpdEy+u6iEpc9qLzfTD2D8+MSBYWPKEagY4sUZ9f2+I3EbqaBcZgu4se/JK5sBsR6hkej94NtWvaOG5LpqdEAP8jtdp3mJtemc5xrtEBXIRBfI6FApYM3y2cxjuY+rh5gFqFmNjWxr1vjtpTNIVQ3bm1te/HoiufC2XHbSJCHB8HJtHNHkdkcTpv2NeOUvSEsdYoZFzPOo9/96VlUrstJgIQxyFchzY32m2EKAXe9EQrrjyERaAV45ydgHW7+dU1yObIiPdhverj1+D4nST3RBozGQnRQP01F79c8h7/9x5kLSw3QOOw5RLPix8XcxR5I+gvpNt99QthE1yCjtQaHF4v3zysllD/pnU6S/BorlkNm42F2+dGR7gqMZMeXTQstY7eN3pHYEbrdym6AeoUA3XQmtceOgE5YmCi+fPUtiqoDcvYahqwcQ6wQkZLWmSp1mMsgcpO6dTf5xUCoMZCI0BthtzQ=; 4:G1Pc+kEHMvtHAbHh+ENE4y5k7WBzWs5Z6beVODVhC6Or0d5jfTwV0GkAxOnu0R08ASY5lwqxeBZkcRnqvkHWa30DXOQlvzD6eAooqYYHjxVlK5TjU4TupyTlD/2tpk4pYUKMogP78HgtD+mNgjqKTFYsINjxFEFIz2GtHCT95GVQtyQf6+xGZF1pfmMl2aQpguB29fqn4GfEXYprqhzDgPAoKd8M25tLv/m3ihpcT6afkteuaEKWPnd/uGBpHsbTYBwN6i5EIoaHf/kJlEpokQ== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(8121501046)(5005006)(3002001)(3231023)(944501161)(93006095)(10201501046)(6041268)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123564045)(20161123560045)(20161123558120)(6072148)(201708071742011); SRVR:MWHPR07MB3469; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:MWHPR07MB3469; X-Forefront-PRVS: 0554B1F54F X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(366004)(396003)(346002)(376002)(39380400002)(39860400002)(199004)(189003)(2950100002)(4326008)(42882006)(5009440100003)(6666003)(107886003)(25786009)(68736007)(16526018)(72206003)(478600001)(316002)(5660300001)(16586007)(26005)(50226002)(53936002)(7736002)(305945005)(36756003)(53416004)(6116002)(81166006)(8656006)(69596002)(8676002)(6512007)(81156014)(8936002)(97736004)(386003)(6506007)(50466002)(66066001)(76176011)(59450400001)(52116002)(51416003)(2906002)(47776003)(48376002)(106356001)(3846002)(1076002)(105586002)(6486002)(42262002); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR07MB3469; 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; MWHPR07MB3469; 23:u4mkbAz5nNUy1/D7wfmuMs66vTbEj43SjMdAioiw0?= =?us-ascii?Q?XCfbfVnUNy8UCsZltzRLHRV7sdrGBnV9gPfB1BNxJjx9NTCMoAmRR4uR3yXl?= =?us-ascii?Q?wRn0qpc3S5gtl9RbjSE3ShJbvHiiQK1UDEHX+5WmYyKk161EO34NdyMcdqH2?= =?us-ascii?Q?3LSYwGui5BOkeZsFIXEqOazkbjZXtcKo2clTeCQQ5Jj+0YC/bG5xI5AIcFXO?= =?us-ascii?Q?FHoASf6aZW3qlrjHpYemwoI2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NGdT8UZsWIyWKvHUzVe+iX/GszZVwYa2LqOvqFFa+UwOCrDijVg2S3ieV9XNwAuUvs54 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jan 2018 15:18:35.2385 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8ec65bc6-f133-4f49-8a89-08d55cf46aea X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR07MB3469 Subject: [dpdk-dev] [PATCH v5 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:18:40 -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 | 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