[dpdk-stable] patch 'test/mempool: fix autotest retry' has been queued to LTS release 17.11.3

Yuanhan Liu yliu at fridaylinux.org
Sun May 6 08:36:24 CEST 2018


Hi,

FYI, your patch has been queued to LTS release 17.11.3

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/09/18. So please
shout if anyone has objections.

Thanks.

	--yliu

---
>From cc8e68493a1266a746bfe21ea19eaaec0627a729 Mon Sep 17 00:00:00 2001
From: Andrew Rybchenko <arybchenko at solarflare.com>
Date: Wed, 25 Apr 2018 18:00:37 +0100
Subject: [PATCH] test/mempool: fix autotest retry

[ upstream commit 2d645858a93e21a41e84928d4fb869318c3639a6 ]

Single producer / single consumer mempool handle is stored in static
variable and the mempool allocated if stored value is NULL.
If the mempool is freed, NULL should be restored to make sure that
the mempool is allocated once again next time when the test is run.

Fixes: 8ef772aee072 ("app/test: rework mempool test")

Signed-off-by: Andrew Rybchenko <arybchenko at solarflare.com>
---
 test/test/test_mempool.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/test/test/test_mempool.c b/test/test/test_mempool.c
index 37ead503b..56b0fd022 100644
--- a/test/test/test_mempool.c
+++ b/test/test/test_mempool.c
@@ -355,17 +355,17 @@ test_mempool_sp_sc(void)
 	}
 	if (rte_mempool_lookup("test_mempool_sp_sc") != mp_spsc) {
 		printf("Cannot lookup mempool from its name\n");
-		rte_mempool_free(mp_spsc);
-		RET_ERR();
+		ret = -1;
+		goto err;
 	}
 	lcore_next = rte_get_next_lcore(lcore_id, 0, 1);
 	if (lcore_next >= RTE_MAX_LCORE) {
-		rte_mempool_free(mp_spsc);
-		RET_ERR();
+		ret = -1;
+		goto err;
 	}
 	if (rte_eal_lcore_role(lcore_next) != ROLE_RTE) {
-		rte_mempool_free(mp_spsc);
-		RET_ERR();
+		ret = -1;
+		goto err;
 	}
 	rte_spinlock_init(&scsp_spinlock);
 	memset(scsp_obj_table, 0, sizeof(scsp_obj_table));
@@ -376,7 +376,10 @@ test_mempool_sp_sc(void)
 
 	if (rte_eal_wait_lcore(lcore_next) < 0)
 		ret = -1;
+
+err:
 	rte_mempool_free(mp_spsc);
+	mp_spsc = NULL;
 
 	return ret;
 }
-- 
2.11.0



More information about the stable mailing list