This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "".
The branch, master has been updated via 044cae351a1e60e4381cdbae37e2a759772c2258 (commit) via 95cbee5ac9cdcb696d48e6f820593c813f535f8a (commit) via 0c8a2c0027e35184cbc6eeadc3a8aa8bd2e8605b (commit) via 2c41f8f678bbb96a63dedb4e4d948c5dd779f65d (commit) via 7e188187a77fa9bab56f1407eb660c324736cd34 (commit) via 031802ec0c5e3e44d70aee7b19e0cd1055c9fe0b (commit) from 690bacc61c55e4f8f3195faaac068da83790ebf4 (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- commit 044cae351a1e60e4381cdbae37e2a759772c2258 Author: Petri Savolainen petri.savolainen@linaro.org Date: Wed Oct 17 16:51:49 2018 +0300
linux-gen: config: maximum pool size 1M
Change maximum pool size back to 1M. Maximum packet pool capability is defined in the config file. This is the upper limit for that config. Also this is max capability of buffer and tmo pools.
Signed-off-by: Petri Savolainen petri.savolainen@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/platform/linux-generic/include/odp_config_internal.h b/platform/linux-generic/include/odp_config_internal.h index 7a573bd76..65f751972 100644 --- a/platform/linux-generic/include/odp_config_internal.h +++ b/platform/linux-generic/include/odp_config_internal.h @@ -150,7 +150,7 @@ extern "C" { * Maximum number of events in a pool. Power of two minus one results optimal * memory usage for the ring. */ -#define CONFIG_POOL_MAX_NUM ((256 * 1024) - 1) +#define CONFIG_POOL_MAX_NUM ((1024 * 1024) - 1)
/* * Maximum number of events in a thread local pool cache
commit 95cbee5ac9cdcb696d48e6f820593c813f535f8a Author: Petri Savolainen petri.savolainen@linaro.org Date: Wed Oct 17 16:41:52 2018 +0300
linux-gen: pool: add max num packets in config file
This config is used to for maximum capability. The default capability needs to be modest so that system memory limit is not exceeded. User may increase maximum number of packets when system memory size allows (and SHM single VA is not used).
Signed-off-by: Petri Savolainen petri.savolainen@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/config/odp-linux-generic.conf b/config/odp-linux-generic.conf index 4db9ed489..af651d7f6 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.0" +config_file_version = "0.1.1"
# Shared memory options shm: { @@ -39,6 +39,16 @@ shm: { single_va = 0 }
+# Pool options +pool: { + # Packet pool options + pkt: { + # Maximum number of packets per pool. Power of two minus one + # results optimal memory usage (e.g. (256 * 1024) - 1). + max_num = 262143 + } +} + # DPDK pktio options pktio_dpdk: { # Default options diff --git a/platform/linux-generic/include/odp_pool_internal.h b/platform/linux-generic/include/odp_pool_internal.h index 2696e8eec..94f859de0 100644 --- a/platform/linux-generic/include/odp_pool_internal.h +++ b/platform/linux-generic/include/odp_pool_internal.h @@ -89,6 +89,11 @@ typedef struct pool_t { typedef struct pool_table_t { pool_t pool[ODP_CONFIG_POOLS]; odp_shm_t shm; + + struct { + uint32_t pkt_max_num; + } config; + } pool_table_t;
extern pool_table_t *pool_tbl; diff --git a/platform/linux-generic/odp_pool.c b/platform/linux-generic/odp_pool.c index db7a8da3f..d08be4378 100644 --- a/platform/linux-generic/odp_pool.c +++ b/platform/linux-generic/odp_pool.c @@ -22,6 +22,7 @@ #include <odp_ring_internal.h> #include <odp_shm_internal.h> #include <odp_global_data.h> +#include <odp_libconfig_internal.h>
#include <string.h> #include <stdio.h> @@ -33,8 +34,9 @@ #define UNLOCK(a) odp_ticketlock_unlock(a) #define LOCK_INIT(a) odp_ticketlock_init(a)
-#define CACHE_BURST 32 -#define RING_SIZE_MIN (2 * CACHE_BURST) +#define CACHE_BURST 32 +#define RING_SIZE_MIN (2 * CACHE_BURST) +#define POOL_MAX_NUM_MIN RING_SIZE_MIN
/* Make sure packet buffers don't cross huge page boundaries starting from this * page size. 2MB is typically the smallest used huge page size. */ @@ -83,6 +85,32 @@ static inline pool_t *pool_from_buf(odp_buffer_t buf) return buf_hdr->pool_ptr; }
+static int read_config_file(pool_table_t *pool_tbl) +{ + const char *str; + int val = 0; + + ODP_PRINT("Pool config:\n"); + + str = "pool.pkt.max_num"; + if (!_odp_libconfig_lookup_int(str, &val)) { + ODP_ERR("Config option '%s' not found.\n", str); + return -1; + } + + if (val > CONFIG_POOL_MAX_NUM || val < POOL_MAX_NUM_MIN) { + ODP_ERR("Bad value %s = %u\n", str, val); + return -1; + } + + pool_tbl->config.pkt_max_num = val; + ODP_PRINT(" %s: %i\n", str, val); + + ODP_PRINT("\n"); + + return 0; +} + int odp_pool_init_global(void) { uint32_t i; @@ -101,6 +129,11 @@ int odp_pool_init_global(void) memset(pool_tbl, 0, sizeof(pool_table_t)); pool_tbl->shm = shm;
+ if (read_config_file(pool_tbl)) { + odp_shm_free(shm); + return -1; + } + for (i = 0; i < ODP_CONFIG_POOLS; i++) { pool_t *pool = pool_entry(i);
@@ -950,7 +983,7 @@ int odp_pool_capability(odp_pool_capability_t *capa) /* Packet pools */ capa->pkt.max_pools = ODP_CONFIG_POOLS; capa->pkt.max_len = CONFIG_PACKET_MAX_LEN; - capa->pkt.max_num = CONFIG_POOL_MAX_NUM; + capa->pkt.max_num = pool_tbl->config.pkt_max_num; capa->pkt.min_headroom = CONFIG_PACKET_HEADROOM; capa->pkt.max_headroom = CONFIG_PACKET_HEADROOM; capa->pkt.min_tailroom = CONFIG_PACKET_TAILROOM; diff --git a/platform/linux-generic/test/process-mode.conf b/platform/linux-generic/test/process-mode.conf index 8618f2fdb..d80df25c4 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.0" +config_file_version = "0.1.1"
# Shared memory options shm: {
commit 0c8a2c0027e35184cbc6eeadc3a8aa8bd2e8605b Author: Petri Savolainen petri.savolainen@linaro.org Date: Wed Oct 17 14:43:43 2018 +0300
linux-gen: pool: add packet param checks
Do also checks against maximum number of packets and max packet headroom size.
Signed-off-by: Petri Savolainen petri.savolainen@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/platform/linux-generic/odp_pool.c b/platform/linux-generic/odp_pool.c index 544348189..db7a8da3f 100644 --- a/platform/linux-generic/odp_pool.c +++ b/platform/linux-generic/odp_pool.c @@ -572,6 +572,17 @@ static int check_params(odp_pool_param_t *params) break;
case ODP_POOL_PACKET: + if (params->pkt.num > capa.pkt.max_num) { + ODP_ERR("pkt.num too large %u\n", params->pkt.num); + return -1; + } + + if (params->pkt.max_num > capa.pkt.max_num) { + ODP_ERR("pkt.max_num too large %u\n", + params->pkt.max_num); + return -1; + } + if (params->pkt.len > capa.pkt.max_len) { ODP_ERR("pkt.len too large %u\n", params->pkt.len); return -1; @@ -595,6 +606,12 @@ static int check_params(odp_pool_param_t *params) return -1; }
+ if (params->pkt.headroom > capa.pkt.max_headroom) { + ODP_ERR("pkt.headroom too large %u\n", + params->pkt.headroom); + return -1; + } + break;
case ODP_POOL_TIMEOUT:
commit 2c41f8f678bbb96a63dedb4e4d948c5dd779f65d Author: Petri Savolainen petri.savolainen@linaro.org Date: Wed Oct 17 14:38:16 2018 +0300
linux-gen: pool: output error on pool create
Change from debug to error message on pool create checks. These are slow path errors and it's helpful to see those also when not debugging.
Signed-off-by: Petri Savolainen petri.savolainen@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/platform/linux-generic/odp_pool.c b/platform/linux-generic/odp_pool.c index 7a4a9eb99..544348189 100644 --- a/platform/linux-generic/odp_pool.c +++ b/platform/linux-generic/odp_pool.c @@ -555,17 +555,17 @@ static int check_params(odp_pool_param_t *params) switch (params->type) { case ODP_POOL_BUFFER: if (params->buf.num > capa.buf.max_num) { - ODP_DBG("buf.num too large %u\n", params->buf.num); + ODP_ERR("buf.num too large %u\n", params->buf.num); return -1; }
if (params->buf.size > capa.buf.max_size) { - ODP_DBG("buf.size too large %u\n", params->buf.size); + ODP_ERR("buf.size too large %u\n", params->buf.size); return -1; }
if (params->buf.align > capa.buf.max_align) { - ODP_DBG("buf.align too large %u\n", params->buf.align); + ODP_ERR("buf.align too large %u\n", params->buf.align); return -1; }
@@ -573,24 +573,24 @@ static int check_params(odp_pool_param_t *params)
case ODP_POOL_PACKET: if (params->pkt.len > capa.pkt.max_len) { - ODP_DBG("pkt.len too large %u\n", params->pkt.len); + ODP_ERR("pkt.len too large %u\n", params->pkt.len); return -1; }
if (params->pkt.max_len > capa.pkt.max_len) { - ODP_DBG("pkt.max_len too large %u\n", + ODP_ERR("pkt.max_len too large %u\n", params->pkt.max_len); return -1; }
if (params->pkt.seg_len > capa.pkt.max_seg_len) { - ODP_DBG("pkt.seg_len too large %u\n", + ODP_ERR("pkt.seg_len too large %u\n", params->pkt.seg_len); return -1; }
if (params->pkt.uarea_size > capa.pkt.max_uarea_size) { - ODP_DBG("pkt.uarea_size too large %u\n", + ODP_ERR("pkt.uarea_size too large %u\n", params->pkt.uarea_size); return -1; } @@ -599,13 +599,13 @@ static int check_params(odp_pool_param_t *params)
case ODP_POOL_TIMEOUT: if (params->tmo.num > capa.tmo.max_num) { - ODP_DBG("tmo.num too large %u\n", params->tmo.num); + ODP_ERR("tmo.num too large %u\n", params->tmo.num); return -1; } break;
default: - ODP_DBG("bad pool type %i\n", params->type); + ODP_ERR("bad pool type %i\n", params->type); return -1; }
commit 7e188187a77fa9bab56f1407eb660c324736cd34 Author: Petri Savolainen petri.savolainen@linaro.org Date: Wed Oct 17 13:13:20 2018 +0300
linux-gen: config: move queue size config to scalable
Only scalable queues use build time the queue size config. Move it to scalable config file.
Signed-off-by: Petri Savolainen petri.savolainen@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/platform/linux-generic/include/odp_config_internal.h b/platform/linux-generic/include/odp_config_internal.h index 8ceb325b2..7a573bd76 100644 --- a/platform/linux-generic/include/odp_config_internal.h +++ b/platform/linux-generic/include/odp_config_internal.h @@ -26,13 +26,6 @@ extern "C" { */ #define ODP_CONFIG_QUEUES 1024
-/* - * Maximum queue depth. Maximum number of elements that can be stored in a - * queue. This value is used only when the size is not explicitly provided - * during queue creation. - */ -#define CONFIG_QUEUE_SIZE 4096 - /* * Maximum number of ordered locks per queue */ diff --git a/platform/linux-generic/include/odp_schedule_scalable_config.h b/platform/linux-generic/include/odp_schedule_scalable_config.h index a84dc0724..3462d047b 100644 --- a/platform/linux-generic/include/odp_schedule_scalable_config.h +++ b/platform/linux-generic/include/odp_schedule_scalable_config.h @@ -9,6 +9,9 @@ #ifndef ODP_SCHEDULE_SCALABLE_CONFIG_H_ #define ODP_SCHEDULE_SCALABLE_CONFIG_H_
+/* Maximum number of events that can be stored in a queue */ +#define CONFIG_SCAL_QUEUE_SIZE 4096 + /* * Default scaling factor for the scheduler group * diff --git a/platform/linux-generic/odp_queue_scalable.c b/platform/linux-generic/odp_queue_scalable.c index bbc57e44d..b7ff2195f 100644 --- a/platform/linux-generic/odp_queue_scalable.c +++ b/platform/linux-generic/odp_queue_scalable.c @@ -110,7 +110,7 @@ static int queue_init(queue_entry_t *queue, const char *name,
sched_elem = &queue->s.sched_elem; ring_size = param->size > 0 ? - ROUNDUP_POWER2_U32(param->size) : CONFIG_QUEUE_SIZE; + ROUNDUP_POWER2_U32(param->size) : CONFIG_SCAL_QUEUE_SIZE; strncpy(queue->s.name, name ? name : "", ODP_QUEUE_NAME_LEN - 1); queue->s.name[ODP_QUEUE_NAME_LEN - 1] = 0; memcpy(&queue->s.param, param, sizeof(odp_queue_param_t)); @@ -212,15 +212,16 @@ static int queue_init_global(void) /* Add size of the array holding the queues */ pool_size = sizeof(queue_table_t); /* Add storage required for queues */ - pool_size += (CONFIG_QUEUE_SIZE * sizeof(odp_buffer_hdr_t *)) * - ODP_CONFIG_QUEUES; + pool_size += (CONFIG_SCAL_QUEUE_SIZE * + sizeof(odp_buffer_hdr_t *)) * ODP_CONFIG_QUEUES; + /* Add the reorder window size */ pool_size += sizeof(reorder_window_t) * ODP_CONFIG_QUEUES; /* Choose min_alloc and max_alloc such that buddy allocator is * is selected. */ min_alloc = 0; - max_alloc = CONFIG_QUEUE_SIZE * sizeof(odp_buffer_hdr_t *); + max_alloc = CONFIG_SCAL_QUEUE_SIZE * sizeof(odp_buffer_hdr_t *); queue_shm_pool = _odp_ishm_pool_create("queue_shm_pool", pool_size, min_alloc, max_alloc,
commit 031802ec0c5e3e44d70aee7b19e0cd1055c9fe0b Author: Petri Savolainen petri.savolainen@linaro.org Date: Thu Oct 18 09:37:47 2018 +0300
linux-gen: config: improve config file check error output
It was hard to notice from log that config file version has a mismatch. This is a common error when config file version has updated, but a user has not updated his own config file. Improve error check output, so that failure reason is better highlighted.
Signed-off-by: Petri Savolainen petri.savolainen@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/platform/linux-generic/odp_libconfig.c b/platform/linux-generic/odp_libconfig.c index baf825bbe..014409e2b 100644 --- a/platform/linux-generic/odp_libconfig.c +++ b/platform/linux-generic/odp_libconfig.c @@ -21,10 +21,12 @@ int _odp_libconfig_init_global(void) const char *filename; const char *vers; const char *vers_rt; - const char *ipml; - const char *ipml_rt; + const char *impl; + const char *impl_rt; config_t *config = &odp_global_ro.libconfig_default; config_t *config_rt = &odp_global_ro.libconfig_runtime; + const char *impl_field = "odp_implementation"; + const char *vers_field = "config_file_version";
config_init(config); config_init(config_rt); @@ -40,34 +42,45 @@ int _odp_libconfig_init_global(void) if (filename == NULL) return 0;
- ODP_PRINT("CONFIG FILE: %s\n", filename); + ODP_PRINT("ODP CONFIG FILE: %s\n", filename);
if (!config_read_file(config_rt, filename)) { - ODP_ERR("Failed to read config file: %s(%d): %s\n", - config_error_file(config_rt), - config_error_line(config_rt), - config_error_text(config_rt)); + ODP_PRINT(" ERROR: failed to read config file: %s(%d): %s\n\n", + config_error_file(config_rt), + config_error_line(config_rt), + config_error_text(config_rt)); goto fail; }
/* Check runtime configuration's implementation name and version */ - if (!config_lookup_string(config, "odp_implementation", &ipml) || - !config_lookup_string(config_rt, "odp_implementation", &ipml_rt)) { - ODP_ERR("Configuration missing 'odp_implementation' field\n"); + if (!config_lookup_string(config, impl_field, &impl) || + !config_lookup_string(config_rt, impl_field, &impl_rt)) { + ODP_PRINT(" ERROR: missing mandatory field: %s\n\n", + impl_field); goto fail; } - if (!config_lookup_string(config, "config_file_version", &vers) || - !config_lookup_string(config_rt, "config_file_version", &vers_rt)) { - ODP_ERR("Configuration missing 'config_file_version' field\n"); + if (!config_lookup_string(config, vers_field, &vers) || + !config_lookup_string(config_rt, vers_field, &vers_rt)) { + ODP_PRINT(" ERROR: missing mandatory field: %s\n\n", + vers_field); goto fail; } - if (strcmp(vers, vers_rt) || strcmp(ipml, ipml_rt)) { - ODP_ERR("Runtime configuration mismatch\n"); + if (strcmp(impl, impl_rt)) { + ODP_PRINT(" ERROR: ODP implementation name mismatch:\n" + " Expected: "%s"\n" + " Found: "%s"\n\n", impl, impl_rt); + goto fail; + } + if (strcmp(vers, vers_rt)) { + ODP_PRINT(" ERROR: config file version number mismatch:\n" + " Expected: "%s"\n" + " Found: "%s"\n\n", vers, vers_rt); goto fail; }
return 0; fail: + ODP_ERR("Config file failure\n"); config_destroy(config); config_destroy(config_rt); return -1;
-----------------------------------------------------------------------
Summary of changes: config/odp-linux-generic.conf | 12 +++- .../linux-generic/include/odp_config_internal.h | 9 +-- platform/linux-generic/include/odp_pool_internal.h | 5 ++ .../include/odp_schedule_scalable_config.h | 3 + platform/linux-generic/odp_libconfig.c | 43 ++++++++----- platform/linux-generic/odp_pool.c | 74 ++++++++++++++++++---- platform/linux-generic/odp_queue_scalable.c | 9 +-- platform/linux-generic/test/process-mode.conf | 2 +- 8 files changed, 116 insertions(+), 41 deletions(-)
hooks/post-receive