From patchwork Tue Dec 1 14:58:58 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 57495 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp2228515lbb; Tue, 1 Dec 2015 07:00:49 -0800 (PST) X-Received: by 10.140.174.68 with SMTP id u65mr88682066qhu.62.1448982047231; Tue, 01 Dec 2015 07:00:47 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id 17si32821030qgt.95.2015.12.01.07.00.46; Tue, 01 Dec 2015 07:00:47 -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 D015861E51; Tue, 1 Dec 2015 15:00:46 +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 00B5261E55; Tue, 1 Dec 2015 14:59:28 +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 3E2DF61E12; Tue, 1 Dec 2015 14:59:20 +0000 (UTC) Received: from mail-lf0-f54.google.com (mail-lf0-f54.google.com [209.85.215.54]) by lists.linaro.org (Postfix) with ESMTPS id AA59D61E10 for ; Tue, 1 Dec 2015 14:59:15 +0000 (UTC) Received: by lffu14 with SMTP id u14so11679941lff.1 for ; Tue, 01 Dec 2015 06:59:14 -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=kyZIXu4Nzb4ofJI+/C4pBJDZ+q6F5DLmsf8Xs0p3GAmYvJ9arwTckuBf9kh4rh/nXq w8YGSo7WqJHDhEHleLBHkf+VdRGztjUdOHuoJzF8Ow4TWrYTDXr/pblT7HEWLtagIGlg yX84hkB5Is2ndxovRBXwG+ZTEdztpoLnpoI6EqHxE0ljfw6OaBNkokx1lPZ/Nc5hoDhj 7zyUdbweM16BMiPv8+JBc+5JnpscHcEFlGtq4kdZOtxLpk7F8qdlTUBuKzbbIZyYjdEZ D2RbqBGjvI4E0prZjfSF8u9cImgJ2w0VJoJMrkBMUm7agHDrcSCPy+1lIAdZJYWm0Woj SB4A== 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=V3tgD2XanCY+JcDsZ/D4FSe5NiVyitnknAWSryTBfqUGC25jALB0MD2vUtEB1cxypk nyV6Vm+KPdUdBXPFFwzrwJcawa3yB6nu757ykz/1BFO4Ekk532Lb9u1sMGT+IUJeyhbk NdHYwdsA84EIu5gkk96JeqwHWJoBA9dmJ3oip+2VXcZnrTWt2Dpta70FJBR7N09rn8Fz lBVem+Ydk/R4xihJiPM/rSYozx4ox+T4h1d42ZiB8XE9wkG+2UXUwmexLfpQEVUqfgy5 pLa4s3cki5Vfz4gVnJkH8qbpoYacbpXANc7Zrq2p2uNtTXJEw/zxKkeFPViQfGPTNxTk SPRw== X-Gm-Message-State: ALoCoQnCbdx9DozHxKwpYFfkjAMO7rCwWBPI/uTD06CMK026Ub2A19BbkcUXudZB6/5dmOQpHSwV X-Received: by 10.25.41.77 with SMTP id p74mr18914252lfp.22.1448981954583; Tue, 01 Dec 2015 06:59:14 -0800 (PST) Received: from localhost.localdomain ([212.90.60.8]) by smtp.gmail.com with ESMTPSA id l128sm5251710lfd.10.2015.12.01.06.59.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 01 Dec 2015 06:59:13 -0800 (PST) From: Ivan Khoronzhuk To: lng-odp@lists.linaro.org Date: Tue, 1 Dec 2015 16:58:58 +0200 Message-Id: <1448981945-8062-3-git-send-email-ivan.khoronzhuk@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1448981945-8062-1-git-send-email-ivan.khoronzhuk@linaro.org> References: <1448981945-8062-1-git-send-email-ivan.khoronzhuk@linaro.org> X-Topics: patch Subject: [lng-odp] [API-NEXT PATCH v4 2/9] 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)