Message ID | 1427389025-12507-1-git-send-email-bill.fischofer@linaro.org |
---|---|
State | Accepted |
Commit | 77dfaacd6ad88c1b565224bc3dfcbf1f6f2c2309 |
Headers | show |
It's an RFC because it is both incomplete (it's just the definition of the APIs, but doesn't include the implementation) and is not properly split into separate patches. Now that we have agreement as to the externals, I'll repost this as a proper patch to API-NEXT. Thanks. On Fri, Mar 27, 2015 at 3:29 AM, Savolainen, Petri (Nokia - FI/Espoo) < petri.savolainen@nokia.com> wrote: > RFC needs to be dropped from the subject line before merge (== v4 without > RFC). With that and correction of the doxygen issue below. > > Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com> > > > > -----Original Message----- > > From: lng-odp-bounces@lists.linaro.org [mailto:lng-odp- > > bounces@lists.linaro.org] On Behalf Of ext Bill Fischofer > > Sent: Thursday, March 26, 2015 6:57 PM > > To: petri.savoleinen@linaro.org > > Cc: lng-odp@lists.linaro.org > > Subject: [lng-odp] [RFC API-NEXT PATCHv3] api: packet/pool: proposed APIs > > for packet user metadata > > > > Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org> > > --- > > > > v3 changes: > > - Renamed odp_packet_user_metadata() to odp_packet_user_data() > > - Split addr/size return, adding odp_packet_user_data_size() > > - Moved udata_size to pkt structure within odp_pool_param_t > > > > v2 changes: > > - Moved udata_size to odp_pool_param_t > > - Renamed odp_packet_udata() to odp_packet_user_metadata() > > - Removed odp_buffer_udata(). User metadata is for packets only > > > > RFC for proposed minimal API set for user metadata support > > based on today's discussions. Note that all initialization > > and management of user metadata contents is the responsibility of > > the ODP application. ODP APIs that copy system metadata will also > > copy any associated user metadata as part of that operation, but > > ODP will otherwise ignore these bytes. > > > > include/odp/api/packet.h | 20 ++++++++++++++++++++ > > include/odp/api/pool.h | 4 ++++ > > 2 files changed, 24 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 > > I think the correct doxygen convention is @return + @retval: > > @return Address of the user... > @retval NULL The packet has no ... > > > -Petri > > > > + * @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 > > 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 */ > > -- > > 2.1.0 > > > > > > _______________________________________________ > > lng-odp mailing list > > lng-odp@lists.linaro.org > > http://lists.linaro.org/mailman/listinfo/lng-odp >
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 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 */
Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org> --- v3 changes: - Renamed odp_packet_user_metadata() to odp_packet_user_data() - Split addr/size return, adding odp_packet_user_data_size() - Moved udata_size to pkt structure within odp_pool_param_t v2 changes: - Moved udata_size to odp_pool_param_t - Renamed odp_packet_udata() to odp_packet_user_metadata() - Removed odp_buffer_udata(). User metadata is for packets only RFC for proposed minimal API set for user metadata support based on today's discussions. Note that all initialization and management of user metadata contents is the responsibility of the ODP application. ODP APIs that copy system metadata will also copy any associated user metadata as part of that operation, but ODP will otherwise ignore these bytes. include/odp/api/packet.h | 20 ++++++++++++++++++++ include/odp/api/pool.h | 4 ++++ 2 files changed, 24 insertions(+)