[v6,5/7] app/testpmd: set preferred mempool as default pktpool

Message ID 1516629083-13967-6-git-send-email-hemant.agrawal@nxp.com
State New
Headers show
Series
  • Dynamic HW Mempool Detection Support
Related show

Commit Message

Hemant Agrawal Jan. 22, 2018, 1:51 p.m.
From: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>


Set the mempool preferred by the ethernet devices as default mbuf
mempool before creating the pktpool.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>

Reviewed-by: Olivier Matz <olivier.matz@6wind.com>

---
 app/test-pmd/testpmd.c | 3 +++
 1 file changed, 3 insertions(+)

-- 
2.7.4

Comments

Thomas Monjalon Jan. 25, 2018, 10:04 p.m. | #1
22/01/2018 14:51, Hemant Agrawal:
> From: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>

> 

> Set the mempool preferred by the ethernet devices as default mbuf

> mempool before creating the pktpool.


The patch is just adding a log.
Something is not consistent.
Hemant Agrawal Jan. 26, 2018, 5:11 a.m. | #2
> -----Original Message-----

> From: Thomas Monjalon [mailto:thomas@monjalon.net]

> 

> 22/01/2018 14:51, Hemant Agrawal:

> > From: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>

> >

> > Set the mempool preferred by the ethernet devices as default mbuf

> > mempool before creating the pktpool.

> 

> The patch is just adding a log.

> Something is not consistent.


[Hemant] 
Yes, this is intentional to know the chosen buffer pool name in testpmd logs.
Thomas Monjalon Jan. 26, 2018, 7:43 a.m. | #3
26/01/2018 06:11, Hemant Agrawal:
> 

> > -----Original Message-----

> > From: Thomas Monjalon [mailto:thomas@monjalon.net]

> > 

> > 22/01/2018 14:51, Hemant Agrawal:

> > > From: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>

> > >

> > > Set the mempool preferred by the ethernet devices as default mbuf

> > > mempool before creating the pktpool.

> > 

> > The patch is just adding a log.

> > Something is not consistent.

> 

> [Hemant] 

> Yes, this is intentional to know the chosen buffer pool name in testpmd logs.


The title and the commit log suggest something else.
Please adjust them to the patch content.

Patch

diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 5dc8cca..d8ac432 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -38,6 +38,7 @@ 
 #include <rte_mempool.h>
 #include <rte_malloc.h>
 #include <rte_mbuf.h>
+#include <rte_mbuf_pool_ops.h>
 #include <rte_interrupts.h>
 #include <rte_pci.h>
 #include <rte_ether.h>
@@ -499,6 +500,8 @@  mbuf_pool_create(uint16_t mbuf_seg_size, unsigned nb_mbuf,
 		rte_mempool_obj_iter(rte_mp, rte_pktmbuf_init, NULL);
 	} else {
 		/* wrapper to rte_mempool_create() */
+		TESTPMD_LOG(INFO, "preferred mempool ops selected: %s\n",
+				rte_mbuf_best_mempool_ops());
 		rte_mp = rte_pktmbuf_pool_create(pool_name, nb_mbuf,
 			mb_mempool_cache, 0, mbuf_seg_size, socket_id);
 	}