From patchwork Mon Feb 19 17:00:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 128832 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp3721590ljc; Mon, 19 Feb 2018 09:00:32 -0800 (PST) X-Google-Smtp-Source: AH8x227K/MBXUBfaKeN1e/bkKI5cZIaQLIKB3tkzD7Rxqogsddi5M5d9ksWvhQCXqeJkZShDlCDq X-Received: by 10.237.60.150 with SMTP id d22mr25132721qtf.210.1519059632302; Mon, 19 Feb 2018 09:00:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519059632; cv=none; d=google.com; s=arc-20160816; b=ys3ohnL90Lj74r4I9dOZSbzHb8JiuIyV0aMkNk4uf1faXFRAwhIBfi3p5YJEtTaK91 mdBL98ZCPMfdiLdH7ufTbFQ1GvxR22YBefGeN45F6K5aGj1weFyUDabe7W7paZmQZQdR mlVRVKacjIbsQXCAp3F5c15ipkuZns/sZrmp+H+RhNxdDfAiEk6tvmkOL7w3iWHRBeJl v97Ys4kd6DY3cB6JT5cuiXhNPJ1ITWU3LfUK2pSPEEL3WdkySLo9bg+e8k7sDKOxwN0V l+NTq5Z+H67OcTecHUUQgpnLkGAUvmen8j6Jaxi5I/4XY8Xc2TBqgZ1jsLC8siV6MPWX /lRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=qPLyF8KNEBNK5quCQC7EpjNBWPEhYuoUmHbPeL3H0f4=; b=sCzT8bC4zU06PIbF4hjDU79J4XLIwIgh4jwEqC4/91PwXI3oprJZGOG8Z3gI6ls/Sa fiO9FH8im2AmY1MuuUPlJTZv19v2fR44KA4II/SQUa9Nk+WO0FBQfrRxpELQiOc23JJE 5/jqFlVk+KJubLposoT6nowvtuCqDZ+ziSJPm6Pw+eo6hEjMBldhJ5w1XOLxQg6/sMZl VbG8IfJcuXYmOzPEAh6PukOk37rHQcu//hrUzL07mT52/RctXki1FiACY1ebtj8Q1yK7 98+2gATN8oM+pQivd+XPT2ODdDBbAFl5uR1lFe0D55GkrfiahrdZu1QzSAbx2d1YbZh7 kV+g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id f9si3488603qke.134.2018.02.19.09.00.31; Mon, 19 Feb 2018 09:00:32 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id 2F2466087C; Mon, 19 Feb 2018 17:00:31 +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.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW 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 B967661762; Mon, 19 Feb 2018 17:00:22 +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 730A961776; Mon, 19 Feb 2018 17:00:19 +0000 (UTC) Received: from forward100p.mail.yandex.net (forward100p.mail.yandex.net [77.88.28.100]) by lists.linaro.org (Postfix) with ESMTPS id 13C8561762 for ; Mon, 19 Feb 2018 17:00:18 +0000 (UTC) Received: from mxback3j.mail.yandex.net (mxback3j.mail.yandex.net [IPv6:2a02:6b8:0:1619::10c]) by forward100p.mail.yandex.net (Yandex) with ESMTP id 6E53B5101D41 for ; Mon, 19 Feb 2018 20:00:15 +0300 (MSK) Received: from smtp4p.mail.yandex.net (smtp4p.mail.yandex.net [2a02:6b8:0:1402::15:6]) by mxback3j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id kHnLaLcu92-0F1mWXRB; Mon, 19 Feb 2018 20:00:15 +0300 Received: by smtp4p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id ijUtdMH2wr-0E8WYHm5; Mon, 19 Feb 2018 20:00:14 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Mon, 19 Feb 2018 20:00:12 +0300 Message-Id: <1519059613-8660-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1519059613-8660-1-git-send-email-odpbot@yandex.ru> References: <1519059613-8660-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 479 Subject: [lng-odp] [PATCH v5 1/2] validation: timer: fix test failure 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: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" From: Dmitry Eremin-Solenikov timer_main test was regularly failing due to worker code receiving timeout events for cancelled timers. Fixes: https://bugs.linaro.org/show_bug.cgi?id=3517 Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 479 (lumag:timer-fix) ** https://github.com/Linaro/odp/pull/479 ** Patch: https://github.com/Linaro/odp/pull/479.patch ** Base sha: d5419e8857b2bc61d3be17fe53f171550fee426b ** Merge commit sha: 21113b211b455e70fa0a51d80db89991bdf5bc2c **/ test/validation/api/timer/timer.c | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/test/validation/api/timer/timer.c b/test/validation/api/timer/timer.c index 7ea508aa0..da2dc05ca 100644 --- a/test/validation/api/timer/timer.c +++ b/test/validation/api/timer/timer.c @@ -282,15 +282,28 @@ static void handle_tmo(odp_event_t ev, bool stale, uint64_t prev_tick) if (ttp && ttp->tick != TICK_INVALID) CU_FAIL("Stale timeout for active timer"); } else { - if (!odp_timeout_fresh(tmo)) - CU_FAIL("Wrong status (stale) for fresh timeout"); - /* Fresh timeout => local timer must have matching tick */ - if (ttp && ttp->tick != tick) { - LOG_DBG("Wrong tick: expected %" PRIu64 - " actual %" PRIu64 "\n", - ttp->tick, tick); - CU_FAIL("odp_timeout_tick() wrong tick"); + if (ttp && ttp->tick == TICK_INVALID) { + /* Timer was cancelled when it has already expired */ + + if (odp_timeout_fresh(tmo)) + CU_FAIL("Wrong status (fresh) " + "for cancelled timeout"); + } else { + if (!odp_timeout_fresh(tmo)) + CU_FAIL("Wrong status (stale) " + "for fresh timeout"); + + /* Fresh timeout => local timer must have matching tick + */ + if (ttp && ttp->tick != tick) { + LOG_DBG("Wrong tick: expected %" PRIu64 + " actual %" PRIu64 "\n", + ttp->tick, tick); + CU_FAIL("odp_timeout_tick() wrong tick"); + } } + if (ttp && ttp->ev != ODP_EVENT_INVALID) + CU_FAIL("Wrong state for fresh timer (event)"); /* Check that timeout was delivered 'timely' */ if (tick > odp_timer_current_tick(tp)) CU_FAIL("Timeout delivered early"); @@ -401,9 +414,11 @@ static int worker_entrypoint(void *arg TEST_UNUSED) (rand_r(&seed) % 2 == 0)) { /* Timer active, cancel it */ rc = odp_timer_cancel(tt[i].tim, &tt[i].ev); - if (rc != 0) + if (rc != 0) { /* Cancel failed, timer already expired */ ntoolate++; + LOG_DBG("Failed to cancel timer, probably already expired\n"); + } tt[i].tick = TICK_INVALID; ncancel++; } else { From patchwork Mon Feb 19 17:00:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 128833 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp3723181ljc; Mon, 19 Feb 2018 09:01:45 -0800 (PST) X-Google-Smtp-Source: AH8x225KebEzZOgC+To6MzptjoUlG+vFLJ/BoRQe2qen7pBKXigBn+EpWJOnYPk2KfS3SSakoCOR X-Received: by 10.55.101.142 with SMTP id z136mr19859518qkb.46.1519059704921; Mon, 19 Feb 2018 09:01:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519059704; cv=none; d=google.com; s=arc-20160816; b=tf+aX8rXTI+A9BqFNHqPoIxm+Aw8B9yeTiXsectWX0wijaHDoBQ/8LQr+E2JGsB0vq K+jJNzzZcJlbH7LzgTtZOt8pRHmk8FYTN5uS+npewRxiC7yxxuiY0euS7/bhsL2jz9DG HMF47KWaIJlBE7eaOo15x1NSWOUYdvQmtR1hydFfsT9f7mGgwkr2mzw1PtKE1F5BGQ9b DO3ENs1CIluxSAu0Gzi6XJhHU2VXjOIlE0yLMrnJ4GT3RPHnpSJNemXC/oNgiw83fPs6 SA3pskWbNbU8knu/iGBPj/+Hd7SivMhipYr6SqbCIAaj7YxkuXDU+RIZn7Rc4JQsKXpD 05ew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=UWSwNdL4U2PaQE/hYIX+GvY3LEa/QDEYSj5f2CeHI9E=; b=qHU93DF2ueQua/eV6XmYeJ1GHGaASeeW5Fihr4lSQnllbkKHf8Z9/aACZCjXNvU5Vs eEQPkq0JkbQySDGUYB4XvJtK9mHAyBRVIOBBruyWhKj45IFKJ53uqmRSHNDGNfiNYuGr y/SnZSSBIxddlLP07A/NDVMgrkfQ4oZ2Xm4Ue5Azmy4IO5x1lk+vj2jUysk+roJqrC6v hYVpyy/k5dVJ+U2ggT0Zcmnbp6A27VmUdruFA33+uScXypW+g4hKOPXfoNvegJNk6qcT VQf+nxqGuf0BcQKlyzPlUiIUfEhDS0hx7G0ivi5btX7UPNU0v9G5bbP6psE/H0vh4Soz A7bw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id v67si4812843qkc.205.2018.02.19.09.01.44; Mon, 19 Feb 2018 09:01:44 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id 691466177F; Mon, 19 Feb 2018 17:01:44 +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.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2 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 A335E60670; Mon, 19 Feb 2018 17:00: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 739BA61758; Mon, 19 Feb 2018 17:00:21 +0000 (UTC) Received: from forward104j.mail.yandex.net (forward104j.mail.yandex.net [5.45.198.247]) by lists.linaro.org (Postfix) with ESMTPS id DFF2561758 for ; Mon, 19 Feb 2018 17:00:19 +0000 (UTC) Received: from mxback5g.mail.yandex.net (mxback5g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:166]) by forward104j.mail.yandex.net (Yandex) with ESMTP id 11604422B8 for ; Mon, 19 Feb 2018 20:00:16 +0300 (MSK) Received: from smtp4p.mail.yandex.net (smtp4p.mail.yandex.net [2a02:6b8:0:1402::15:6]) by mxback5g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id xVbUNwliE1-0GQGpvh9; Mon, 19 Feb 2018 20:00:16 +0300 Received: by smtp4p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id ijUtdMH2wr-0F8umbZG; Mon, 19 Feb 2018 20:00:15 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Mon, 19 Feb 2018 20:00:13 +0300 Message-Id: <1519059613-8660-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1519059613-8660-1-git-send-email-odpbot@yandex.ru> References: <1519059613-8660-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 479 Subject: [lng-odp] [PATCH v5 2/2] validation: timer: fix "Failed to set timer" error 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: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" From: Dmitry Eremin-Solenikov Occasionally timer test will try to set timer to a tick that has just passed. It is not an error per se, so it should be handled properly. Signed-off-by: Dmitry Eremin-Solenikov Fixes: https://bugs.linaro.org/show_bug.cgi?id=3628 --- /** Email created from pull request 479 (lumag:timer-fix) ** https://github.com/Linaro/odp/pull/479 ** Patch: https://github.com/Linaro/odp/pull/479.patch ** Base sha: d5419e8857b2bc61d3be17fe53f171550fee426b ** Merge commit sha: 21113b211b455e70fa0a51d80db89991bdf5bc2c **/ test/validation/api/timer/timer.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/validation/api/timer/timer.c b/test/validation/api/timer/timer.c index da2dc05ca..0dfb565e2 100644 --- a/test/validation/api/timer/timer.c +++ b/test/validation/api/timer/timer.c @@ -386,7 +386,10 @@ static int worker_entrypoint(void *arg TEST_UNUSED) odp_timer_ns_to_tick(tp, (rand_r(&seed) % RANGE_MS) * 1000000ULL); timer_rc = odp_timer_set_abs(tt[i].tim, tck, &tt[i].ev); - if (timer_rc != ODP_TIMER_SUCCESS) { + if (timer_rc == ODP_TIMER_TOOEARLY) { + LOG_ERR("Missed tick, setting timer\n"); + } else if (timer_rc != ODP_TIMER_SUCCESS) { + LOG_ERR("Failed to set timer: %d\n", timer_rc); CU_FAIL("Failed to set timer"); } else { tt[i].tick = tck;