From mboxrd@z Thu Jan 1 00:00:00 1970 From: Robert Sanford Subject: [PATCH v2 2/3] timer: fix stress test on multiple runs Date: Tue, 24 Feb 2015 23:09:48 -0500 Message-ID: <1424837389-56276-3-git-send-email-rsanford2@gmail.com> References: <1422996127-64370-1-git-send-email-rsanford2@gmail.com> To: dev-VfR2kkLFssw@public.gmane.org Return-path: In-Reply-To: <1422996127-64370-1-git-send-email-rsanford2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" 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