From: Petri Savolainen <[email protected]>

Packet pool parameters does not require application to specify
the maximum number of packet. Application is more portable, if
it does not restrict max_num, but instead uses this info field
after pool creation.

Signed-off-by: Petri Savolainen <[email protected]>
---
/** Email created from pull request 234 (psavol:next-pool-param)
 ** https://github.com/Linaro/odp/pull/234
 ** Patch: https://github.com/Linaro/odp/pull/234.patch
 ** Base sha: ec6510b33e8b96d6d6670efb9dc3c9101baed6c6
 ** Merge commit sha: e5f6958b8e62d20650a2ea4a0c17bed262ad2ae1
 **/
 include/odp/api/spec/pool.h | 21 ++++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)

diff --git a/include/odp/api/spec/pool.h b/include/odp/api/spec/pool.h
index 61be2f974..63e063bef 100644
--- a/include/odp/api/spec/pool.h
+++ b/include/odp/api/spec/pool.h
@@ -358,8 +358,24 @@ odp_pool_t odp_pool_lookup(const char *name);
  * Used to get information about a pool.
  */
 typedef struct odp_pool_info_t {
-       const char *name;          /**< pool name */
-       odp_pool_param_t params;   /**< pool parameters */
+       /** Pool name */
+       const char *name;
+
+       /** Copy of pool parameters */
+       odp_pool_param_t params;
+
+       /** Additional info for packet pools */
+       struct {
+               /** Maximum number of packets of any length
+                *
+                *  This is the maximum number of packets that can be allocated
+                *  from the pool at anytime. Application can use this e.g.
+                *  to prepare enough per packet contexts.
+                */
+               uint32_t max_num;
+
+       } pkt;
+
 } odp_pool_info_t;
 
 /**
@@ -373,7 +389,6 @@ typedef struct odp_pool_info_t {
  * @retval 0 Success
  * @retval -1 Failure.  Info could not be retrieved.
  */
-
 int odp_pool_info(odp_pool_t pool, odp_pool_info_t *info);
 
 /**

Reply via email to