From patchwork Fri Dec 18 12:01:53 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 58647 Delivered-To: patch@linaro.org Received: by 10.112.89.199 with SMTP id bq7csp978995lbb; Fri, 18 Dec 2015 04:04:31 -0800 (PST) X-Received: by 10.140.222.79 with SMTP id s76mr4542637qhb.21.1450440271571; Fri, 18 Dec 2015 04:04:31 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id 63si15958906qgg.15.2015.12.18.04.04.31; Fri, 18 Dec 2015 04:04:31 -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 DC7C261697; Fri, 18 Dec 2015 12:04:30 +0000 (UTC) Authentication-Results: lists.linaro.org; dkim=fail reason="verification failed; unprotected key" header.d=linaro.org header.i=@linaro.org header.b=RDqR9XW3; 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 A81EA615CE; Fri, 18 Dec 2015 12:03:03 +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 5496B615D5; Fri, 18 Dec 2015 12:02:53 +0000 (UTC) Received: from mail-lb0-f173.google.com (mail-lb0-f173.google.com [209.85.217.173]) by lists.linaro.org (Postfix) with ESMTPS id CF3B5615D5 for ; Fri, 18 Dec 2015 12:02:09 +0000 (UTC) Received: by mail-lb0-f173.google.com with SMTP id yq9so42914063lbb.3 for ; Fri, 18 Dec 2015 04:02:09 -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=RDqR9XW34N8WdmFcuShM3+F/Ckn7fVJVYewtljNXzfB6lKy4+PDDwDMIHekzBRdIBZ VNpigu/UaT9G+yRBAKt5OSX15x2Lh5aGwY1K7uCuDSuhyyKHYoTM3vRcz7HKyR7QDitd 0TwifNiWMPcqqkRIldaSt+RkbbhWDipycdfGQ= 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=hGrz5/74NbM2J42sjlRubyJ8VKyf6WcnyHFb7uyom+gRa5lCrs/2CJPzpNEk1bihXo B+crbyxjGWGWg3Jo8WJgaOKGtoGF5i3Pbl2YsUYK6mEqeY1w4Etxcr4cFAPgbCYRcv2W cZvoHkruVbGtI0hRoI+74ErP5Y057sVwDz6PvMALAysGf6P/cY0M3M2TgWfANKgNlMde mgjkiUVVSDSvKIn+gXfEqIlrF3g+W0PGyxlQQSDU+G4QNzqOdDfiexsUPB6lto7RdabY k4cdJJTF3/EwlbjDXzhejT1MHhbntvV6PwWG6hTd1hzAunBYHgovHQ2tJ+8cXu7rTOkW 8KXw== X-Gm-Message-State: ALoCoQmL4a6uCbxzG+Ffv6DBzDjn4/M5YMsuApqeve9XF2yHojynUxnn1r2Jzt47aqCfI7R79ZtP6Z+GmfXXdPiIXSAJmPvDpg== X-Received: by 10.112.200.229 with SMTP id jv5mr1201481lbc.23.1450440128788; Fri, 18 Dec 2015 04:02:08 -0800 (PST) Received: from localhost.localdomain ([195.238.92.128]) by smtp.gmail.com with ESMTPSA id e63sm2731250lfe.5.2015.12.18.04.02.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 18 Dec 2015 04:02:07 -0800 (PST) From: Ivan Khoronzhuk To: lng-odp@lists.linaro.org Date: Fri, 18 Dec 2015 14:01:53 +0200 Message-Id: <1450440117-5588-3-git-send-email-ivan.khoronzhuk@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1450440117-5588-1-git-send-email-ivan.khoronzhuk@linaro.org> References: <1450440117-5588-1-git-send-email-ivan.khoronzhuk@linaro.org> X-Topics: patch Cc: petri.savolainen@nokia.com Subject: [lng-odp] [API-NEXT PATCH v5 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);