On 16 April 2015 at 13:40, Savolainen, Petri (Nokia - FI/Espoo) <
petri.savolai...@nokia.com> wrote:

>
>
> > -----Original Message-----
> > From: lng-odp [mailto:lng-odp-boun...@lists.linaro.org] On Behalf Of ext
> > Taras Kondratiuk
> > Sent: Thursday, April 16, 2015 12:05 PM
> > To: Bill Fischofer; lng-odp@lists.linaro.org
> > Subject: Re: [lng-odp] [API-NEXT PATCHv4 1/6] api: packet: add user
> > metadata APIs
> >
> > On 04/10/2015 06:52 PM, Bill Fischofer wrote:
> > > Signed-off-by: Bill Fischofer <bill.fischo...@linaro.org>
> > > ---
> > >   include/odp/api/packet.h | 20 ++++++++++++++++++++
> > >   1 file changed, 20 insertions(+)
> > >
> > > diff --git a/include/odp/api/packet.h b/include/odp/api/packet.h
> > > index a31c54d..840e152 100644
> > > --- a/include/odp/api/packet.h
> > > +++ b/include/odp/api/packet.h
> > > @@ -467,6 +467,26 @@ uint64_t odp_packet_user_u64(odp_packet_t pkt);
> > >   void odp_packet_user_u64_set(odp_packet_t pkt, uint64_t ctx);
> > >
> > >   /**
> > > + * Get address of user metadata associated with a packet
> > > + *
> > > + * @param pkt             Packet handle
> > > + *
> > > + * @retval addr           Address of the user metadata associated with
> > pkt
> > > + * @retval NULL           The packet has no user metadata.
> > > + */
> > > +void *odp_packet_user_data(odp_packet_t pkt);
> > > +
> > > +/**
> > > + * Get size of user metadata associated with a packet
> > > + *
> > > + * @param pkt             Packet handle
> > > + *
> > > + * @return                Number of bytes of user metadata associated
> > > + *                        with pkt.
> > > + */
> > > +uint32_t odp_packet_user_data_size(odp_packet_t pkt);
> > > +
> > > +/**
> > >    * Layer 2 start pointer
> > >    *
> > >    * Returns pointer to the start of the layer 2 header. Optionally,
> > outputs
> > >
> >
> > I assume usage of user_data, user_ptr and user_u64 are all mutually
> > exclusive. I mean the same memory location can be used to store all of
> > them. It should be noted somewhere.
>
> I was thinking this as a separate area, but maybe it's clearer that we
> have only one user metadata area, which is always at least 8 bytes
> (user_ptr / user_64).

This could be the public concept (as defined by the ODP API).


> An additional area is allocated, when user requests pool_param.udata_size
> >8 bytes. Implementation can always reserve 8 bytes in the descriptor and
> use the same bytes for the pointer to a larger udata area.
>
This is a potential implementation. I don't think this should be part of
the public API. Maybe documented in the implementation notes for those
platforms that use this implementation.


>
> -Petri
>
> > _______________________________________________
> > lng-odp mailing list
> > lng-odp@lists.linaro.org
> > https://lists.linaro.org/mailman/listinfo/lng-odp
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> https://lists.linaro.org/mailman/listinfo/lng-odp
>
_______________________________________________
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to