Introduce pool capability structure as preparation for removing
pool and segmentation definitions from odp_config.h.

Signed-off-by: Petri Savolainen <[email protected]>
---
 include/odp/api/spec/pool.h | 114 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 114 insertions(+)

diff --git a/include/odp/api/spec/pool.h b/include/odp/api/spec/pool.h
index 87a194c..cf4dd78 100644
--- a/include/odp/api/spec/pool.h
+++ b/include/odp/api/spec/pool.h
@@ -40,6 +40,120 @@ extern "C" {
 #define ODP_POOL_NAME_LEN  32
 
 /**
+ * Pool capabilities
+ */
+typedef struct odp_pool_capability_t {
+       /** Maximum number of pools of any type */
+       unsigned max_pools;
+
+       /** Buffer pool capabilities  */
+       struct {
+               /** Maximum number of buffer pools */
+               unsigned max_pools;
+
+               /** Maximum buffer data alignment in bytes */
+               uint32_t max_align;
+
+               /** Maximum buffer data size in bytes
+                *
+                * The value of zero means that size is limited only by the
+                * available memory size for the pool. */
+               uint32_t max_size;
+
+               /** Maximum number of buffers of any size
+                *
+                * The value of zero means that limited only by the available
+                * memory size for the pool. */
+               uint32_t max_num;
+       } buf;
+
+       /** Packet pool capabilities  */
+       struct {
+               /** Maximum number of packet pools */
+               unsigned max_pools;
+
+               /** Maximum packet data length in bytes
+                *
+                * This defines the maximum packet data length that can be
+                * stored into a packet. Attempts to allocate or extend packets
+                * to sizes larger than this limit will fail.
+                *
+                * The value of zero means that limited only by the available
+                * memory size for the pool. */
+               uint32_t max_len;
+
+               /** Maximum number of packets of any length
+                *
+                * The value of zero means that limited only by the available
+                * memory size for the pool. */
+               uint32_t max_num;
+
+               /** Minimum packet level headroom length in bytes
+                *
+                * The minimum number of headroom bytes that newly created
+                * packets have by default. The default apply to both ODP
+                * packet input and user allocated packets.*/
+               uint32_t min_headroom;
+
+               /** Minimum packet level tailroom length in bytes
+                *
+                * The minimum number of tailroom bytes that newly created
+                * packets have by default. The default apply to both ODP
+                * packet input and user allocated packets.*/
+               uint32_t min_tailroom;
+
+               /** Maximum number of segments per packet */
+               uint32_t max_segs_per_pkt;
+
+               /** Minimum packet segment data length in bytes
+                *
+                * The user defined segment length (seg_len in
+                * odp_pool_param_t) will be rounded up into this value. */
+               uint32_t min_seg_len;
+
+               /** Maximum packet segment data length in bytes
+                *
+                * The user defined segment length (seg_len in odp_pool_param_t)
+                * must not be larger than this.
+                *
+                * The value of zero means that limited only by the available
+                * memory size for the pool. */
+               uint32_t max_seg_len;
+
+               /** Maximum user area size in bytes
+                *
+                * The value of zero means that limited only by the available
+                * memory size for the pool. */
+               uint32_t max_uarea_size;
+       } pkt;
+
+       /** Timeout pool capabilities  */
+       struct {
+               /** Maximum number of timeout pools */
+               unsigned max_pools;
+
+               /** Maximum number of timeout events in a pool
+                *
+                * The value of zero means that limited only by the available
+                * memory size for the pool. */
+               uint32_t max_num;
+       } tmo;
+
+} odp_pool_capability_t;
+
+/**
+ * Query pool capabilities
+ *
+ * Outputs pool capabilities on success.
+ *
+ * @param[out] capa   Pointer to capability structure for output
+ *
+ * @retval 0 on success
+ * @retval <0 on failure
+ */
+int odp_pool_capability(odp_pool_capability_t *capa);
+
+/**
  * Pool parameters
  * Used to communicate pool creation options.
  * @note A single thread may not be able to allocate all 'num' elements
-- 
2.8.1

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

Reply via email to