diff mbox

[API-NEXT,PATCHv4,2/6] api: pool: add user metadata APIs

Message ID 1428681138-24954-3-git-send-email-bill.fischofer@linaro.org
State New
Headers show

Commit Message

Bill Fischofer April 10, 2015, 3:52 p.m. UTC
Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org>
---
 include/odp/api/pool.h | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Ciprian Barbu April 16, 2015, 8:47 a.m. UTC | #1
On Fri, Apr 10, 2015 at 6:52 PM, Bill Fischofer
<bill.fischofer@linaro.org> wrote:
> Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org>
> ---
>  include/odp/api/pool.h | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/include/odp/api/pool.h b/include/odp/api/pool.h
> index 241b98a..0092132 100644
> --- a/include/odp/api/pool.h
> +++ b/include/odp/api/pool.h
> @@ -76,6 +76,10 @@ typedef struct odp_pool_param_t {
>                                                  The maximum value is defined by
>                                                  ODP_CONFIG_PACKET_SEG_LEN_MAX.
>                                                  Use 0 for default. */
> +                       uint32_t udata_size; /**< User metadata size in
> +                                               bytes. Specify as 0 if no
> +                                               user metadata is to be
> +                                               associated with the pkt */

indentation nit: missing spaces after tab

>                 } pkt;
>                 struct {
>                         uint32_t num;    /**< Number of timeouts in the pool */
> --
> 2.1.0
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> https://lists.linaro.org/mailman/listinfo/lng-odp
Taras Kondratiuk April 16, 2015, 9:06 a.m. UTC | #2
On 04/10/2015 06:52 PM, Bill Fischofer wrote:
> Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org>
> ---
>   include/odp/api/pool.h | 4 ++++
>   1 file changed, 4 insertions(+)
>
> diff --git a/include/odp/api/pool.h b/include/odp/api/pool.h
> index 241b98a..0092132 100644
> --- a/include/odp/api/pool.h
> +++ b/include/odp/api/pool.h
> @@ -76,6 +76,10 @@ typedef struct odp_pool_param_t {
>   						 The maximum value is defined by
>   						 ODP_CONFIG_PACKET_SEG_LEN_MAX.
>   						 Use 0 for default. */
> +			uint32_t udata_size; /**< User metadata size in
> +						bytes. Specify as 0 if no
> +						user metadata is to be
> +						associated with the pkt */

Should it be a minimum size of metadata? Implementation may round it up.

>   		} pkt;
>   		struct {
>   			uint32_t num;    /**< Number of timeouts in the pool */
>
Ola Liljedahl April 16, 2015, 2:18 p.m. UTC | #3
On 16 April 2015 at 13:44, Savolainen, Petri (Nokia - FI/Espoo) <
petri.savolainen@nokia.com> wrote:

>
>
> > -----Original Message-----
> > From: lng-odp [mailto:lng-odp-bounces@lists.linaro.org] On Behalf Of ext
> > Taras Kondratiuk
> > Sent: Thursday, April 16, 2015 12:07 PM
> > To: Bill Fischofer; lng-odp@lists.linaro.org
> > Subject: Re: [lng-odp] [API-NEXT PATCHv4 2/6] api: pool: add user
> metadata
> > APIs
> >
> > On 04/10/2015 06:52 PM, Bill Fischofer wrote:
> > > Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org>
> > > ---
> > >   include/odp/api/pool.h | 4 ++++
> > >   1 file changed, 4 insertions(+)
> > >
> > > diff --git a/include/odp/api/pool.h b/include/odp/api/pool.h
> > > index 241b98a..0092132 100644
> > > --- a/include/odp/api/pool.h
> > > +++ b/include/odp/api/pool.h
> > > @@ -76,6 +76,10 @@ typedef struct odp_pool_param_t {
> > >                                              The maximum value is
> defined by
> > >
> ODP_CONFIG_PACKET_SEG_LEN_MAX.
> > >                                              Use 0 for default. */
> > > +                   uint32_t udata_size; /**< User metadata size in
> > > +                                           bytes. Specify as 0 if no
> > > +                                           user metadata is to be
> > > +                                           associated with the pkt */
> >
> > Should it be a minimum size of metadata? Implementation may round it up.
>
> Agree. No harm to let implementation to round it up.
>
The implementation does what it has to do (in order to work, in order to be
efficient etc). The question is what is returned when you ask for the size
of the user data. I say that the implementation should then return the
specified size, not any rounded size. So any rounding would not be directly
visible to the user.



>
> -Petri
>
> >
> > >             } pkt;
> > >             struct {
> > >                     uint32_t num;    /**< Number of timeouts in the
> pool */
> > >
> >
> > _______________________________________________
> > 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
>
Bill Fischofer April 19, 2015, 9:43 p.m. UTC | #4
The posted patch aligns the requested user metadata to a multiple of 8
bytes and in fact rounds the requested size to a multiple of 8 as well.
The size returned by odp_packet_user_data_size() is the actual byte size
requested, however.

On Thu, Apr 16, 2015 at 7:18 AM, Ola Liljedahl <ola.liljedahl@linaro.org>
wrote:

> On 16 April 2015 at 13:44, Savolainen, Petri (Nokia - FI/Espoo) <
> petri.savolainen@nokia.com> wrote:
>
>>
>>
>> > -----Original Message-----
>> > From: lng-odp [mailto:lng-odp-bounces@lists.linaro.org] On Behalf Of
>> ext
>> > Taras Kondratiuk
>> > Sent: Thursday, April 16, 2015 12:07 PM
>> > To: Bill Fischofer; lng-odp@lists.linaro.org
>> > Subject: Re: [lng-odp] [API-NEXT PATCHv4 2/6] api: pool: add user
>> metadata
>> > APIs
>> >
>> > On 04/10/2015 06:52 PM, Bill Fischofer wrote:
>> > > Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org>
>> > > ---
>> > >   include/odp/api/pool.h | 4 ++++
>> > >   1 file changed, 4 insertions(+)
>> > >
>> > > diff --git a/include/odp/api/pool.h b/include/odp/api/pool.h
>> > > index 241b98a..0092132 100644
>> > > --- a/include/odp/api/pool.h
>> > > +++ b/include/odp/api/pool.h
>> > > @@ -76,6 +76,10 @@ typedef struct odp_pool_param_t {
>> > >                                              The maximum value is
>> defined by
>> > >
>> ODP_CONFIG_PACKET_SEG_LEN_MAX.
>> > >                                              Use 0 for default. */
>> > > +                   uint32_t udata_size; /**< User metadata size in
>> > > +                                           bytes. Specify as 0 if no
>> > > +                                           user metadata is to be
>> > > +                                           associated with the pkt */
>> >
>> > Should it be a minimum size of metadata? Implementation may round it up.
>>
>> Agree. No harm to let implementation to round it up.
>>
> The implementation does what it has to do (in order to work, in order to
> be efficient etc). The question is what is returned when you ask for the
> size of the user data. I say that the implementation should then return the
> specified size, not any rounded size. So any rounding would not be directly
> visible to the user.
>
>
>
>>
>> -Petri
>>
>> >
>> > >             } pkt;
>> > >             struct {
>> > >                     uint32_t num;    /**< Number of timeouts in the
>> pool */
>> > >
>> >
>> > _______________________________________________
>> > 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
>>
>
>
diff mbox

Patch

diff --git a/include/odp/api/pool.h b/include/odp/api/pool.h
index 241b98a..0092132 100644
--- a/include/odp/api/pool.h
+++ b/include/odp/api/pool.h
@@ -76,6 +76,10 @@  typedef struct odp_pool_param_t {
 						 The maximum value is defined by
 						 ODP_CONFIG_PACKET_SEG_LEN_MAX.
 						 Use 0 for default. */
+			uint32_t udata_size; /**< User metadata size in
+						bytes. Specify as 0 if no
+						user metadata is to be
+						associated with the pkt */
 		} pkt;
 		struct {
 			uint32_t num;    /**< Number of timeouts in the pool */