[dpdk-dev] The type string in the malloc library is unused

Morten Brørup mb at smartsharesystems.com
Sat Sep 14 09:06:04 CEST 2019


Hi Alexander,

That was exactly what I was looking for, thanks!

Med venlig hilsen / kind regards
- Morten Brørup

> -----Original Message-----
> From: Alexander Pshenichnikov [mailto:apshen at gmail.com]
> Sent: Friday, September 13, 2019 9:38 PM
> To: Morten Brørup
> Cc: Anatoly Burakov; Olivier Matz; Andrew Rybchenko; dev at dpdk.org
> Subject: Re: [dpdk-dev] The type string in the malloc library is unused
> 
> Hi Morten,
> 
> Look rte_memzone_reserve/rte_memzone_lookup
> 
> 
> 
> On Fri, Sep 13, 2019 at 4:32 PM Morten Brørup <mb at smartsharesystems.com>
> wrote:
> >
> > Hi Anatoly,
> >
> >
> >
> > 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
> >
> >
> >
> > Morten Brørup
> >
> > CTO
> >
> >
> >
> >
> >
> > SmartShare Systems A/S
> >
> > Tonsbakken 16-18
> >
> > DK-2740 Skovlunde
> >
> > Denmark
> >
> >
> >
> > 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>
> >
> > www.smartsharesystems.com <https://www.smartsharesystems.com/>
> >
> >
> >



More information about the dev mailing list