[dpdk-dev] rte_malloc_heap usage scenario

Sergio Gonzalez Monroy sergio.gonzalez.monroy at intel.com
Tue Mar 14 12:53:53 CET 2017

On 09/03/2017 04:48, Yerden Zhumabekov wrote:
> Hello,
> Can anybody explain why rte_malloc_heap.h is advertised as a public 
> interface? It only contains malloc_heap struct which is used 
> internally and violates DPDK naming conventions for public struct. I 
> haven't found any use of it outside of EAL and it's undocumented. If 
> it is in fact public, will it continue to be?

As you point out, the struct name does not follow dpdk conventions for 
public structs, that is how it was historically and was never changed.
IMHO the struct itself is not meant to be public (probably we should add 
some comments) but it needs to be as it is a field in public 'struct 
rte_mem_config' which is also a field in public 'struct rte_config'.

That being said, it doesn't look like rte_mem_config should be a public 
struct at all, although there are a couple of PMDs (virtio_user and ena) 
accessing mem_config info through rte_config.

I cannot guarantee that would remain public, but there should be at 
least a notice in case of any changes.


> I'd like to use it (and some code in librte_eal/common) for 
> region-based allocation in a secondary process for easy memory 
> reclamation in case of failure. Is it safe to reuse malloc_heap struct?

More information about the dev mailing list