[dpdk-dev,v3,1/2] test/test: free mempool on exit

Message ID 1491285429-1114-1-git-send-email-hemant.agrawal@nxp.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail Compilation issues

Commit Message

Hemant Agrawal April 4, 2017, 5:57 a.m. UTC
  From: Shreyansh Jain <shreyansh.jain@nxp.com>

mempool autotest was not freeing the mempools.

Fixes: 8ef772ae ("app/test: rework mempool tes")
Cc: stable@dpdk.org

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
---
v3: fix the incorrect split
v2: separte the bug fix from change

 test/test/test_mempool.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
  

Comments

Santosh Shukla April 4, 2017, 3:28 p.m. UTC | #1
Hi Hemant,

[Noticed that my first reply couldn't reach out to ML so re-sending]

On Tuesday 04 April 2017 11:27 AM, Hemant Agrawal wrote:

> From: Shreyansh Jain <shreyansh.jain@nxp.com>
>
> mempool autotest was not freeing the mempools.
>
> Fixes: 8ef772ae ("app/test: rework mempool tes")
> Cc: stable@dpdk.org
>
> Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
> ---
> v3: fix the incorrect split
> v2: separte the bug fix from change
>
>  test/test/test_mempool.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)

Reviewed-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>

> diff --git a/test/test/test_mempool.c b/test/test/test_mempool.c
> index b9880b3..715b250 100644
> --- a/test/test/test_mempool.c
> +++ b/test/test/test_mempool.c
> @@ -509,6 +509,7 @@ static int test_mempool_single_consumer(void)
>  static int
>  test_mempool(void)
>  {
> +	int ret = -1;
>  	struct rte_mempool *mp_cache = NULL;
>  	struct rte_mempool *mp_nocache = NULL;
>  	struct rte_mempool *mp_stack = NULL;
> @@ -607,13 +608,13 @@ static int test_mempool_single_consumer(void)
>  
>  	rte_mempool_list_dump(stdout);
>  
> -	return 0;
> +	ret = 0;
>  
>  err:
>  	rte_mempool_free(mp_nocache);
>  	rte_mempool_free(mp_cache);
>  	rte_mempool_free(mp_stack);
> -	return -1;
> +	return ret;
>  }
>  
>  REGISTER_TEST_COMMAND(mempool_autotest, test_mempool);
  

Patch

diff --git a/test/test/test_mempool.c b/test/test/test_mempool.c
index b9880b3..715b250 100644
--- a/test/test/test_mempool.c
+++ b/test/test/test_mempool.c
@@ -509,6 +509,7 @@  static int test_mempool_single_consumer(void)
 static int
 test_mempool(void)
 {
+	int ret = -1;
 	struct rte_mempool *mp_cache = NULL;
 	struct rte_mempool *mp_nocache = NULL;
 	struct rte_mempool *mp_stack = NULL;
@@ -607,13 +608,13 @@  static int test_mempool_single_consumer(void)
 
 	rte_mempool_list_dump(stdout);
 
-	return 0;
+	ret = 0;
 
 err:
 	rte_mempool_free(mp_nocache);
 	rte_mempool_free(mp_cache);
 	rte_mempool_free(mp_stack);
-	return -1;
+	return ret;
 }
 
 REGISTER_TEST_COMMAND(mempool_autotest, test_mempool);