[dpdk-dev] The type string in the malloc library is unused
mb at smartsharesystems.com
Fri Sep 13 15:32:25 CEST 2019
The functions in the DPDK malloc library takes a "type" parameter (a string, supposedly for debug purposes), but the underlying malloc_heap functions (which take the same string parameter) don't store or use this string for anything.
Is the intention to implement this sometime in the future, or should it be considered for removal?
I was originally looking for a function for my primary process to allocate a block of named memory in the huge-page area, so my secondary process could look it up and use it. And I would simply use a unique type string for this, and add an rte_malloc_lookup function. However, that obviously doesn't work when the type parameter is not used during allocation.
The simplest workaround I can come up with is using a named mempool with a single element, where this element is my memory block. I get an element from this mempool to find the address of my memory block, store the address, and put the element back in the mempool, so the secondary process can get the address the same way, i.e. by getting and putting the element back into the mempool while storing the element's address underway.
Any better ideas?
Med venlig hilsen / kind regards
SmartShare Systems A/S
Office +45 70 20 00 93
Direct +45 89 93 50 22
Mobile +45 25 40 82 12
mb at smartsharesystems.com <mailto:mb at smartsharesystems.com>
More information about the dev