From patchwork Thu Nov 19 14:30:01 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 56998 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp3215090lbb; Thu, 19 Nov 2015 06:31:34 -0800 (PST) X-Received: by 10.140.30.101 with SMTP id c92mr7189017qgc.74.1447943494575; Thu, 19 Nov 2015 06:31:34 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id r62si6898252qhr.97.2015.11.19.06.31.34; Thu, 19 Nov 2015 06:31:34 -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 37C3261A4E; Thu, 19 Nov 2015 14:31:34 +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 9B7FB61A29; Thu, 19 Nov 2015 14:30:26 +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 389A661B14; Thu, 19 Nov 2015 14:30:19 +0000 (UTC) Received: from mail-lb0-f179.google.com (mail-lb0-f179.google.com [209.85.217.179]) by lists.linaro.org (Postfix) with ESMTPS id 76ED4619CB for ; Thu, 19 Nov 2015 14:30:13 +0000 (UTC) Received: by lbbkw15 with SMTP id kw15so44625637lbb.0 for ; Thu, 19 Nov 2015 06:30:12 -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=ho1+xx3vdQKB1wpEkm3RBkzFGzRy+xCoZNZUHjtILHE=; b=l8a+36LpbOFVa4jr9DPA9ZDWcp/mcKwknMMVf0thH71UQ1f2rcT+5go8Z9mh/86zu8 s03FA5+9dFVeZkcr4QmctwIkfafUXvb5EWPkgiB3EuWzEFMeMZU9A7IeGcn3dJvaWC+C jib+NvTc0QjGQ/MJSi7yozS/k/4rf+nH+N7fyB8GQLf5hJfh/hOnLzh5+uXJNgypQsVo eENq6/1gOCzy3aVtpltNjMlK6oWijlb791Xy0GIeW0n9w+urIFdg83wV+BW3iNqFBXpJ 8H6S1DwQiTuoWsvskJCx/v3YsbrWYWfOLrJ+26OoRGQl3UqwC7Fimb7DNC3/QzceHNea wBzA== 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=ho1+xx3vdQKB1wpEkm3RBkzFGzRy+xCoZNZUHjtILHE=; b=BTuI+8DaZ1NKjyk5XdC08ZqsPwPBasUhl9FF+m6DkmELUWlbgUTVgmuVv/8PW8s4jv JuO592uSbtfh75bATfDEruci33iuFHemHkWv+/W5wOKwKGfPsgMTNzzscVLMuHR47zmB K+8y7c78G1iEfMYbdKS/reixzyr+azsoKcVdLUF887eoPhsV8NzkMcquSumRjG2lHG6X RyhD3HoEIvrkPKyVDdrev4rf0F3X28tDQYMnXSrvp2Q7JXGwyyH21zcRtxHdjxe/kpHN RltLCx3tqPINX3cZmNqc9YAtZ2RaGmFAnynw6XFjcdsf2G9hygRyquHVIevIjHneHzOk 0Fkg== X-Gm-Message-State: ALoCoQm+CX9UbzR2ylN1e76IMsAbGfsXcfOHTOFAsLlQfWFKJeztjkm6tXZ5uLmci6F+0iznXfVM X-Received: by 10.112.200.138 with SMTP id js10mr1292178lbc.48.1447943412227; Thu, 19 Nov 2015 06:30:12 -0800 (PST) Received: from localhost.localdomain ([195.238.92.128]) by smtp.gmail.com with ESMTPSA id f71sm535235lfe.36.2015.11.19.06.30.10 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 19 Nov 2015 06:30:11 -0800 (PST) From: Ivan Khoronzhuk To: lng-odp@lists.linaro.org Date: Thu, 19 Nov 2015 16:30:01 +0200 Message-Id: <1447943403-24803-2-git-send-email-ivan.khoronzhuk@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1447943403-24803-1-git-send-email-ivan.khoronzhuk@linaro.org> References: <1447943403-24803-1-git-send-email-ivan.khoronzhuk@linaro.org> X-Topics: timers patch Subject: [lng-odp] [PATCH v4 1/3] example: timer: warn if timeout less than resolution 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" The period shouldn't be less than timer resolution. If it's less there is no guarantee about timeout accuracy, it can be executed right after setting it or after up to timer resolution timeout or even be set late, in which case application will be stopped with error. So it's better to warn user that timeout is less then resolution instead of silence. Reviewed-by: Ola Liljedahl Signed-off-by: Ivan Khoronzhuk Reviewed-by: Ola Liljedahl --- example/timer/odp_timer_test.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/example/timer/odp_timer_test.c b/example/timer/odp_timer_test.c index 94619e4..aee01c8 100644 --- a/example/timer/odp_timer_test.c +++ b/example/timer/odp_timer_test.c @@ -311,6 +311,9 @@ static void parse_args(int argc, char *argv[], test_args_t *args) break; } } + + if (args->period_us < args->resolution_us) + printf("\n\tWarn: timeout is set less then resolution\n"); }