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 feac45e3ed8fa871ae7f9826d0c045591f22ce42 (commit) via e4ef7a3b32d375e3e1872a43697d407413ae87aa (commit) via 762e4c51fc0d61bee8e740370fa6c64f86a5ee6c (commit) from 6a30a1beb7ec2182239ea3ba1ef71a6f9a944df9 (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 feac45e3ed8fa871ae7f9826d0c045591f22ce42 Author: Petri Savolainen petri.savolainen@nokia.com Date: Wed Jun 5 14:26:13 2019 +0300
example: time: include into make check
Run time example as part of 'make check'.
Signed-off-by: Petri Savolainen petri.savolainen@nokia.com Reviewed-by: Matias Elo matias.elo@nokia.com
diff --git a/example/time/Makefile.am b/example/time/Makefile.am index bda908761..5621ef99e 100644 --- a/example/time/Makefile.am +++ b/example/time/Makefile.am @@ -2,4 +2,8 @@ include $(top_srcdir)/example/Makefile.inc
bin_PROGRAMS = odp_time_global
+if test_example +TESTS = odp_time_global +endif + odp_time_global_SOURCES = time_global_test.c
commit e4ef7a3b32d375e3e1872a43697d407413ae87aa Author: Petri Savolainen petri.savolainen@nokia.com Date: Thu Jun 6 10:32:23 2019 +0300
example: time: fix deadlock with single worker
Random id calculation did get stuck when there's only single worker (as id is always one).
Signed-off-by: Petri Savolainen petri.savolainen@nokia.com Reviewed-by: Matias Elo matias.elo@nokia.com
diff --git a/example/time/time_global_test.c b/example/time/time_global_test.c index efcd22984..1e5cb0bd4 100644 --- a/example/time/time_global_test.c +++ b/example/time/time_global_test.c @@ -84,20 +84,23 @@ static void print_log(test_globals_t *gbls) printf("Number of errors: %u\n", err_num); }
-static void -generate_next_queue(test_globals_t *gbls, odp_queue_t *queue, unsigned int id) +static void generate_next_queue(test_globals_t *gbls, odp_queue_t *queue, + unsigned int id) { int thr; - unsigned int rand_id; + uint8_t rand_u8; char queue_name[sizeof(QUEUE_NAME_PREFIX) + 2]; + unsigned int rand_id = 1;
thr = odp_thread_id();
/* generate next random id */ - do { - odp_random_data((uint8_t *)&rand_id, sizeof(rand_id), 1); - rand_id = rand_id % gbls->thread_num + 1; - } while (rand_id == id); + if (gbls->thread_num > 1) { + do { + odp_random_data(&rand_u8, 1, ODP_RANDOM_BASIC); + rand_id = rand_u8 % gbls->thread_num + 1; + } while (rand_id == id); + }
sprintf(queue_name, QUEUE_NAME_PREFIX "%d", rand_id); *queue = odp_queue_lookup(queue_name);
commit 762e4c51fc0d61bee8e740370fa6c64f86a5ee6c Author: Petri Savolainen petri.savolainen@nokia.com Date: Wed Jun 5 14:15:19 2019 +0300
example: time: increase pool size
Since pool implementation may stash buffers per thread, pool size of one buffer per thread is not enough to ensure that every thread can allocate a buffer. Use similar pool size than other multi-threaded test applications.
Signed-off-by: Petri Savolainen petri.savolainen@nokia.com Reviewed-by: Matias Elo matias.elo@nokia.com
diff --git a/example/time/time_global_test.c b/example/time/time_global_test.c index 0c4b5286c..efcd22984 100644 --- a/example/time/time_global_test.c +++ b/example/time/time_global_test.c @@ -11,6 +11,7 @@ #include <odp/helper/odph_api.h>
#define MAX_WORKERS 32 +#define MAX_NUM_BUF 8192 #define ITERATION_NUM 2048 #define LOG_BASE 8 #define LOG_ENTRY_SIZE 19 @@ -250,7 +251,8 @@ int main(int argc, char *argv[]) int num_workers; test_globals_t *gbls; odp_cpumask_t cpumask; - odp_pool_param_t params; + odp_pool_capability_t pool_capa; + odp_pool_param_t pool_param; odp_shm_t shm_glbls = ODP_SHM_INVALID; odp_shm_t shm_log = ODP_SHM_INVALID; int log_size, log_enries_num; @@ -319,12 +321,23 @@ int main(int argc, char *argv[]) odp_barrier_init(&gbls->end_barrier, num_workers); memset(gbls->log, 0, log_size);
- params.buf.size = sizeof(timestamp_event_t); - params.buf.align = ODP_CACHE_LINE_SIZE; - params.buf.num = num_workers; - params.type = ODP_POOL_BUFFER; + if (odp_pool_capability(&pool_capa)) { + err = 1; + EXAMPLE_ERR("Error: pool capability failed.\n"); + goto err; + } + + odp_pool_param_init(&pool_param); + + pool_param.buf.size = sizeof(timestamp_event_t); + pool_param.buf.align = ODP_CACHE_LINE_SIZE; + pool_param.buf.num = MAX_NUM_BUF; + pool_param.type = ODP_POOL_BUFFER; + + if (pool_capa.buf.max_num && MAX_NUM_BUF > pool_capa.buf.max_num) + pool_param.buf.num = pool_capa.buf.max_num;
- pool = odp_pool_create("time buffers pool", ¶ms); + pool = odp_pool_create("time buffers pool", &pool_param); if (pool == ODP_POOL_INVALID) { err = 1; EXAMPLE_ERR("Pool create failed.\n");
-----------------------------------------------------------------------
Summary of changes: example/time/Makefile.am | 4 ++++ example/time/time_global_test.c | 42 ++++++++++++++++++++++++++++------------- 2 files changed, 33 insertions(+), 13 deletions(-)
hooks/post-receive