DPDK patches and discussions
 help / color / mirror / Atom feed
From: Robert Sanford <rsanford2@gmail.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH v2 2/3] timer: fix stress test on multiple runs
Date: Tue, 24 Feb 2015 23:09:48 -0500	[thread overview]
Message-ID: <1424837389-56276-3-git-send-email-rsanford2@gmail.com> (raw)
In-Reply-To: <1422996127-64370-1-git-send-email-rsanford2@gmail.com>

Fix timer stress test to succeed on multiple runs.

Signed-off-by: Robert Sanford <rsanford2@gmail.com>

---
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

  parent reply	other threads:[~2015-02-25  4:10 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-03 20:42 [dpdk-dev] [RFC PATCH] rte_timer: Fix rte_timer_reset return value rsanford2
2015-02-06 11:10 ` Olivier MATZ
2015-02-06 17:26   ` Robert Sanford
2015-02-08 10:53     ` Olivier MATZ
2015-02-25  4:09 ` [dpdk-dev] [PATCH v2 0/3] timer: fix rte_timer_reset Robert Sanford
2015-02-25  8:58   ` Olivier MATZ
2015-02-25  9:46     ` Thomas Monjalon
2015-02-25 11:02       ` Robert Sanford
2015-02-25 11:09         ` Thomas Monjalon
2015-02-25 11:16         ` Bruce Richardson
2015-02-25 13:34           ` Robert Sanford
2015-02-25  4:09 ` [dpdk-dev] [PATCH v2 1/3] timer: pause in rte_timer_reset_sync Robert Sanford
2015-02-25  4:09 ` Robert Sanford [this message]
2015-02-25  4:09 ` [dpdk-dev] [PATCH v2 3/3] timer: fix rte_timer_reset return value Robert Sanford

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1424837389-56276-3-git-send-email-rsanford2@gmail.com \
    --to=rsanford2@gmail.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).