aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJerin Jacob <jerinj@marvell.com>2020-09-02 20:03:52 +0530
committerPetri Savolainen <petri.savolainen@nokia.com>2020-11-19 09:49:08 +0200
commitcdc1750bc40b72fc194ad69bb4db57618f13f2ac (patch)
tree503960047ff5fea8217becedfa3cf32958d96beb /include
parent12b6755951ae44d8c437e52656bcb4f67c39a080 (diff)
api: pool: introduce vector pool
Introduce the vector pool to hold the vector of a generic type such as packets. Updated odp_pool_capability_t to advertise the new vector pool capabilities and odp_pool_param_t to configure the vector pool. The application shall use the max_vector_size parameter to configure the max number of general types such as odp_packet_t that can hold in the vector. When vector pool used as odp_packet_t container, either pktin subsystem can allocate a buffer to hold/form the vector in packet input path as pktin producer or the application can allocate the vector pool using odp_packet_vector_alloc() from packet API to create a vector of packets to store an array of packets as a vector. Signed-off-by: Matias Elo <matias.elo@nokia.com> Signed-off-by: Jerin Jacob <jerinj@marvell.com> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
Diffstat (limited to 'include')
-rw-r--r--include/odp/api/spec/pool.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/include/odp/api/spec/pool.h b/include/odp/api/spec/pool.h
index cdc7f5fef..21963e468 100644
--- a/include/odp/api/spec/pool.h
+++ b/include/odp/api/spec/pool.h
@@ -181,6 +181,27 @@ typedef struct odp_pool_capability_t {
uint32_t max_cache_size;
} tmo;
+ /** Vector pool capabilities */
+ struct {
+ /** Maximum number of vector pools */
+ unsigned int max_pools;
+
+ /** Maximum number of vector events in a pool
+ *
+ * The value of zero means that limited only by the available
+ * memory size for the pool. */
+ uint32_t max_num;
+
+ /** Maximum number of general types, such as odp_packet_t, in a vector. */
+ uint32_t max_size;
+
+ /** Minimum size of thread local cache */
+ uint32_t min_cache_size;
+
+ /** Maximum size of thread local cache */
+ uint32_t max_cache_size;
+ } vector;
+
} odp_pool_capability_t;
/**
@@ -359,6 +380,21 @@ typedef struct odp_pool_param_t {
uint32_t cache_size;
} tmo;
+ /** Parameters for vector pools */
+ struct {
+ /** Number of vectors in the pool */
+ uint32_t num;
+
+ /** Maximum number of general types, such as odp_packet_t, in a vector. */
+ uint32_t max_size;
+
+ /** Maximum number of vectors cached locally per thread
+ *
+ * See buf.cache_size documentation for details.
+ */
+ uint32_t cache_size;
+ } vector;
+
} odp_pool_param_t;
/** Packet pool*/
@@ -367,6 +403,12 @@ typedef struct odp_pool_param_t {
#define ODP_POOL_BUFFER ODP_EVENT_BUFFER
/** Timeout pool */
#define ODP_POOL_TIMEOUT ODP_EVENT_TIMEOUT
+/** Vector pool
+ *
+ * The pool to hold a vector of general type such as odp_packet_t.
+ * Each vector holds an array of generic types of the same type.
+ */
+#define ODP_POOL_VECTOR (ODP_POOL_TIMEOUT + 1)
/**
* Create a pool