DPDK patches and discussions
 help / color / mirror / Atom feed
From: Jerin Jacob <jerin.jacob@caviumnetworks.com>
To: dev@dpdk.org
Cc: olivier.matz@6wind.com, Jerin Jacob <jerin.jacob@caviumnetworks.com>
Subject: [dpdk-dev] [PATCH v2] test/mempool: improve default mempool ops selection
Date: Tue,  9 Jan 2018 21:27:08 +0530	[thread overview]
Message-ID: <20180109155708.20109-1-jerin.jacob@caviumnetworks.com> (raw)
In-Reply-To: <20171117180703.4085-1-jerin.jacob@caviumnetworks.com>

Use of rte_eal_mbuf_default_mempool_ops() API will
allow to override pool handler through "--mbuf-pool-ops-name"
eal command line argument.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
---
v2:
- Added a local variable to store the rte_eal_mbuf_default_mempool_ops()
to use across the file(Olivier)
---
 test/test/test_mempool.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/test/test/test_mempool.c b/test/test/test_mempool.c
index 4a3f4ae45..f39df5aa6 100644
--- a/test/test/test_mempool.c
+++ b/test/test/test_mempool.c
@@ -485,6 +485,7 @@ test_mempool(void)
 	struct rte_mempool *mp_nocache = NULL;
 	struct rte_mempool *mp_stack = NULL;
 	struct rte_mempool *default_pool = NULL;
+	const char *default_pool_ops = rte_eal_mbuf_default_mempool_ops();
 
 	rte_atomic32_init(&synchro);
 
@@ -535,8 +536,7 @@ test_mempool(void)
 	rte_mempool_obj_iter(mp_stack, my_obj_init, NULL);
 
 	/* Create a mempool based on Default handler */
-	printf("Testing %s mempool handler\n",
-	       RTE_MBUF_DEFAULT_MEMPOOL_OPS);
+	printf("Testing %s mempool handler\n", default_pool_ops);
 	default_pool = rte_mempool_create_empty("default_pool",
 						MEMPOOL_SIZE,
 						MEMPOOL_ELT_SIZE,
@@ -548,14 +548,12 @@ test_mempool(void)
 		goto err;
 	}
 	if (rte_mempool_set_ops_byname(default_pool,
-				RTE_MBUF_DEFAULT_MEMPOOL_OPS, NULL) < 0) {
-		printf("cannot set %s handler\n",
-			RTE_MBUF_DEFAULT_MEMPOOL_OPS);
+				default_pool_ops, NULL) < 0) {
+		printf("cannot set %s handler\n", default_pool_ops);
 		goto err;
 	}
 	if (rte_mempool_populate_default(default_pool) < 0) {
-		printf("cannot populate %s mempool\n",
-			RTE_MBUF_DEFAULT_MEMPOOL_OPS);
+		printf("cannot populate %s mempool\n", default_pool_ops);
 		goto err;
 	}
 	rte_mempool_obj_iter(default_pool, my_obj_init, NULL);
-- 
2.15.1

  parent reply	other threads:[~2018-01-09 15:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-17 18:07 [dpdk-dev] [PATCH] " Jerin Jacob
2017-12-12 14:21 ` Olivier MATZ
2017-12-12 15:10 ` santosh
2018-01-09 15:57 ` Jerin Jacob [this message]
2018-01-16 14:25   ` [dpdk-dev] [PATCH v2] " Olivier Matz
2018-01-18 14:09     ` Thomas Monjalon

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=20180109155708.20109-1-jerin.jacob@caviumnetworks.com \
    --to=jerin.jacob@caviumnetworks.com \
    --cc=dev@dpdk.org \
    --cc=olivier.matz@6wind.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 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).