From: EXT Bill Fischofer [mailto:bill.fischo...@linaro.org]
Sent: Tuesday, April 26, 2016 1:42 AM
To: Savolainen, Petri (Nokia - FI/Espoo) <petri.savolai...@nokia.com>
Cc: LNG ODP Mailman List <lng-odp@lists.linaro.org>
Subject: Re: [lng-odp] [API-NEXT PATCH 1/6] api: pool: add pool capability



On Mon, Apr 25, 2016 at 11:36 AM, Petri Savolainen 
<petri.savolai...@nokia.com<mailto:petri.savolai...@nokia.com>> wrote:
Introduce pool capability structure as preparation for removing
pool and segmentation definitions from odp_config.h.

Signed-off-by: Petri Savolainen 
<petri.savolai...@nokia.com<mailto:petri.savolai...@nokia.com>>
---
 include/odp/api/spec/pool.h | 113 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 113 insertions(+)

diff --git a/include/odp/api/spec/pool.h b/include/odp/api/spec/pool.h
index 87a194c..64ae86e 100644
--- a/include/odp/api/spec/pool.h
+++ b/include/odp/api/spec/pool.h
@@ -40,6 +40,119 @@ 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
+                *
+                * 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;
+
+               /** Maximum packet level headroom length in bytes */
+               uint32_t max_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 packet level tailroom length in bytes */
+               uint32_t max_tailroom;

There's little point of adding the headroom/tailroom limits as capabilities if 
we don't also expand the odp_pool_param_t to allow applications to request 
default headroom and tailroom at odp_pool_create() time. Since a change to 
odp_pool_param_t is an API change, that needs to be part of this patch as well.

OK. Removed those from v2. It’s easy to add those back when pool params are 
updated.

-Petri

_______________________________________________
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to