From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ie0-f170.google.com (mail-ie0-f170.google.com [209.85.223.170]) by dpdk.org (Postfix) with ESMTP id 8565DAD7D for ; Wed, 25 Feb 2015 05:10:14 +0100 (CET) Received: by iecvy18 with SMTP id vy18so1827576iec.6 for ; Tue, 24 Feb 2015 20:10:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=qzIdK0VSClKXvccLtHt2z1FYMYossSuvXv76dA3aVGg=; b=ezORhCWy1o9hcFp2eayv6n6zRyIQGHQPqmOW6tD+vMvj5R1YZZM9Y0gcE55virZaxX g4tUAdguxIfcAuEfjh4VoQW7KWh8WmUyrMPahQGDhhtRR6+AE7zb4512x6VykXZImeD/ VBOFRE8UeJU4OB71eigDDUn7VJRQxVS36Zx+Ji3TRA5rlqe5nxgcREbqWNxqskif1e/z I/XnqOzZh1hbCcBz/+puzSEGOlQGvd705IEhPtseB8VD8qSB2MdSDdAYph8xETU2TgTr htpUcFgMIrISVXufUGKOfxOW4SsEqg+XwPtGlegaQVphlCs7GhgaJTPOoFo4qEvqNi3I jgzg== X-Received: by 10.50.142.38 with SMTP id rt6mr24495469igb.17.1424837414132; Tue, 24 Feb 2015 20:10:14 -0800 (PST) Received: from localhost.localdomain (adsl-065-013-043-223.sip.mia.bellsouth.net. [65.13.43.223]) by mx.google.com with ESMTPSA id m38sm25067554ioi.39.2015.02.24.20.10.12 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Feb 2015 20:10:13 -0800 (PST) From: Robert Sanford To: dev@dpdk.org Date: Tue, 24 Feb 2015 23:09:48 -0500 Message-Id: <1424837389-56276-3-git-send-email-rsanford2@gmail.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1422996127-64370-1-git-send-email-rsanford2@gmail.com> References: <1422996127-64370-1-git-send-email-rsanford2@gmail.com> Subject: [dpdk-dev] [PATCH v2 2/3] timer: fix stress test on multiple runs X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Feb 2015 04:10:15 -0000 Fix timer stress test to succeed on multiple runs. Signed-off-by: Robert Sanford --- app/test/test_timer.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/app/test/test_timer.c b/app/test/test_timer.c index 4b4800b..070437a 100644 --- a/app/test/test_timer.c +++ b/app/test/test_timer.c @@ -253,6 +253,7 @@ timer_stress2_main_loop(__attribute__((unused)) void *arg) unsigned lcore_id = rte_lcore_id(); if (lcore_id == rte_get_master_lcore()) { + cb_count = 0; timers = rte_malloc(NULL, sizeof(*timers) * NB_STRESS2_TIMERS, 0); if (timers == NULL) { printf("Test Failed\n"); @@ -311,6 +312,12 @@ timer_stress2_main_loop(__attribute__((unused)) void *arg) /* now check that we get the right number of callbacks */ if (lcore_id == rte_get_master_lcore()) { rte_timer_manage(); + + /* clean up statics, in case we run again */ + rte_free(timers); + timers = NULL; + ready = 0; + if (cb_count != NB_STRESS2_TIMERS) { printf("Test Failed\n"); printf("- Stress test 2, part 2 failed\n"); -- 1.7.1