[dpdk-dev,v2] test/mempool: improve default mempool ops selection
diff mbox

Message ID 20180109155708.20109-1-jerin.jacob@caviumnetworks.com
State Accepted, archived
Delegated to: Thomas Monjalon
Headers show

Checks

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

Commit Message

Jerin Jacob Jan. 9, 2018, 3:57 p.m. UTC
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(-)

Comments

Olivier Matz Jan. 16, 2018, 2:25 p.m. UTC | #1
On Tue, Jan 09, 2018 at 09:27:08PM +0530, Jerin Jacob wrote:
> 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>

Acked-by: Olivier Matz <olivier.matz@6wind.com>
Thomas Monjalon Jan. 18, 2018, 2:09 p.m. UTC | #2
16/01/2018 15:25, Olivier Matz:
> On Tue, Jan 09, 2018 at 09:27:08PM +0530, Jerin Jacob wrote:
> > 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>
> 
> Acked-by: Olivier Matz <olivier.matz@6wind.com>

Applied, thanks

Patch
diff mbox

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