aboutsummaryrefslogtreecommitdiff
path: root/include/odp/api/spec/pool_types.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/odp/api/spec/pool_types.h')
-rw-r--r--include/odp/api/spec/pool_types.h75
1 files changed, 75 insertions, 0 deletions
diff --git a/include/odp/api/spec/pool_types.h b/include/odp/api/spec/pool_types.h
index cf1051a07..81974abc6 100644
--- a/include/odp/api/spec/pool_types.h
+++ b/include/odp/api/spec/pool_types.h
@@ -209,6 +209,19 @@ typedef struct odp_pool_capability_t {
/** Maximum user area size in bytes */
uint32_t max_uarea_size;
+ /** Pool user area persistence
+ *
+ * When supported, implementation does not overwrite buffer user area
+ * content at any point of buffer lifetime nor after freeing a buffer
+ * back into pool.
+ *
+ * 0: User area content is maintained throughout regular buffer usage
+ * after allocation, but may be modified after free (default)
+ * 1: User area content is maintained throughout regular buffer usage
+ * and additionally also after buffer is freed into the pool (between
+ * buffer free and allocation) */
+ odp_bool_t uarea_persistence;
+
/** Minimum size of thread local cache */
uint32_t min_cache_size;
@@ -288,6 +301,11 @@ typedef struct odp_pool_capability_t {
/** Maximum user area size in bytes */
uint32_t max_uarea_size;
+ /** Pool user area persistence
+ *
+ * See buf.uarea_persistence for details. */
+ odp_bool_t uarea_persistence;
+
/** Maximum number of subparameters
*
* Maximum number of packet pool subparameters. Valid range is
@@ -318,6 +336,11 @@ typedef struct odp_pool_capability_t {
/** Maximum user area size in bytes */
uint32_t max_uarea_size;
+ /** Pool user area persistence
+ *
+ * See buf.uarea_persistence for details. */
+ odp_bool_t uarea_persistence;
+
/** Minimum size of thread local cache */
uint32_t min_cache_size;
@@ -345,6 +368,11 @@ typedef struct odp_pool_capability_t {
/** Maximum user area size in bytes */
uint32_t max_uarea_size;
+ /** Pool user area persistence
+ *
+ * See buf.uarea_persistence for details. */
+ odp_bool_t uarea_persistence;
+
/** Minimum size of thread local cache */
uint32_t min_cache_size;
@@ -581,6 +609,30 @@ typedef struct odp_pool_param_t {
uint32_t cache_size;
} vector;
+ /** Parameters for user area initialization */
+ struct {
+ /** User area initialization function
+ *
+ * Application defined user area initialization function to be
+ * called for each event of the pool during odp_pool_create(). Ignored
+ * if user area persistence is not supported
+ * (odp_pool_capability_t::uarea_persistence) or pool will not have any
+ * user area. The default value is NULL.
+ *
+ * @param uarea Pointer to the user area of an event
+ * @param size User area size
+ * @param args Pointer to application defined arguments
+ * @param index Index of the event (0..num events in pool - 1), not
+ * necessarily in order
+ */
+ void (*init_fn)(void *uarea, uint32_t size, void *args, uint32_t index);
+
+ /** Pointer to application defined arguments to be passed to every call
+ * of init_fn. The default value is NULL.
+ */
+ void *args;
+ } uarea_init;
+
/**
* Configure statistics counters
*
@@ -713,6 +765,12 @@ typedef struct odp_pool_ext_capability_t {
/** Maximum user area size in bytes */
uint32_t max_uarea_size;
+ /** Pool user area persistence
+ *
+ * See buf.uarea_persistence of odp_pool_capability_t for details
+ * (odp_pool_capability_t::uarea_persistence). */
+ odp_bool_t uarea_persistence;
+
} pkt;
} odp_pool_ext_capability_t;
@@ -724,6 +782,23 @@ typedef struct odp_pool_ext_param_t {
/** Pool type */
odp_pool_type_t type;
+ /** Parameters for user area initialization */
+ struct {
+ /** See uarea_init.init_fn of odp_pool_param_t for details
+ * (odp_pool_param_t::init_fn). However, note that with external memory
+ * pools, this function is called during memory population and not during
+ * pool creation (odp_pool_ext_populate()). Depending on the implementation,
+ * the function may be called each time pool is being populated with
+ * odp_pool_ext_populate() or during the last population call
+ * (odp_pool_ext_populate() with #ODP_POOL_POPULATE_DONE). */
+ void (*init_fn)(void *uarea, uint32_t size, void *args, uint32_t index);
+
+ /** See uarea_init.args of odp_pool_param_t for details
+ * (odp_pool_param_t::args). */
+ void *args;
+
+ } uarea_init;
+
/** Maximum thread local cache size for the pool
*
* Valid value range is from min_cache_size to max_cache_size capability.