diff mbox series

[v2] app/pdump: enforcing pdump to use sw mempool

Message ID 1562341193-19641-1-git-send-email-hkalra@marvell.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers show
Series [v2] app/pdump: enforcing pdump to use sw mempool | expand

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/mellanox-Performance-Testing success Performance Testing PASS
ci/intel-Performance-Testing success Performance Testing PASS
ci/Intel-compilation fail apply issues

Commit Message

Harman Kalra July 5, 2019, 3:40 p.m. UTC
A secondary process cannot access HW mempool already
initiazed by primary, and neither it can setup its own
HW mempool due to its own restrictions.

Since dpdk-pdump creates mempool for managing its local
mbufs, SW mempool is capable enough to solve this purpose.

Signed-off-by: Harman Kalra <hkalra@marvell.com>
---
 app/pdump/main.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Olivier Matz July 5, 2019, 3:50 p.m. UTC | #1
hi,

On Fri, Jul 05, 2019 at 03:40:20PM +0000, Harman Kalra wrote:
> A secondary process cannot access HW mempool already
> initiazed by primary, and neither it can setup its own
> HW mempool due to its own restrictions.
> 
> Since dpdk-pdump creates mempool for managing its local
> mbufs, SW mempool is capable enough to solve this purpose.
> 
> Signed-off-by: Harman Kalra <hkalra@marvell.com>
> ---
>  app/pdump/main.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/app/pdump/main.c b/app/pdump/main.c
> index 80dc924cf..c739ae43d 100644
> --- a/app/pdump/main.c
> +++ b/app/pdump/main.c
> @@ -604,11 +604,12 @@ create_mp_ring_vdev(void)
>  		mbuf_pool = rte_mempool_lookup(mempool_name);
>  		if (mbuf_pool == NULL) {
>  			/* create mempool */
> -			mbuf_pool = rte_pktmbuf_pool_create(mempool_name,
> +			mbuf_pool = rte_pktmbuf_pool_create_by_ops(mempool_name,
>  					pt->total_num_mbufs,
>  					MBUF_POOL_CACHE_SIZE, 0,
>  					pt->mbuf_data_size,
> -					rte_socket_id());
> +					rte_socket_id(),
> +					RTE_MBUF_DEFAULT_MEMPOOL_OPS);
>  			if (mbuf_pool == NULL) {
>  				cleanup_rings();
>  				rte_exit(EXIT_FAILURE,
> -- 
> 2.18.0
> 

Did you see the comment in my previous mail?

"""
I think it would be safer to use "ring_mp_mc" instead of
CONFIG_RTE_MBUF_DEFAULT_MEMPOOL_OPS, because the latter could be
overriden on a specific platform.
"""

Thanks,
Olivier
diff mbox series

Patch

diff --git a/app/pdump/main.c b/app/pdump/main.c
index 80dc924cf..c739ae43d 100644
--- a/app/pdump/main.c
+++ b/app/pdump/main.c
@@ -604,11 +604,12 @@  create_mp_ring_vdev(void)
 		mbuf_pool = rte_mempool_lookup(mempool_name);
 		if (mbuf_pool == NULL) {
 			/* create mempool */
-			mbuf_pool = rte_pktmbuf_pool_create(mempool_name,
+			mbuf_pool = rte_pktmbuf_pool_create_by_ops(mempool_name,
 					pt->total_num_mbufs,
 					MBUF_POOL_CACHE_SIZE, 0,
 					pt->mbuf_data_size,
-					rte_socket_id());
+					rte_socket_id(),
+					RTE_MBUF_DEFAULT_MEMPOOL_OPS);
 			if (mbuf_pool == NULL) {
 				cleanup_rings();
 				rte_exit(EXIT_FAILURE,