eal: fix default mempool ops

If '--mbuf-pool-ops' is not passed to EAL as command line argument then
rte_eal_mbuf_default_mempool_ops will return NULL.

Instead check if internal_config.user_mbuf_pool_ops_name is NULL and
return compile time RTE_MBUF_DEFAULT_MEMPOOL_OPS.

Fixes: 8b0f7f43413 ("mbuf: maintain user and compile time mempool ops name")

Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
This commit is contained in:
Pavan Nikhilesh 2018-01-30 21:27:47 +05:30 committed by Thomas Monjalon
parent b0ee28ca12
commit fe06cb6c54
2 changed files with 6 additions and 0 deletions

View File

@ -115,6 +115,9 @@ int rte_cycles_vmware_tsc_map;
const char *
rte_eal_mbuf_default_mempool_ops(void)
{
if (internal_config.user_mbuf_pool_ops_name == NULL)
return RTE_MBUF_DEFAULT_MEMPOOL_OPS;
return internal_config.user_mbuf_pool_ops_name;
}

View File

@ -125,6 +125,9 @@ int rte_cycles_vmware_tsc_map;
const char *
rte_eal_mbuf_default_mempool_ops(void)
{
if (internal_config.user_mbuf_pool_ops_name == NULL)
return RTE_MBUF_DEFAULT_MEMPOOL_OPS;
return internal_config.user_mbuf_pool_ops_name;
}