From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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(); -- 2.17.1