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 5D002A0524; Mon, 27 Jul 2020 12:22:07 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D06951BFE2; Mon, 27 Jul 2020 12:22:05 +0200 (CEST) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by dpdk.org (Postfix) with ESMTP id E643D3B5; Mon, 27 Jul 2020 12:22:04 +0200 (CEST) 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 4680030E; Mon, 27 Jul 2020 03:22:04 -0700 (PDT) Received: from net-arm-thunderx2-02.shanghai.arm.com (net-arm-thunderx2-02.shanghai.arm.com [10.169.210.119]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 67DAF3F718; Mon, 27 Jul 2020 03:22:02 -0700 (PDT) From: Ruifeng Wang To: Cc: dev@dpdk.org, honnappa.nagarahalli@arm.com, nd@arm.com, Ruifeng Wang , stable@dpdk.org Date: Mon, 27 Jul 2020 18:21:50 +0800 Message-Id: <20200727102151.192516-1-ruifeng.wang@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200424074356.193204-1-ruifeng.wang@arm.com> References: <20200424074356.193204-1-ruifeng.wang@arm.com> Subject: [dpdk-dev] [PATCH v2] test/cycles: restore original delay function 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" test_delay_us_sleep registers sleep based delay for testing. This changes the default delay function of testing environment. It is not expected. Restore default delay function after the test to fix the issue. Fixes: a51639cc720a ("eal: add nanosleep based delay function") Cc: stable@dpdk.org Signed-off-by: Ruifeng Wang Reviewed-by: Gavin Hu --- v2: Dropped other patches in the series that are not needed. app/test/test_cycles.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/test/test_cycles.c b/app/test/test_cycles.c index c78e6a5b1..015a9290f 100644 --- a/app/test/test_cycles.c +++ b/app/test/test_cycles.c @@ -79,8 +79,14 @@ REGISTER_TEST_COMMAND(cycles_autotest, test_cycles); static int test_delay_us_sleep(void) { + int rv = 0; + rte_delay_us_callback_register(rte_delay_us_sleep); - return check_wait_one_second(); + rv = check_wait_one_second(); + /* restore original delay function */ + rte_delay_us_callback_register(rte_delay_us_block); + + return rv; } REGISTER_TEST_COMMAND(delay_us_sleep_autotest, test_delay_us_sleep); -- 2.17.1