From patchwork Fri Mar 18 17:25:03 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zoltan Kiss X-Patchwork-Id: 64092 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp86422lbc; Fri, 18 Mar 2016 10:26:19 -0700 (PDT) X-Received: by 10.107.134.165 with SMTP id q37mr19274797ioi.41.1458321979191; Fri, 18 Mar 2016 10:26:19 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id f16si40666igt.13.2016.03.18.10.26.18; Fri, 18 Mar 2016 10:26:19 -0700 (PDT) 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 Received: by lists.linaro.org (Postfix, from userid 109) id 73338669B4; Fri, 18 Mar 2016 17:26: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.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, 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 6037B669B6; Fri, 18 Mar 2016 17:25:52 +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 18F48667C6; Fri, 18 Mar 2016 17:25:46 +0000 (UTC) Received: from mail-wm0-f43.google.com (mail-wm0-f43.google.com [74.125.82.43]) by lists.linaro.org (Postfix) with ESMTPS id BB9BA619C1 for ; Fri, 18 Mar 2016 17:25:41 +0000 (UTC) Received: by mail-wm0-f43.google.com with SMTP id l68so39381525wml.0 for ; Fri, 18 Mar 2016 10:25:41 -0700 (PDT) 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; bh=G5HvK9gTLakVWwK0/DkAZqOu1uFmJe8zaYoUMgSHgc0=; b=dUSk4zrOhYiiQ7Wlnw87gF3kqaQfg/F3EMrrPFZXSfPkO/TDMzy50e3rw01QlfZycX 9PmONKPyGDdXaOfRK+HMeJyejezJp1v+UAsByRZYw8vbLz7HOk9XsUnkmLjwCtGIkNyj 7qLjpGILfnxfubGa/4H8s0OpKXoRr5jyaSEVPIDaKBlpeEVTa5F5zCRqRSWZ5wDfmEuK uItfIRdDLowtGfWxywV2LQcmlJlV0LtRBnL7j7Hd9td2+1yo5uXoB+zlQ4rM5a3VXngK b/5R34Si/RK0OnaonFpnKkE/7qO0qUC0uV3NdN3e5imTMs3ShqN1JRuK3Z9xymLPcx66 jW7Q== X-Gm-Message-State: AD7BkJJsPw8M0j2ZQM0eF57pUv4SIpDgL+IQQ9c6vT/9ghizST1prtS6O1dlFOlcyLE2s8SL6ns= X-Received: by 10.195.13.16 with SMTP id eu16mr18781045wjd.140.1458321940986; Fri, 18 Mar 2016 10:25:40 -0700 (PDT) Received: from localhost.localdomain ([195.11.233.227]) by smtp.googlemail.com with ESMTPSA id gt7sm13093999wjc.1.2016.03.18.10.25.40 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 18 Mar 2016 10:25:40 -0700 (PDT) From: Zoltan Kiss To: lng-odp@lists.linaro.org Date: Fri, 18 Mar 2016 17:25:03 +0000 Message-Id: <1458321904-24247-1-git-send-email-zoltan.kiss@linaro.org> X-Mailer: git-send-email 1.9.1 X-Topics: timers patch Cc: ola.liljedahl@arm.com, petri.savolainen@nokia.com Subject: [lng-odp] [PATCH] validation: timer: don't access non-existing timers 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" Since e5c85d3f "validation: timer: handle early exhaustion of pool" the workers can handle if object caches retain packets, but with enough threads it can happen that a late starting thread won't be able to allocate any. This for loop should take that into account and not trying to access tt[0].ev. Signed-off-by: Zoltan Kiss --- test/validation/timer/timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/validation/timer/timer.c b/test/validation/timer/timer.c index 5854b32..7b76dbf 100644 --- a/test/validation/timer/timer.c +++ b/test/validation/timer/timer.c @@ -338,7 +338,7 @@ static void *worker_entrypoint(void *arg TEST_UNUSED) uint32_t ms; uint64_t prev_tick = odp_timer_current_tick(tp); - for (ms = 0; ms < 7 * RANGE_MS / 10; ms++) { + for (ms = 0; ms < 7 * RANGE_MS / 10 && allocated > 0; ms++) { odp_event_t ev; while ((ev = odp_queue_deq(queue)) != ODP_EVENT_INVALID) { /* Subtract one from prev_tick to allow for timeouts