aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMatias Elo <matias.elo@nokia.com>2023-01-13 14:44:07 +0200
committerMatias Elo <matias.elo@nokia.com>2023-04-12 11:27:12 +0300
commit62771e1c97c3cb1711900185858d7ed05ee4ef32 (patch)
tree6771b4716d0efa2dedd65ea6bcd2fc648661c3b5 /include
parent035e40949cefdd63f4545dc93a98145b4197d933 (diff)
api: stash: add new strict size parameter to odp_stash_param_t
Add new stash create parameter odp_stash_param_t.strict_size. When this option is enabled, application must never attempt to store more handles into the stash than specified in the odp_stash_param_t.num_obj parameter. Depending on the implementation, this may enable performance optimization. The new option is disabled by default and the total object count limitation is removed from odp_stash_put() function. Signed-off-by: Matias Elo <matias.elo@nokia.com> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com> Reviewed-by: Tuomas Taipale <tuomas.taipale@nokia.com> Reviewed-by: Ashwin Sekhar T K <asekhar@marvell.com>
Diffstat (limited to 'include')
-rw-r--r--include/odp/api/spec/stash.h5
-rw-r--r--include/odp/api/spec/stash_types.h18
2 files changed, 16 insertions, 7 deletions
diff --git a/include/odp/api/spec/stash.h b/include/odp/api/spec/stash.h
index f5929c45a..2453ed6bb 100644
--- a/include/odp/api/spec/stash.h
+++ b/include/odp/api/spec/stash.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2020-2022, Nokia
+/* Copyright (c) 2020-2023, Nokia
* All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
@@ -109,8 +109,7 @@ uint64_t odp_stash_to_u64(odp_stash_t stash);
* Store object handles into the stash. Handle values are opaque data to
* ODP implementation and may be e.g. pointers or indexes to arbitrary objects.
* Application specifies object handle size and maximum number of handles to be
- * stored in stash creation parameters. Application must not attempt to store
- * more handles into the stash than it specifies in the creation parameters.
+ * stored in stash creation parameters.
*
* A successful operation returns the actual number of object handles stored.
* If the return value is less than 'num', the remaining handles at the end of
diff --git a/include/odp/api/spec/stash_types.h b/include/odp/api/spec/stash_types.h
index 5f3e608bb..25f950931 100644
--- a/include/odp/api/spec/stash_types.h
+++ b/include/odp/api/spec/stash_types.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2020-2022, Nokia
+/* Copyright (c) 2020-2023, Nokia
* All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
@@ -219,10 +219,11 @@ typedef struct odp_stash_param_t {
*/
odp_stash_op_mode_t get_mode;
- /** Maximum number of object handles
+ /** Number of object handles
*
- * This is the maximum number of object handles application will store
- * in the stash. The value must not exceed 'max_num_obj' capability.
+ * Application must be able to store at least this many object handles
+ * into the stash. An implementation may round up the value. The given
+ * value must not exceed 'max_num_obj' capability.
*/
uint64_t num_obj;
@@ -265,6 +266,15 @@ typedef struct odp_stash_param_t {
*/
odp_stash_stats_opt_t stats;
+ /**
+ * Strict size
+ *
+ * If true, application never attempts to store more handles into the stash than specified
+ * in the 'num_obj' parameter. Implementation may use this value as a hint for performance
+ * optimizations. The default value is false.
+ */
+ odp_bool_t strict_size;
+
} odp_stash_param_t;
/**