From patchwork Mon Nov 23 21:20:50 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 57199 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp1684602lbb; Mon, 23 Nov 2015 13:22:28 -0800 (PST) X-Received: by 10.140.163.133 with SMTP id j127mr26151824qhj.50.1448313748114; Mon, 23 Nov 2015 13:22:28 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id e13si12998024qka.18.2015.11.23.13.22.27; Mon, 23 Nov 2015 13:22:28 -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.20150623.gappssmtp.com Received: by lists.linaro.org (Postfix, from userid 109) id BF50461CCD; Mon, 23 Nov 2015 21:22:27 +0000 (UTC) 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 664C061CB3; Mon, 23 Nov 2015 21:21:12 +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 2255061CB3; Mon, 23 Nov 2015 21:21:06 +0000 (UTC) Received: from mail-lf0-f45.google.com (mail-lf0-f45.google.com [209.85.215.45]) by lists.linaro.org (Postfix) with ESMTPS id 0BEA661CB8 for ; Mon, 23 Nov 2015 21:21:05 +0000 (UTC) Received: by lfdl133 with SMTP id l133so39014298lfd.2 for ; Mon, 23 Nov 2015 13:21:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=crM8AWoGj7WBzSx5V8kmI6K4qtRV1TDqBrVDgkEn4Qc=; b=BJ/UwpMSV2PNoIfJbG8B1FEqDjYrYZGkdEYoBmsYKkoWhEWrFU/skWC1QN4mQ6mPfR Ow6ZHlDLmWuwBT/BOHqDjeKqQzftDwueopYR8Dl76q1NSWaMTA/hUj6dHgSDc5EnvrgT L/yt0BuEZs/cCzbQsLcUbJVpsUZaAuu66jlyJ2g2gLhcIS2+4h56IXJNHkXMaK6JUZJM MRU9S0T8kkqD5b5Nv5iCMKJuivQ7TkYheoxzGwFL0h5AU8JXfn2u51Lvrcy/JZZqxxn9 FB8VorZox8bL43HPNXakmPI8DdlsUeFwiR/GiPHhX1vyXaxtTAApoXb5RRsYYVP1e8t8 FMEQ== 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=crM8AWoGj7WBzSx5V8kmI6K4qtRV1TDqBrVDgkEn4Qc=; b=cCScAehAJ5MVondN3fwsVORu+SktAzTxhPGH8zKaWJv/k2A2hKZwYV7zAfRLuuICcC 1ugrGDi/XL+qk2+7Po7RMO2El8SAz1+3qhMWi4u5eCQlfEpYPJDR8Spk4mGaHskG5qyx zrRKYZV+9thCo7m+Y6gXbLP7TgsvegGvNGKEqIsG/59RmLhRjVGV/jWWzHPSnwQnhuKn SgAoHVOBQJ89PpcZHDtcIr57AlHggcNg34ziHIBDsS+ZilMOmbjeJ7Stzxfmpc0h0gju 7BDtW7dZh2wn/qO8KGhLofZO6US6PI90IRU+QNpAfBtcu1iIsjFfvBa6umpZx0jdk/qS dhCw== X-Gm-Message-State: ALoCoQlvaZgbCovrz8y1VMcF1kbh/B+k+JPI3D3yvVmZuCuIF95HX6eg9T5O8LN7wvp1dXYdhkoT X-Received: by 10.112.55.97 with SMTP id r1mr9440013lbp.119.1448313663959; Mon, 23 Nov 2015 13:21:03 -0800 (PST) Received: from localhost.localdomain ([212.90.60.8]) by smtp.gmail.com with ESMTPSA id r2sm2122027lfe.28.2015.11.23.13.21.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 23 Nov 2015 13:21:03 -0800 (PST) From: Ivan Khoronzhuk To: lng-odp@lists.linaro.org Date: Mon, 23 Nov 2015 23:20:50 +0200 Message-Id: <1448313655-7949-3-git-send-email-ivan.khoronzhuk@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1448313655-7949-1-git-send-email-ivan.khoronzhuk@linaro.org> References: <1448313655-7949-1-git-send-email-ivan.khoronzhuk@linaro.org> X-Topics: patch Subject: [lng-odp] [API-NEXT PATCH v3 2/7] test: performance: pktio: don't use direct arithmetic operations with odp_time_t 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" It was missed while unbinding cycles from time API names. Correct is as it prevents for adding structure under odp_time_t. Signed-off-by: Ivan Khoronzhuk --- test/performance/odp_pktio_perf.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/performance/odp_pktio_perf.c b/test/performance/odp_pktio_perf.c index ffe9844..2e49f50 100644 --- a/test/performance/odp_pktio_perf.c +++ b/test/performance/odp_pktio_perf.c @@ -338,10 +338,12 @@ static void *run_thread_tx(void *arg) cur_time = odp_time_local(); start_time = cur_time; burst_start_time = odp_time_diff(cur_time, burst_gap); - while (odp_time_diff(cur_time, start_time) < send_duration) { + while (odp_time_cmp(odp_time_diff(cur_time, start_time), + send_duration) > 1) { unsigned alloc_cnt = 0, tx_cnt; - if (odp_time_diff(cur_time, burst_start_time) < burst_gap) { + if (odp_time_cmp(odp_time_diff(cur_time, burst_start_time), + burst_gap) > 1) { cur_time = odp_time_local(); if (!odp_time_cmp(idle_start, ODP_TIME_NULL)) idle_start = cur_time; @@ -357,7 +359,7 @@ static void *run_thread_tx(void *arg) idle_start = ODP_TIME_NULL; } - burst_start_time += burst_gap; + burst_start_time = odp_time_sum(burst_start_time, burst_gap); alloc_cnt = alloc_packets(tx_event, batch_len - unsent_pkts); if (alloc_cnt != batch_len)