From patchwork Thu Dec 17 16:31:25 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 58607 Delivered-To: patch@linaro.org Received: by 10.112.89.199 with SMTP id bq7csp474949lbb; Thu, 17 Dec 2015 08:34:08 -0800 (PST) X-Received: by 10.140.235.212 with SMTP id g203mr65323347qhc.11.1450370047890; Thu, 17 Dec 2015 08:34:07 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id a80si6184691qge.39.2015.12.17.08.34.07; Thu, 17 Dec 2015 08:34:07 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dkim=neutral (body hash did not verify) header.i=@linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 6D81D61105; Thu, 17 Dec 2015 16:34:07 +0000 (UTC) Authentication-Results: lists.linaro.org; dkim=fail reason="verification failed; unprotected key" header.d=linaro.org header.i=@linaro.org header.b=KRYNZbfC; dkim-adsp=none (unprotected policy); dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 5CF056166C; Thu, 17 Dec 2015 16:31:53 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 9E87D61661; Thu, 17 Dec 2015 16:31:47 +0000 (UTC) Received: from mail-lf0-f48.google.com (mail-lf0-f48.google.com [209.85.215.48]) by lists.linaro.org (Postfix) with ESMTPS id DBAD361624 for ; Thu, 17 Dec 2015 16:31:40 +0000 (UTC) Received: by mail-lf0-f48.google.com with SMTP id l133so55202680lfd.2 for ; Thu, 17 Dec 2015 08:31:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=q2WLbGK7d4k3BRcJLZY4gMO87Ex8SBYcTZDBqVjt1Og=; b=KRYNZbfCdLMO4G7XG30CeZGIYgLPEUpCQZMz3k9DGwFXUHpzqx91HB/fCgMW29DHQZ ZlE48c7U5kxt6YHmn54PWXdseysIALgPJ8g87gi4PnKnUhAVAWTTnG1MQe8Irrpt32nQ xulEdAcvjIiYq/CmTrE1rocYlGQ8vnwHLgsIM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=q2WLbGK7d4k3BRcJLZY4gMO87Ex8SBYcTZDBqVjt1Og=; b=UiTGObcYl5O1lJGYTdVGFAgEZt/x7sB37LPJPI4G+dGMmudOYhvnsux9xOsAu8GHOG catFMfebB0lXE0UVfDsPentiqd9tESHzeFlb96g9iHQ56Exb60SzYeB/UxCfIDrhI/ls P1nVzdo4q7curq1gxnXxFo2+/9mO9NXjwAy3uPKhQm/nj4eBh6gFs6fzz4+Q0/I4dUyR mcNzu+rxRnQZvSJ/VFGXUS5vDW64g4doPMilo26GXEgN5d3sHIMaIIPTr5Ch0VHskLZa dmOL3DBd6qlOnXIc5Px/qkG4iERpn6TjJCVbktrqJYwSdhy7d9TGMZQGtyB2BCdmckRW IBJA== X-Gm-Message-State: ALoCoQk92tgxOUwhg92RGEiSvoMI8+HG19lLw3X6LnhRAM1dA++zJZwV4GP83ppOzzl2CtdomQGBtDZ52rFd8fftLh5ZPYF1Tw== X-Received: by 10.25.211.209 with SMTP id k200mr22030206lfg.125.1450369899564; Thu, 17 Dec 2015 08:31:39 -0800 (PST) Received: from localhost.localdomain ([195.238.92.128]) by smtp.gmail.com with ESMTPSA id u12sm2030563lbk.45.2015.12.17.08.31.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 17 Dec 2015 08:31:38 -0800 (PST) From: Ivan Khoronzhuk To: lng-odp@lists.linaro.org Date: Thu, 17 Dec 2015 18:31:25 +0200 Message-Id: <1450369889-4310-3-git-send-email-ivan.khoronzhuk@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1450369889-4310-1-git-send-email-ivan.khoronzhuk@linaro.org> References: <1450369889-4310-1-git-send-email-ivan.khoronzhuk@linaro.org> X-Topics: patch Subject: [lng-odp] [API-NEXT PATCH v4 2/6] performance: pktio_perf: use odp_time_wait_ns() function instead of looping X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" Now odp_time_wait_ns() can be used instead of own implementation. Signed-off-by: Ivan Khoronzhuk --- test/performance/odp_pktio_perf.c | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/test/performance/odp_pktio_perf.c b/test/performance/odp_pktio_perf.c index 9661c01..4cc1aff 100644 --- a/test/performance/odp_pktio_perf.c +++ b/test/performance/odp_pktio_perf.c @@ -591,20 +591,6 @@ static int setup_txrx_masks(odp_cpumask_t *thd_mask_tx, } /* - * Busy loop for specified length of time. - */ -static void busy_loop_ns(uint64_t wait_ns) -{ - odp_time_t wait = odp_time_local_from_ns(wait_ns); - odp_time_t cur = odp_time_local(); - odp_time_t end_time = odp_time_sum(cur, wait); - - do { - cur = odp_time_local(); - } while (odp_time_cmp(end_time, cur) > 0); -} - -/* * Run a single instance of the throughput test. When attempting to determine * the maximum packet rate this will be invoked multiple times with the only * difference between runs being the target PPS rate. @@ -647,7 +633,7 @@ static int run_test_single(odp_cpumask_t *thd_mask_tx, num_tx_workers); /* delay to allow transmitted packets to reach the receivers */ - busy_loop_ns(SHUTDOWN_DELAY_NS); + odp_time_wait_ns(SHUTDOWN_DELAY_NS); /* indicate to the receivers to exit */ odp_atomic_store_u32(&shutdown, 1);