From patchwork Tue Dec 1 15:08:06 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 57503 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp2238504lbb; Tue, 1 Dec 2015 07:14:18 -0800 (PST) X-Received: by 10.140.222.79 with SMTP id s76mr17085852qhb.21.1448982858559; Tue, 01 Dec 2015 07:14:18 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id r73si50597729qkr.119.2015.12.01.07.14.18; Tue, 01 Dec 2015 07:14:18 -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 2193761D9D; Tue, 1 Dec 2015 15:14:18 +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 4D18D61FA8; Tue, 1 Dec 2015 15:11:09 +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 D0E9861E6E; Tue, 1 Dec 2015 15:10:58 +0000 (UTC) Received: from mail-lf0-f49.google.com (mail-lf0-f49.google.com [209.85.215.49]) by lists.linaro.org (Postfix) with ESMTPS id ECBE061E4F for ; Tue, 1 Dec 2015 15:08:23 +0000 (UTC) Received: by lfaz4 with SMTP id z4so12165179lfa.0 for ; Tue, 01 Dec 2015 07:08:22 -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=N2jpH90ZY/hrCogPKN6bfuSunZfl7bR9qZBfcvwJInNyY1CewD8KB2I5OT+hf/Pvu+ LLyrLK5WitF0QJqJnYK3pCFoaEJTssC6WVbV+CsTzAHw97gkWP29YP47BeD+16zDqkLl 36Wdp/jspU4ttRjQxMpoDUOk2HEDIlZztT93N2Ezus2MIMfjBNdt2ZjfFq90WrrQR2yc JJF1jVIfpXzs6289M9kHndcSG3H6LnZND62o1EvW3ypFxdCNNu8ryYTw0YNNc7xBrSZO 1otp0QVFWXdPiQhGDGW4W5o7Qax3qLv0Pa1aWQfPnm/3rHjiCFatnuE0ertzi/GoVsqb an1w== 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=JljZFz6XrGau35Ymagjr2BomRMj8HGfkt7pAKbGj+f6Qg7AScJUwzV9sUI6yFinlqa B4r42k+YpSOizL4VKflR8e3BuUT9GeJYS04QQ9RrCkjh5NtjNmvnwy8y3MGB9jdvlBT+ NB+hsafc2orLaAp0AoKflMITxdkDLPMdCtnRWHrsipJ1KPPJwmLW2TKLMGLJPyvUG4a+ QsjMum/3E1CfcfMLWNYq3YtqcHuVltSlkhhBM0QEGoqWRYY2Q39foMIUU79YFSvtJh/V 8ByCwy833WuvwSrVQu8GyRibSlb6VJM5tZ6iiDqcuwbr+MQ3PMWtAJDt17eJ20HOMvUv ndEQ== X-Gm-Message-State: ALoCoQmGxJ7hZ8iwaXO6+CSNHy2SUqvpkRC4ZIvVamURv/FoQGv3i/jj1JKD608bUPW+GMAk5y/6 X-Received: by 10.25.212.140 with SMTP id l134mr21182527lfg.118.1448982502789; Tue, 01 Dec 2015 07:08:22 -0800 (PST) Received: from localhost.localdomain ([212.90.60.8]) by smtp.gmail.com with ESMTPSA id i194sm8278535lfg.20.2015.12.01.07.08.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 01 Dec 2015 07:08:21 -0800 (PST) From: Ivan Khoronzhuk To: lng-odp@lists.linaro.org Date: Tue, 1 Dec 2015 17:08:06 +0200 Message-Id: <1448982493-8236-3-git-send-email-ivan.khoronzhuk@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1448982493-8236-1-git-send-email-ivan.khoronzhuk@linaro.org> References: <1448982493-8236-1-git-send-email-ivan.khoronzhuk@linaro.org> X-Topics: patch Subject: [lng-odp] [API-NEXT PATCH v5 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)