Signed-off-by: Bill Fischofer <[email protected]>
---

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 | 12 ++++++++++++
 include/odp/api/pool.h   |  4 +++-
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/include/odp/api/packet.h b/include/odp/api/packet.h
index a31c54d..28182cc 100644
--- a/include/odp/api/packet.h
+++ b/include/odp/api/packet.h
@@ -467,6 +467,18 @@ 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 and size of user metadata associated with a packet
+ *
+ * @param pkt             Packet handle
+ * @param udata_size[out] Number of bytes of user metadata available
+ *                        at the returned address.  If supplied address
+ *                        is NULL on input, no size is returned.
+ * @return                Address of the usermeta data for this packet
+ *                        or NULL if the packet has no user metadata.
+ */
+void *odp_packet_user_metadata(odp_packet_t pkt, uint32_t *udata_size);
+
+/**
  * 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..47a50fe 100644
--- a/include/odp/api/pool.h
+++ b/include/odp/api/pool.h
@@ -82,7 +82,9 @@ typedef struct odp_pool_param_t {
                } tmo;
        };

-       int type;  /**< Pool type */
+       int type;         /**< Pool type */
+       int udata_size;   /**< User metadata size in bytes.  Applicable only
+                            for type ODP_POOL_PACKET, ignored otherwise */
 } odp_pool_param_t;

 /** Packet pool*/
--
2.1.0

_______________________________________________
lng-odp mailing list
[email protected]
http://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to