From patchwork Fri Dec 4 17:51:27 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 57713 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp701312lbb; Fri, 4 Dec 2015 09:52:57 -0800 (PST) X-Received: by 10.140.89.241 with SMTP id v104mr19784142qgd.36.1449251577734; Fri, 04 Dec 2015 09:52:57 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id n94si13285748qgd.127.2015.12.04.09.52.57; Fri, 04 Dec 2015 09:52:57 -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 5E10862D85; Fri, 4 Dec 2015 17:52:57 +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 6DE9762D66; Fri, 4 Dec 2015 17:51:55 +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 E7CA062D6D; Fri, 4 Dec 2015 17:51:48 +0000 (UTC) Received: from mail-lf0-f44.google.com (mail-lf0-f44.google.com [209.85.215.44]) by lists.linaro.org (Postfix) with ESMTPS id 4FA4F62D61 for ; Fri, 4 Dec 2015 17:51:47 +0000 (UTC) Received: by lfaz4 with SMTP id z4so117224082lfa.0 for ; Fri, 04 Dec 2015 09:51:46 -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=kc0Qb9bYq/SEMqd44q5tP7DgXzxzHYUHRGlxrhNfhsc=; b=LC/6hN9jpjXdBWhutYyiZPmFjteMJUT109up5hSHeBcGguZK0OTWEI3WQbVzMD8v9L lCi5j/1sP8cbpfWVlmkS9X3x+g2CELsLGJKpKMVsIlPvydBRQr9GPgMSMyp8yMuGZHie I5I5fBj2MXgi2gmXc8RRzrBIGjtpLcy5fQgUFbZG1x1cpSudrVIK5dRMJ0Y395xt6Ydm 1R1p/wlTfbEaJzNqa3VtLoSRKwE9Omp7N+Zw8Iogs9zaitYVun6CXHvulWnm70BGZj5o EK9W1JsVsWFGUft18jkfKBZ1eP6H3cYpKtR6UPzOEIV1DXAycIhxfywdPxShAj7HY+g8 61ug== 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=kc0Qb9bYq/SEMqd44q5tP7DgXzxzHYUHRGlxrhNfhsc=; b=QwXGFhVuKA57KWM0TskwKljE8rBWspwXgjoNO52JLuZV/Ni6HT++Q7thcSsHIfcgcj xDLEc5Ls2fNJS2A0RM9PToWjvIv/aeKUMVdSUBQ2J1FS7MoYaRYR+mVa2KZ7jzSWpl9P hXXDEkGbyD6QSSBuPRT80je5xhjfv/V7CxFSKSqgdKUedpUBz5qR4UeK0nyeqILKzDMq Lk81HiCbKxJrAIRfCYQD1bMt0RLN24oxirlc8FGdneSVXKBiwFIfdZc/e//T2XRJE5Zo HIB69T+Udvc6SOYzWI23j0SZeR07GdVRbnD1Ic5JobSSZXUI8+drWq4ty1uTEOOlmPKH 6i3Q== X-Gm-Message-State: ALoCoQld/FW5jWOBXWUrZmj7d5kw1uWSn8mVph+yggCP3JwGSE0UHbmcb6GZDAopy2acySfl5a4u X-Received: by 10.25.24.193 with SMTP id 62mr8949448lfy.84.1449251506125; Fri, 04 Dec 2015 09:51:46 -0800 (PST) Received: from localhost.localdomain ([212.90.60.8]) by smtp.gmail.com with ESMTPSA id rm5sm2483518lbb.20.2015.12.04.09.51.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 04 Dec 2015 09:51:45 -0800 (PST) From: Ivan Khoronzhuk To: lng-odp@lists.linaro.org Date: Fri, 4 Dec 2015 19:51:27 +0200 Message-Id: <1449251494-23210-3-git-send-email-ivan.khoronzhuk@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1449251494-23210-1-git-send-email-ivan.khoronzhuk@linaro.org> References: <1449251494-23210-1-git-send-email-ivan.khoronzhuk@linaro.org> X-Topics: patch Subject: [lng-odp] [API-NEXT PATCH v7 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. Reviewed-by: Petri Savolainen Signed-off-by: Ivan Khoronzhuk --- test/performance/odp_pktio_perf.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/test/performance/odp_pktio_perf.c b/test/performance/odp_pktio_perf.c index ffe9844..ec67d55 100644 --- a/test/performance/odp_pktio_perf.c +++ b/test/performance/odp_pktio_perf.c @@ -338,10 +338,13 @@ 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(send_duration, + odp_time_diff(cur_time, start_time)) > 0) { unsigned alloc_cnt = 0, tx_cnt; - if (odp_time_diff(cur_time, burst_start_time) < burst_gap) { + if (odp_time_cmp(burst_gap, + odp_time_diff(cur_time, burst_start_time)) + > 0) { cur_time = odp_time_local(); if (!odp_time_cmp(idle_start, ODP_TIME_NULL)) idle_start = cur_time; @@ -357,7 +360,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)