From patchwork Thu Dec 17 15:29:20 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 58595 Delivered-To: patch@linaro.org Received: by 10.112.89.199 with SMTP id bq7csp436596lbb; Thu, 17 Dec 2015 07:30:58 -0800 (PST) X-Received: by 10.55.221.210 with SMTP id u79mr65465962qku.59.1450366258864; Thu, 17 Dec 2015 07:30:58 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id k94si11777730qgk.25.2015.12.17.07.30.58; Thu, 17 Dec 2015 07:30:58 -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 452946165F; Thu, 17 Dec 2015 15:30:58 +0000 (UTC) Authentication-Results: lists.linaro.org; dkim=fail reason="verification failed; unprotected key" header.d=linaro.org header.i=@linaro.org header.b=fsvBl+ka; 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 DBBD461659; Thu, 17 Dec 2015 15:29:52 +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 3D57361623; Thu, 17 Dec 2015 15:29:37 +0000 (UTC) Received: from mail-lf0-f43.google.com (mail-lf0-f43.google.com [209.85.215.43]) by lists.linaro.org (Postfix) with ESMTPS id 0BBBA61623 for ; Thu, 17 Dec 2015 15:29:35 +0000 (UTC) Received: by mail-lf0-f43.google.com with SMTP id p203so54801225lfa.0 for ; Thu, 17 Dec 2015 07:29:34 -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=fsvBl+kaRuAWZXl/FWmTKMQfM9TdESkK6RXBdmDhQGd3/DnrHT+lWuGjfe/osouDWv 9kSqWp+LkUqtHc3guzX0cF/DGtC6cWDEQQ9oIZaTzHWINJ7VgNceF+vPDcqRCg6h3U7s YBtJnXdUFd+vJJCrls+S4Wppest5miRV8QpgM= 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=a04hJG36qMKjbVl9NofTcqKHT8pm67GndKiJErqLu44BbZIkXw6OLD4RTaH94jCWyV sBuJAvovQDALM0+Q15bH5ApUQIcWSOyKzawCj1ekqqeG4uYufPHG4q/SxabRiZrsBtGM /RHKKKCXi3baYAFo5N591izSBhnkUwZkDJyDV8JikF8xn2OZu1iQZ/VM5dO2oaAu6kyP vtSdfBlWMKflTnzVBGQ4/1RkxSL/thoURoqWdNQXPIDMifglCCQyTlBEalgL7Xy8Ad2m pBLLxVaZD1CRcFFMaWfHyEwhiGN8538JPb5VDkX3TPAnjn5LF3Ku6jTFMAumn2xL2yjH Fw8g== X-Gm-Message-State: ALoCoQlNmNmDFGwayacdrWPxMvqGlM2HvH3ehdB/JhipCHzeEo+cWRtdEc07xLTDoy+sjiGnAobOrdIayjTovdfu0dr0ItFbFg== X-Received: by 10.25.167.209 with SMTP id q200mr22982922lfe.15.1450366173947; Thu, 17 Dec 2015 07:29:33 -0800 (PST) Received: from localhost.localdomain ([195.238.92.128]) by smtp.gmail.com with ESMTPSA id kz5sm801302lbc.7.2015.12.17.07.29.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 17 Dec 2015 07:29:32 -0800 (PST) From: Ivan Khoronzhuk To: lng-odp@lists.linaro.org Date: Thu, 17 Dec 2015 17:29:20 +0200 Message-Id: <1450366164-19537-3-git-send-email-ivan.khoronzhuk@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1450366164-19537-1-git-send-email-ivan.khoronzhuk@linaro.org> References: <1450366164-19537-1-git-send-email-ivan.khoronzhuk@linaro.org> X-Topics: patch Subject: [lng-odp] [API-NEXT PATCH v3 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);