diff options
author | Petri Savolainen <petri.savolainen@nokia.com> | 2016-04-26 13:40:40 +0300 |
---|---|---|
committer | Maxim Uvarov <maxim.uvarov@linaro.org> | 2016-04-27 09:23:57 +0300 |
commit | c65a3c3adb38a38ac4b49bd7c5d62c9bb5fe61e2 (patch) | |
tree | f73a2eca860599a0b36ff6978f5227a1027c064d | |
parent | 1a2024cc0f7238214afc44fb614e8526c7a8f9e4 (diff) |
api: pool: add pool capability
Introduce pool capability structure as preparation for removing
pool and segmentation definitions from odp_config.h.
Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com>
Reviewed-and-tested-by: Bill Fischofer <bill.fischofer@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
-rw-r--r-- | include/odp/api/spec/pool.h | 114 |
1 files changed, 114 insertions, 0 deletions
diff --git a/include/odp/api/spec/pool.h b/include/odp/api/spec/pool.h index 87a194ce..cf4dd788 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 |