All of lore.kernel.org
 help / color / mirror / Atom feed
From: santosh <santosh.shukla@caviumnetworks.com>
To: Hemant Agrawal <hemant.agrawal@nxp.com>, olivier.matz@6wind.com
Cc: dev@dpdk.org, shreyansh.jain@nxp.com
Subject: Re: [PATCH v3 2/2] test/test: support default mempool autotest
Date: Wed, 5 Apr 2017 12:32:01 +0530	[thread overview]
Message-ID: <d4cec74d-685e-0f7d-b499-640e1ed39156@caviumnetworks.com> (raw)
In-Reply-To: <1491285429-1114-2-git-send-email-hemant.agrawal@nxp.com>

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

> From: Shreyansh Jain <shreyansh.jain@nxp.com>
>
> Mempool test currently supports:
>  * ring_mp_mc
>  * stack
>
> Adding a new default pool options. So, ring* + stack + default
> (which can be 'stack' or 'ring')
>  * This way, whatever the value of RTE_MBUF_DEFAULT_MEMPOOL_OPS is set,
>    it would be verified.
>  * even if that means duplicating some test (for example when "stack" is
>    set as default and it already part of standard test)
>
> Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
> ---
> v3: fix the incorrect split
> v2: split the fix from change
>
>  test/test/test_mempool.c | 30 ++++++++++++++++++++++++++++++
>  1 file changed, 30 insertions(+)
>
> diff --git a/test/test/test_mempool.c b/test/test/test_mempool.c
> index 715b250..6f0ca84 100644
> --- a/test/test/test_mempool.c
> +++ b/test/test/test_mempool.c
> @@ -513,6 +513,7 @@ static int test_mempool_single_consumer(void)
>  	struct rte_mempool *mp_cache = NULL;
>  	struct rte_mempool *mp_nocache = NULL;
>  	struct rte_mempool *mp_stack = NULL;
> +	struct rte_mempool *default_pool = NULL;
>  
>  	rte_atomic32_init(&synchro);
>  
> @@ -562,6 +563,30 @@ static int test_mempool_single_consumer(void)
>  	}
>  	rte_mempool_obj_iter(mp_stack, my_obj_init, NULL);
>  
> +	/* Create a mempool based on Default handler, if not "stack" */
> +	printf("Testing %s mempool handler\n",
> +	       RTE_MBUF_DEFAULT_MEMPOOL_OPS);
> +	default_pool = rte_mempool_create_empty("default_pool",
> +						MEMPOOL_SIZE,
> +						MEMPOOL_ELT_SIZE,
> +						RTE_MEMPOOL_CACHE_MAX_SIZE, 0,
> +						SOCKET_ID_ANY, 0);
> +
> +	if (default_pool == NULL) {
> +		printf("cannot allocate default mempool\n");
> +		goto err;
> +	}
> +	if (rte_mempool_set_ops_byname(default_pool,
> +				RTE_MBUF_DEFAULT_MEMPOOL_OPS, NULL) < 0) {
> +		printf("cannot set default handler\n");

Few nits:

printf("cannot allocate %s mempool\n",
	RTE_MBUF_DEFAULT_MEMPOOL_OPS)

> +		goto err;
> +	}
> +	if (rte_mempool_populate_default(default_pool) < 0) {
> +		printf("cannot populate default mempool\n");

ditto..

> +		goto err;
> +	}
> +	rte_mempool_obj_iter(default_pool, my_obj_init, NULL);
> +
>  	/* retrieve the mempool from its name */
>  	if (rte_mempool_lookup("test_nocache") != mp_nocache) {
>  		printf("Cannot lookup mempool from its name\n");
> @@ -606,6 +631,9 @@ static int test_mempool_single_consumer(void)
>  	if (test_mempool_basic(mp_stack, 1) < 0)
>  		goto err;
>  
> +	if (test_mempool_basic(default_pool, 1) < 0)
> +		goto err;
> +
>  	rte_mempool_list_dump(stdout);
>  
>  	ret = 0;
> @@ -614,6 +642,8 @@ static int test_mempool_single_consumer(void)
>  	rte_mempool_free(mp_nocache);
>  	rte_mempool_free(mp_cache);
>  	rte_mempool_free(mp_stack);
> +	rte_mempool_free(default_pool);
> +

Rest looks okay to me:
Reviewed-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>

>  	return ret;
>  }
>  

  reply	other threads:[~2017-04-05  7:02 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-31 10:17 [RFC PATCH] test/test: support default mempool autotest Shreyansh Jain
2017-03-31 13:59 ` Olivier Matz
2017-03-31 14:11   ` Hemant Agrawal
2017-03-31 15:11 ` Santosh Shukla
2017-04-03  9:27   ` Hemant Agrawal
2017-04-03  9:00 ` [PATCH v2 1/2] test/test: free mempool on exit Hemant Agrawal
2017-04-03  9:00   ` [PATCH v2 2/2] test/test: support default mempool autotest Hemant Agrawal
2017-04-04  5:57   ` [PATCH v3 1/2] test/test: free mempool on exit Hemant Agrawal
2017-04-04  5:57     ` [PATCH v3 2/2] test/test: support default mempool autotest Hemant Agrawal
2017-04-05  7:02       ` santosh [this message]
2017-04-05  7:21         ` Shreyansh Jain
2017-04-04 15:28     ` [PATCH v3 1/2] test/test: free mempool on exit santosh
2017-04-05  9:35     ` [PATCH v4 " Shreyansh Jain
2017-04-05  9:35       ` [PATCH v4 2/2] test/test: support default mempool autotest Shreyansh Jain
2017-04-07 15:42         ` Olivier Matz
2017-04-19 13:10           ` Thomas Monjalon
2017-04-07 15:42       ` [PATCH v4 1/2] test/test: free mempool on exit Olivier Matz

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=d4cec74d-685e-0f7d-b499-640e1ed39156@caviumnetworks.com \
    --to=santosh.shukla@caviumnetworks.com \
    --cc=dev@dpdk.org \
    --cc=hemant.agrawal@nxp.com \
    --cc=olivier.matz@6wind.com \
    --cc=shreyansh.jain@nxp.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.