From patchwork Tue Dec 22 06:30:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Feifei Wang X-Patchwork-Id: 85641 X-Patchwork-Delegate: david.marchand@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 43DCDA052A; Tue, 22 Dec 2020 07:31:27 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 69CFDCAAF; Tue, 22 Dec 2020 07:31:10 +0100 (CET) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by dpdk.org (Postfix) with ESMTP id 77B1FCA97 for ; Tue, 22 Dec 2020 07:31:07 +0100 (CET) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id DEC871042; Mon, 21 Dec 2020 22:31:06 -0800 (PST) Received: from net-x86-dell-8268.shanghai.arm.com (net-x86-dell-8268.shanghai.arm.com [10.169.210.131]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 7A45A3F66E; Mon, 21 Dec 2020 22:31:04 -0800 (PST) From: Feifei Wang To: Honnappa Nagarahalli , Konstantin Ananyev Cc: dev@dpdk.org, nd@arm.com, Honnappa.Nagarahalli@arm.com, ruifeng.wang@arm.com, Feifei Wang Date: Tue, 22 Dec 2020 14:30:53 +0800 Message-Id: <20201222063054.44429-2-feifei.wang2@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201222063054.44429-1-feifei.wang2@arm.com> References: <20201222063054.44429-1-feifei.wang2@arm.com> Subject: [dpdk-dev] [PATCH v1 1/2] app/test: remove unnecessary barriers for ring stress test 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The variable "wrk_cmd" is a signal to control threads from running and stopping. When worker lcores load "wrk_cmd == WRK_CMD_RUN", they start running and when worker lcores load "wrk_cmd == WRK_CMD_STOP", they stop. For the wmb in test_mt1, no storing operations must keep the order after storing "wrk_cmd". Thus the wmb is unnecessary. For the rmb in test_worker, the parameters have been prepared when worker lcores call "test_worker". It is unnessary to wait wrk_cmd to be loaded, then the parameters can be loaded, So the rmb can be removed. In the meanwhile, fix a typo. The note above storing "stop" into "wrk_cmd" should be "stop test" rather than "start test". Signed-off-by: Feifei Wang Reviewed-by: Honnappa Nagarahalli Reviewed-by: Ruifeng Wang --- app/test/test_ring_stress_impl.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/app/test/test_ring_stress_impl.h b/app/test/test_ring_stress_impl.h index f9ca63b90..384555ef9 100644 --- a/app/test/test_ring_stress_impl.h +++ b/app/test/test_ring_stress_impl.h @@ -198,7 +198,6 @@ test_worker(void *arg, const char *fname, int32_t prcs) fill_ring_elm(&loc_elm, lc); while (wrk_cmd != WRK_CMD_RUN) { - rte_smp_rmb(); rte_pause(); } @@ -357,13 +356,11 @@ test_mt1(int (*test)(void *)) /* signal worker to start test */ wrk_cmd = WRK_CMD_RUN; - rte_smp_wmb(); usleep(run_time * US_PER_S); - /* signal worker to start test */ + /* signal worker to stop test */ wrk_cmd = WRK_CMD_STOP; - rte_smp_wmb(); /* wait for workers and collect stats. */ mc = rte_lcore_id(); From patchwork Tue Dec 22 06:30:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Feifei Wang X-Patchwork-Id: 85642 X-Patchwork-Delegate: david.marchand@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id EFBD5A052A; Tue, 22 Dec 2020 07:31:43 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 86BBFCAC7; Tue, 22 Dec 2020 07:31:13 +0100 (CET) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by dpdk.org (Postfix) with ESMTP id EC886CAC5; Tue, 22 Dec 2020 07:31:11 +0100 (CET) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 6DF551FB; Mon, 21 Dec 2020 22:31:10 -0800 (PST) Received: from net-x86-dell-8268.shanghai.arm.com (net-x86-dell-8268.shanghai.arm.com [10.169.210.131]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 7A5A43F66E; Mon, 21 Dec 2020 22:31:07 -0800 (PST) From: Feifei Wang To: Jerin Jacob , Sunil Kumar Kori , David Marchand Cc: dev@dpdk.org, nd@arm.com, Honnappa.Nagarahalli@arm.com, ruifeng.wang@arm.com, Feifei Wang , stable@dpdk.org Date: Tue, 22 Dec 2020 14:30:54 +0800 Message-Id: <20201222063054.44429-3-feifei.wang2@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201222063054.44429-1-feifei.wang2@arm.com> References: <20201222063054.44429-1-feifei.wang2@arm.com> Subject: [dpdk-dev] [PATCH v1 2/2] app/test: collect perf data after worker threads exit 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The measure_perf function should be excuted after worker threads exit to collect correct perf data. Otherwise, while workers are running, the main thread may get incomplete data from workers. In the meanwhile, remove unnecessary barrier in the test. For signal variables "ldata.done" and "ldata.start", no operations should keep the order that being executed after them. So the wmb after them can be moved. Fixes: 16a277a24c9f ("test/trace: add performance test cases") Cc: jerinj@marvell.com Cc: stable@dpdk.org Suggested-by: Honnappa Nagarahalli Signed-off-by: Feifei Wang Reviewed-by: Honnappa Nagarahalli Reviewed-by: Ruifeng Wang --- app/test/test_trace_perf.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/test/test_trace_perf.c b/app/test/test_trace_perf.c index e1ad8e6f5..46ae7d807 100644 --- a/app/test/test_trace_perf.c +++ b/app/test/test_trace_perf.c @@ -79,7 +79,6 @@ signal_workers_to_finish(struct test_data *data) for (workers = 0; workers < data->nb_workers; workers++) { data->ldata[workers].done = 1; - rte_smp_wmb(); } } @@ -102,7 +101,6 @@ worker_fn_##func(void *arg) \ { \ struct lcore_data *ldata = arg; \ ldata->started = 1; \ - rte_smp_wmb(); \ __worker_##func(ldata); \ return 0; \ } @@ -137,11 +135,12 @@ run_test(const char *str, lcore_function_t f, struct test_data *data, size_t sz) wait_till_workers_are_ready(data); rte_delay_ms(100); /* Wait for some time to accumulate the stats */ - measure_perf(str, data); signal_workers_to_finish(data); RTE_LCORE_FOREACH_WORKER(id) rte_eal_wait_lcore(id); + + measure_perf(str, data); } static int