> -----Original Message----- > From: lng-odp [mailto:[email protected]] On Behalf Of ext > Zoltan Kiss > Sent: Thursday, April 16, 2015 9:17 PM > To: Taras Kondratiuk; [email protected] > Subject: Re: [lng-odp] Raw buffer used size > > > > On 16/04/15 17:11, Taras Kondratiuk wrote: > > On 04/16/2015 06:00 PM, Zoltan Kiss wrote: > >> Hi, > >> > >> I've noticed that a buffer allocated from a ODP_POOL_BUFFER type of > pool > >> doesn't have any means to store how much of the data there is actually > >> used. You can see how big is the reserved area and at what address it > >> starts, but no way to maintain this information. Packet buffers support > >> that by odp_packet_(seg_)len and pushing/pulling tail and head. I know > >> raw buffers are supposed to stay simple, but isn't this a little bit > too > >> simple? > > > > There is no notion of 'used' space in odp_buffer_t. It is a simple > > memory block. All space is 'used'. I don't think there is a need for > > something more complex. > > > > What use-case do you have in mind? > > Nothing special, just started to think because the DPDK relative of raw > buffers (control buffers) have this notion. > > Zoli
The idea is to keep (raw) buffers as simple as possible, so that (HW) implementation is very efficient and usage may vary on wide range e.g. general block memory allocation (instead of malloc), packet/queue/etc context memory (alloc/free per packet), application internal messaging, ... When used for messaging the application itself adds a message header, which could include the message length, etc fields. If more features are needed (e.g. for messaging) we can add a new event type (odp_msg_t), which e.g. has support for data length, copy, chaining, etc. -Petri _______________________________________________ lng-odp mailing list [email protected] https://lists.linaro.org/mailman/listinfo/lng-odp
