From patchwork Wed Mar 2 20:06:43 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zoltan Kiss X-Patchwork-Id: 63419 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp2573871lbc; Wed, 2 Mar 2016 12:07:52 -0800 (PST) X-Received: by 10.55.18.168 with SMTP id 40mr34919570qks.99.1456949272800; Wed, 02 Mar 2016 12:07:52 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id r185si7193969qhr.129.2016.03.02.12.07.52; Wed, 02 Mar 2016 12:07:52 -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 Received: by lists.linaro.org (Postfix, from userid 109) id 574AA650CF; Wed, 2 Mar 2016 20:07:52 +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 16277617EA; Wed, 2 Mar 2016 20:07:47 +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 CDB89619DA; Wed, 2 Mar 2016 20:07:44 +0000 (UTC) Received: from mail-wm0-f42.google.com (mail-wm0-f42.google.com [74.125.82.42]) by lists.linaro.org (Postfix) with ESMTPS id 3E65861D49 for ; Wed, 2 Mar 2016 20:06:50 +0000 (UTC) Received: by mail-wm0-f42.google.com with SMTP id l68so102279738wml.0 for ; Wed, 02 Mar 2016 12:06:50 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id; bh=8YBde6qLuQbOeRwLt9d8nbDPd/nI/7NDiXiNDYNL/W0=; b=UJbjRYqx5/qOPjbXumg9/MQ/E9AKCwiXDo974dcWoHPh8bp8/a3QTnlNaESlbwbKZs 5BD4733HBDJs3FIkr9ljpfRJs1W25tIv+irVbnOgs6dfBjKKspX1wt3U9TNMPCJ2UVzP jgqoZNLC8LpHTm5telNqm/uwjjMvrwW/Apte/jFLQ735E9y5dqXy0Ktn0lIOYlU+yK8l s92s5mBIjEH9b1XqC6W7AIgHqYxLu0kM1LPXtcHU7Hu5ZwEza2ahbSGVb6UoET6sXYtf t82Q04eRw7KD8wepcsVvSs0xpOXu2auqiKZY4ZuE3RKwQoyWWX8FB+sImd4Ljjo1x8EH 2GqQ== X-Gm-Message-State: AD7BkJIZWxuOjXPZpaZ8t6iXAqqq+QGdOOS/fgo8xXsa7PF4VY/vw+uPL/JRlogWdIycPpBqSgw= X-Received: by 10.194.189.143 with SMTP id gi15mr27329603wjc.54.1456949209505; Wed, 02 Mar 2016 12:06:49 -0800 (PST) Received: from localhost.localdomain ([195.11.233.227]) by smtp.googlemail.com with ESMTPSA id 74sm5711464wmn.17.2016.03.02.12.06.48 for (version=TLSv1/SSLv3 cipher=OTHER); Wed, 02 Mar 2016 12:06:48 -0800 (PST) From: Zoltan Kiss To: lng-odp@lists.linaro.org Date: Wed, 2 Mar 2016 20:06:43 +0000 Message-Id: <1456949203-32444-1-git-send-email-zoltan.kiss@linaro.org> X-Mailer: git-send-email 1.9.1 X-Topics: timers patch 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 004670a..85a5061 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