diff mbox series

[API-NEXT,v2,5/8] api: pool: add max packet num info

Message ID 1508245228-16824-6-git-send-email-odpbot@yandex.ru
State Superseded
Headers show
Series [API-NEXT,v2,1/8] api: pool: relax packet pool param num | expand

Commit Message

Github ODP bot Oct. 17, 2017, 1 p.m. UTC
From: Petri Savolainen <petri.savolainen@linaro.org>


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 <petri.savolainen@linaro.org>

---
/** 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: afeda4d14bb6f449cb269680cdbd56b26726eedf
 ** Merge commit sha: cc4142b7bb4d97ad57cb925e9fc4165f1ab3f663
 **/
 include/odp/api/spec/pool.h | 21 ++++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)
diff mbox series

Patch

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);
 
 /**