diff options
author | Matias Elo <matias.elo@nokia.com> | 2023-03-20 08:40:41 +0200 |
---|---|---|
committer | Matias Elo <matias.elo@nokia.com> | 2023-04-12 11:27:12 +0300 |
commit | e6bf7195c2fd964b5ed8b4e50ee90c056125ed0d (patch) | |
tree | 7c32d948bd2ebca575d13c451294fcda111bb31f | |
parent | acc737ce9d1513cc8c48ab9c1773dc9fa5518073 (diff) |
linux-gen: stash: add support for odp_stash_param_t.strict_size parameter
Add support for new odp_stash_param_t.strict_size stash parameters. The
mode was previously enabled using stash:strict_size config file option,
which has now been removed.
Signed-off-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Tuomas Taipale <tuomas.taipale@nokia.com>
-rw-r--r-- | config/odp-linux-generic.conf | 8 | ||||
-rw-r--r-- | platform/linux-generic/m4/odp_libconfig.m4 | 2 | ||||
-rw-r--r-- | platform/linux-generic/odp_stash.c | 16 | ||||
-rw-r--r-- | platform/linux-generic/test/inline-timer.conf | 2 | ||||
-rw-r--r-- | platform/linux-generic/test/packet_align.conf | 2 | ||||
-rw-r--r-- | platform/linux-generic/test/process-mode.conf | 2 | ||||
-rw-r--r-- | platform/linux-generic/test/sched-basic.conf | 3 | ||||
-rw-r--r-- | platform/linux-generic/test/stash-custom.conf | 2 |
8 files changed, 11 insertions, 26 deletions
diff --git a/config/odp-linux-generic.conf b/config/odp-linux-generic.conf index 89bdecc4b..63ac31fe2 100644 --- a/config/odp-linux-generic.conf +++ b/config/odp-linux-generic.conf @@ -16,7 +16,7 @@ # Mandatory fields odp_implementation = "linux-generic" -config_file_version = "0.1.26" +config_file_version = "0.1.27" # System options system: { @@ -271,12 +271,6 @@ stash: { # The value may be rounded up by the implementation. For optimal memory # usage set value to a power of two - 1. max_num_obj = 4095 - - # Strict size - # - # When set to 0, application can attempt to store more handles into a - # stash than it specified in the creation parameters. - strict_size = 1 } timer: { diff --git a/platform/linux-generic/m4/odp_libconfig.m4 b/platform/linux-generic/m4/odp_libconfig.m4 index beb01534b..a6d19f661 100644 --- a/platform/linux-generic/m4/odp_libconfig.m4 +++ b/platform/linux-generic/m4/odp_libconfig.m4 @@ -3,7 +3,7 @@ ########################################################################## m4_define([_odp_config_version_generation], [0]) m4_define([_odp_config_version_major], [1]) -m4_define([_odp_config_version_minor], [26]) +m4_define([_odp_config_version_minor], [27]) m4_define([_odp_config_version], [_odp_config_version_generation._odp_config_version_major._odp_config_version_minor]) diff --git a/platform/linux-generic/odp_stash.c b/platform/linux-generic/odp_stash.c index 5ff499843..e546fad6f 100644 --- a/platform/linux-generic/odp_stash.c +++ b/platform/linux-generic/odp_stash.c @@ -84,6 +84,7 @@ typedef struct ODP_ALIGNED_CACHE stash_t { char name[ODP_STASH_NAME_LEN]; int index; + uint8_t strict_size; /* Ring header followed by variable sized data (object handles) */ union { @@ -117,7 +118,6 @@ typedef struct stash_global_t { uint32_t max_num; uint32_t max_num_obj; uint32_t num_internal; - uint8_t strict_size; uint8_t stash_state[CONFIG_MAX_STASHES]; stash_t *stash[CONFIG_MAX_STASHES]; uint8_t data[] ODP_ALIGNED_CACHE; @@ -144,7 +144,6 @@ int _odp_stash_init_global(void) uint64_t ring_max_size, stash_max_size, stash_data_size, offset; const uint32_t internal_stashes = odp_global_ro.disable.dma ? 0 : CONFIG_INTERNAL_STASHES; uint8_t *stash_data; - uint8_t strict_size; int val = 0; if (odp_global_ro.disable.stash && odp_global_ro.disable.dma) { @@ -170,14 +169,6 @@ int _odp_stash_init_global(void) _ODP_PRINT(" %s: %i\n", str, val); max_num_obj = val; - str = "stash.strict_size"; - if (!_odp_libconfig_lookup_int(str, &val)) { - _ODP_ERR("Config option '%s' not found.\n", str); - return -1; - } - _ODP_PRINT(" %s: %i\n", str, val); - strict_size = !!val; - _ODP_PRINT("\n"); /* Reserve resources for implementation internal stashes */ @@ -213,7 +204,6 @@ int _odp_stash_init_global(void) stash_global->shm = shm; stash_global->max_num = max_num; stash_global->max_num_obj = max_num_obj; - stash_global->strict_size = strict_size; stash_global->num_internal = internal_stashes; odp_ticketlock_init(&stash_global->lock); @@ -491,7 +481,8 @@ odp_stash_t odp_stash_create(const char *name, const odp_stash_param_t *param) memset(stash, 0, sizeof(stash_t)); /* Set ring function pointers */ - if (stash_global->strict_size) { + stash->strict_size = !!param->strict_size; + if (stash->strict_size) { if (ring_u64) { stash->ring_fn.u64.init = strict_ring_u64_init; stash->ring_fn.u64.enq_multi = strict_ring_u64_enq_multi; @@ -914,6 +905,7 @@ void odp_stash_print(odp_stash_t st) _ODP_PRINT(" obj size %u\n", stash->obj_size); _ODP_PRINT(" obj count %u\n", stash_obj_count(stash)); _ODP_PRINT(" ring size %u\n", stash->ring_size); + _ODP_PRINT(" strict size %u\n", stash->strict_size); _ODP_PRINT("\n"); } diff --git a/platform/linux-generic/test/inline-timer.conf b/platform/linux-generic/test/inline-timer.conf index 07719aff5..d645bef3c 100644 --- a/platform/linux-generic/test/inline-timer.conf +++ b/platform/linux-generic/test/inline-timer.conf @@ -1,6 +1,6 @@ # Mandatory fields odp_implementation = "linux-generic" -config_file_version = "0.1.26" +config_file_version = "0.1.27" timer: { # Enable inline timer implementation diff --git a/platform/linux-generic/test/packet_align.conf b/platform/linux-generic/test/packet_align.conf index 84b5a828b..427674bb2 100644 --- a/platform/linux-generic/test/packet_align.conf +++ b/platform/linux-generic/test/packet_align.conf @@ -1,6 +1,6 @@ # Mandatory fields odp_implementation = "linux-generic" -config_file_version = "0.1.26" +config_file_version = "0.1.27" pool: { pkt: { diff --git a/platform/linux-generic/test/process-mode.conf b/platform/linux-generic/test/process-mode.conf index e8f4a2556..5bfcb9f2f 100644 --- a/platform/linux-generic/test/process-mode.conf +++ b/platform/linux-generic/test/process-mode.conf @@ -1,6 +1,6 @@ # Mandatory fields odp_implementation = "linux-generic" -config_file_version = "0.1.26" +config_file_version = "0.1.27" # Shared memory options shm: { diff --git a/platform/linux-generic/test/sched-basic.conf b/platform/linux-generic/test/sched-basic.conf index 094165381..1a401298e 100644 --- a/platform/linux-generic/test/sched-basic.conf +++ b/platform/linux-generic/test/sched-basic.conf @@ -1,12 +1,11 @@ # Mandatory fields odp_implementation = "linux-generic" -config_file_version = "0.1.26" +config_file_version = "0.1.27" # Test scheduler with an odd spread value and without dynamic load balance sched_basic: { prio_spread = 3 load_balance = 0 - order_stash_size = 0 powersave: { poll_time_nsec = 5000 sleep_time_nsec = 50000 diff --git a/platform/linux-generic/test/stash-custom.conf b/platform/linux-generic/test/stash-custom.conf index 46228be27..b96c1cf45 100644 --- a/platform/linux-generic/test/stash-custom.conf +++ b/platform/linux-generic/test/stash-custom.conf @@ -1,6 +1,6 @@ # Mandatory fields odp_implementation = "linux-generic" -config_file_version = "0.1.26" +config_file_version = "0.1.27" # Test overflow safe stash variant stash: { |