From patchwork Thu Dec 3 12:49:31 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 57643 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp3475715lbb; Thu, 3 Dec 2015 04:51:41 -0800 (PST) X-Received: by 10.140.106.201 with SMTP id e67mr10652005qgf.80.1449147101370; Thu, 03 Dec 2015 04:51:41 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id l50si1104876qgf.74.2015.12.03.04.51.40; Thu, 03 Dec 2015 04:51:41 -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 D232162CA2; Thu, 3 Dec 2015 12:51:40 +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 63E9462CA5; Thu, 3 Dec 2015 12:49:58 +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 E5CA462CA3; Thu, 3 Dec 2015 12:49:54 +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 3C75861CB3 for ; Thu, 3 Dec 2015 12:49:49 +0000 (UTC) Received: by lfs39 with SMTP id 39so86090259lfs.3 for ; Thu, 03 Dec 2015 04:49:48 -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=M9mnQS7iR8DNsNdBCxZ/S5mRIlLwnYAuETxg+kDv6ynLZRpG48W5NGV8oP689QAqBa mhdH1DD+DpTwaLR6W3cUgbav6nC98SbEOUPEakceVSPYABS0X1d7rU2l7e7hSxM3Os0E ZPOjqyMCR5RlyMA9/IxufOWOKIsH/mO18zrDLeL9z4EMD5Q0LjwHgDMRA+8u6nZlBNGt G2gsCVH63XNnkneZTiUkeM+5fhYOoWS8n/tCWNyJh3LMnk8dGu5YsHptBEo+KKZeRnp2 n4tkJE5l7E9KY0jxEYXbfqAZFSnYwWLkg/ysTJ6pj2Hxxp7N5a1+VqXFDVKsXPtC7dA9 hv/g== 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=l7et0LkzGmcw6ayqlkAvSu9aJNCtsFLjLg+9ys6N1QmsIZcTMR25QRon94lSmlFobi Yhgsb/jO8hG+9Y9KvJ1l7CrOXY9JXZqg421aNX9nUW4LcjlC3z1sqYF/gXcvuGQwsvmb /Tb6sliIvxNl2v1STSdN65XT370SfZO+JjQ+sSsg1UM625yvqRtE8RDDBojFTK38tzSx FV2gY3l7K85t7tgasO/2/7+C6mFEVIHGH16cALjzGoN75Dwa11iSPvDbjzknFIzeN60g pHSJwzEnyaYiX7SO985O0FBc8/X/Gd+v/Kastce9XX/qyXCiP9FoYRH9vzG+drNa1+hJ h1SA== X-Gm-Message-State: ALoCoQlFxS3SjXTIO4Aunlwhee4ggA2oUmJHUmPFokokYXxf7Hon6BYkfaA+HqrHB7G5IzrvzaFP X-Received: by 10.25.21.70 with SMTP id l67mr4904610lfi.27.1449146988079; Thu, 03 Dec 2015 04:49:48 -0800 (PST) Received: from localhost.localdomain ([195.238.92.128]) by smtp.gmail.com with ESMTPSA id l81sm1392459lfb.40.2015.12.03.04.49.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 03 Dec 2015 04:49:47 -0800 (PST) From: Ivan Khoronzhuk To: lng-odp@lists.linaro.org Date: Thu, 3 Dec 2015 14:49:31 +0200 Message-Id: <1449146978-22222-3-git-send-email-ivan.khoronzhuk@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1449146978-22222-1-git-send-email-ivan.khoronzhuk@linaro.org> References: <1449146978-22222-1-git-send-email-ivan.khoronzhuk@linaro.org> X-Topics: patch Subject: [lng-odp] [API-NEXT PATCH v6] 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)