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, api-next has been updated via 71cd2fba2d739c40bf617e7833612549acee3405 (commit) via 89269fd0ef5f1620c5b0c85c3af5f11d69d8cc43 (commit) via eac7ec700ab0a75716881c5a390e890f2950f2e4 (commit) from faa873cd4780729982f6d7f9d78cc1500f28ab3a (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 71cd2fba2d739c40bf617e7833612549acee3405 Author: Matias Elo matias.elo@nokia.com Date: Wed Aug 1 10:30:51 2018 +0300
validation: timer: use new timer pool capabilities
Signed-off-by: Matias Elo matias.elo@nokia.com Reviewed by Bill Fischofer bill.fischofer@linaro.org Reviewed-by: Petri Savolainen petri.savolainen@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/test/validation/api/timer/timer.c b/test/validation/api/timer/timer.c index e0f06882..a8a0df85 100644 --- a/test/validation/api/timer/timer.c +++ b/test/validation/api/timer/timer.c @@ -773,6 +773,7 @@ static void timer_test_odp_timer_all(void) uint64_t ns, tick, ns2; pthrd_arg thrdarg; odp_timer_capability_t timer_capa; + uint32_t num_timers;
/* Reserve at least one core for running other processes so the timer * test hopefully can run undisturbed and thus get better timing @@ -787,24 +788,26 @@ static void timer_test_odp_timer_all(void) if (num_workers < 1) num_workers = 1;
+ num_timers = num_workers * NTIMERS; + CU_ASSERT_FATAL(!odp_timer_capability(ODP_CLOCK_CPU, &timer_capa)); + if (timer_capa.max_timers && timer_capa.max_timers < num_timers) + num_timers = timer_capa.max_timers; + /* Create timeout pools */ odp_pool_param_init(¶ms); params.type = ODP_POOL_TIMEOUT; - params.tmo.num = (NTIMERS + 1) * num_workers; + params.tmo.num = num_timers + num_workers;
tbp = odp_pool_create("tmo_pool", ¶ms); if (tbp == ODP_POOL_INVALID) CU_FAIL_FATAL("Timeout pool create failed");
/* Create a timer pool */ - if (odp_timer_capability(ODP_CLOCK_CPU, &timer_capa)) - CU_FAIL("Error: get timer capacity failed.\n"); - resolution_ns = MAX(RES, timer_capa.highest_res_ns); tparam.res_ns = resolution_ns; tparam.min_tmo = MIN_TMO; tparam.max_tmo = MAX_TMO; - tparam.num_timers = num_workers * NTIMERS; + tparam.num_timers = num_timers; tparam.priv = 0; tparam.clk_src = ODP_CLOCK_CPU; tp = odp_timer_pool_create(NAME, &tparam); @@ -827,9 +830,13 @@ static void timer_test_odp_timer_all(void) LOG_DBG("Resolution: %" PRIu64 "\n", tparam.res_ns); LOG_DBG("Min timeout: %" PRIu64 "\n", tparam.min_tmo); LOG_DBG("Max timeout: %" PRIu64 "\n", tparam.max_tmo); - LOG_DBG("Num timers..: %u\n", tparam.num_timers); - LOG_DBG("Tmo range: %u ms (%" PRIu64 " ticks)\n", RANGE_MS, + LOG_DBG("Num timers: %u\n", tparam.num_timers); + LOG_DBG("Tmo range: %u ms (%" PRIu64 " ticks)\n", RANGE_MS, odp_timer_ns_to_tick(tp, 1000000ULL * RANGE_MS)); + LOG_DBG("Max timers: %" PRIu32 "\n", timer_capa.max_timers); + LOG_DBG("Max timer pools: %" PRIu32 "\n", timer_capa.max_pools); + LOG_DBG("Max timer pools combined: %" PRIu32 "\n", + timer_capa.max_pools_combined);
tick = odp_timer_ns_to_tick(tp, 0); CU_ASSERT(tick == 0); @@ -875,7 +882,7 @@ static void timer_test_odp_timer_all(void) /* Check some statistics after the test */ if (odp_timer_pool_info(tp, &tpinfo) != 0) CU_FAIL("odp_timer_pool_info"); - CU_ASSERT(tpinfo.param.num_timers == (unsigned)num_workers * NTIMERS); + CU_ASSERT(tpinfo.param.num_timers == num_timers); CU_ASSERT(tpinfo.cur_timers == 0); CU_ASSERT(tpinfo.hwm_timers == odp_atomic_load_u32(&timers_allocated));
commit 89269fd0ef5f1620c5b0c85c3af5f11d69d8cc43 Author: Matias Elo matias.elo@nokia.com Date: Wed Aug 1 10:44:46 2018 +0300
linux-gen: timer: implement new timer pool capabilities
Signed-off-by: Matias Elo matias.elo@nokia.com Reviewed by Bill Fischofer bill.fischofer@linaro.org Reviewed-by: Petri Savolainen petri.savolainen@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/platform/linux-generic/odp_timer.c b/platform/linux-generic/odp_timer.c index c7fe3678..95cf1b4d 100644 --- a/platform/linux-generic/odp_timer.c +++ b/platform/linux-generic/odp_timer.c @@ -1086,6 +1086,9 @@ int odp_timer_capability(odp_timer_clk_src_t clk_src, int ret = 0;
if (clk_src == ODP_CLOCK_CPU) { + capa->max_pools_combined = MAX_TIMER_POOLS; + capa->max_pools = MAX_TIMER_POOLS; + capa->max_timers = 0; capa->highest_res_ns = highest_res_ns; } else { ODP_ERR("ODP timer system doesn't support external clock source currently\n");
commit eac7ec700ab0a75716881c5a390e890f2950f2e4 Author: Matias Elo matias.elo@nokia.com Date: Wed Aug 1 09:05:39 2018 +0300
api: timer: add timer pool capabilities
Signed-off-by: Matias Elo matias.elo@nokia.com Reviewed by Bill Fischofer bill.fischofer@linaro.org Reviewed-by: Petri Savolainen petri.savolainen@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/include/odp/api/spec/timer.h b/include/odp/api/spec/timer.h index d88faaae..c5c85514 100644 --- a/include/odp/api/spec/timer.h +++ b/include/odp/api/spec/timer.h @@ -135,6 +135,22 @@ typedef struct { * Timer capability */ typedef struct { + /** Maximum number of timer pools over all clock sources + * + * The total number of timer pools that can be created combining + * different clock sources. + */ + uint32_t max_pools_combined; + + /** Maximum number of timer pools for the requested clock source */ + uint32_t max_pools; + + /** Maximum number of timers in a pool + * + * The value of zero means that limited only by the available + * memory size for the pool. */ + uint32_t max_timers; + /** Highest timer resolution in nanoseconds. * * This defines the highest resolution supported by a timer.
-----------------------------------------------------------------------
Summary of changes: include/odp/api/spec/timer.h | 16 ++++++++++++++++ platform/linux-generic/odp_timer.c | 3 +++ test/validation/api/timer/timer.c | 23 +++++++++++++++-------- 3 files changed, 34 insertions(+), 8 deletions(-)
hooks/post-receive