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 27b0ca668ec90730f6329185e23a026caf0b9064 (commit) via c290e20364469774d6091426144645e53c257867 (commit) via 96adbf43bcd91c63dd8c4c248b439ff3150bd1cc (commit) via 7563bcf7716cdedf82a9a4f2a8121c45f669a45c (commit) via 55daa2b0c3b024bfe9b17966fe3d7f10aaa27363 (commit) via bab62d6ee6e1072bedbb49bcf747fecfb99b24df (commit) via 6cede326ec2f9d9d5965419c1963a7cd541a7802 (commit) via e93e8c3ea659c9a64aef3f53ae8932b31dfcef95 (commit) via 5d1f07269026cdc371973a5edb2373113698e3c8 (commit) via 3bf94540be3400cb741903b9b44ddc62b14cf397 (commit) via b6e973744e52db038d9e0886fcaef014eff05cb5 (commit) via f30d79bf8689dda7554b5c3d1025fb9030135ab7 (commit) via 39502aa8b1a01732b012a424ca6587030d2e0a09 (commit) via da5d27b57a0a3c8389c0a0f8c5747308419a094a (commit) via 207efebdb9ca6d329cc89b272865559f5eeff182 (commit) via 12b368d14e19761b7aabc4cac04918582253052b (commit) from c73aaee1959377064cecccb6158b225de3f13db5 (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 27b0ca668ec90730f6329185e23a026caf0b9064 Author: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Date: Thu Nov 15 20:34:27 2018 +0300
validation: scheduler use schedule_config instead of capabilities
Since ODP test suite will use default configuration for scheduler, all comparisons should be done against it rather than maximum possible values returned by capabilities.
Signed-off-by: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Signed-off-by: Balasubramanian Manoharan bala.manoharan@linaro.org 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/scheduler/scheduler.c b/test/validation/api/scheduler/scheduler.c index 4fdfc243..27377580 100644 --- a/test/validation/api/scheduler/scheduler.c +++ b/test/validation/api/scheduler/scheduler.c @@ -418,7 +418,7 @@ static void scheduler_test_wait(void) static void scheduler_test_queue_size(void) { odp_queue_capability_t queue_capa; - odp_scheduler_config_t default_config; + odp_schedule_config_t default_config; odp_pool_t pool; odp_pool_param_t pool_param; odp_queue_param_t queue_param; @@ -432,8 +432,8 @@ static void scheduler_test_queue_size(void) ODP_SCHED_SYNC_ORDERED};
CU_ASSERT_FATAL(odp_queue_capability(&queue_capa) == 0); - odp_scheduler_config_init(&default_config); queue_size = TEST_QUEUE_SIZE_NUM_EV; + odp_schedule_config_init(&default_config); if (default_config.queue_size && queue_size > default_config.queue_size) queue_size = default_config.queue_size; @@ -1662,6 +1662,7 @@ static int create_queues(test_globals_t *globals) int i, j, prios, rc; odp_queue_capability_t capa; odp_schedule_capability_t sched_capa; + odp_schedule_config_t default_config; odp_pool_t queue_ctx_pool; odp_pool_param_t params; odp_buffer_t queue_ctx_buf; @@ -1691,10 +1692,11 @@ static int create_queues(test_globals_t *globals) }
globals->max_sched_queue_size = BUFS_PER_QUEUE_EXCL; - if (sched_capa.max_queue_size && sched_capa.max_queue_size < - BUFS_PER_QUEUE_EXCL) { - printf("Max sched queue size %u\n", sched_capa.max_queue_size); - globals->max_sched_queue_size = sched_capa.max_queue_size; + odp_schedule_config_init(&default_config); + if (default_config.queue_size && + globals->max_sched_queue_size > default_config.queue_size) { + printf("Max sched queue size %u\n", default_config.queue_size); + globals->max_sched_queue_size = default_config.queue_size; }
prios = odp_schedule_num_prio(); @@ -1704,7 +1706,7 @@ static int create_queues(test_globals_t *globals) queues_per_prio = QUEUES_PER_PRIO; num_sched = (prios * queues_per_prio * sched_types) + CHAOS_NUM_QUEUES; num_plain = (prios * queues_per_prio); - while ((num_sched > sched_capa.max_queues || + while ((num_sched > default_config.num_queues || num_plain > capa.plain.max_num || num_sched + num_plain > capa.max_queues) && queues_per_prio) { queues_per_prio--;
commit c290e20364469774d6091426144645e53c257867 Author: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Date: Fri Nov 9 13:01:14 2018 +0300
travis: install graphviz in doxygen test
Install graphviz to stop doxygen from emitting 'missing dot' errors.
Signed-off-by: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Signed-off-by: Balasubramanian Manoharan bala.manoharan@linaro.org 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/.travis.yml b/.travis.yml index 4e29102f..5d958cb4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -183,6 +183,7 @@ jobs: - libconfig-dev - libssl-dev - cmake + - graphviz install: # Updated Doxygen - |
commit 96adbf43bcd91c63dd8c4c248b439ff3150bd1cc Author: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Date: Wed Nov 7 17:41:04 2018 +0300
examples: add calls to odp_schedule_config()
Signed-off-by: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Signed-off-by: Balasubramanian Manoharan bala.manoharan@linaro.org 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/example/classifier/odp_classifier.c b/example/classifier/odp_classifier.c index 22dae395..b8e1c897 100644 --- a/example/classifier/odp_classifier.c +++ b/example/classifier/odp_classifier.c @@ -544,6 +544,9 @@ int main(int argc, char *argv[]) exit(EXIT_FAILURE); }
+ /* Configure scheduler */ + odp_schedule_config(NULL); + /* odp_pool_print(pool); */ odp_atomic_init_u64(&args->total_packets, 0);
diff --git a/example/generator/odp_generator.c b/example/generator/odp_generator.c index 54194c66..34543cd2 100644 --- a/example/generator/odp_generator.c +++ b/example/generator/odp_generator.c @@ -1174,6 +1174,9 @@ int main(int argc, char *argv[]) args->rx_burst_size = args->appl.rx_burst; }
+ /* Configure scheduler */ + odp_schedule_config(NULL); + /* Create packet pool */ odp_pool_param_init(¶ms); params.pkt.seg_len = POOL_PKT_LEN; diff --git a/example/ipsec/odp_ipsec.c b/example/ipsec/odp_ipsec.c index b45a82d7..aff6de0a 100644 --- a/example/ipsec/odp_ipsec.c +++ b/example/ipsec/odp_ipsec.c @@ -1285,6 +1285,9 @@ main(int argc, char *argv[]) exit(EXIT_FAILURE); }
+ /* Configure scheduler */ + odp_schedule_config(NULL); + /* Populate our IPsec cache */ printf("Using %s mode for crypto API\n\n", (CRYPTO_API_SYNC == global->appl.mode) ? "SYNC" : diff --git a/example/ipsec_api/odp_ipsec.c b/example/ipsec_api/odp_ipsec.c index d72109cf..08840d63 100644 --- a/example/ipsec_api/odp_ipsec.c +++ b/example/ipsec_api/odp_ipsec.c @@ -984,6 +984,9 @@ main(int argc, char *argv[]) exit(EXIT_FAILURE); }
+ /* Configure scheduler */ + odp_schedule_config(NULL); + /* Populate our IPsec cache */ printf("Using %s mode for IPsec API\n\n", (ODP_IPSEC_OP_MODE_SYNC == global->appl.mode) ? "SYNC" : diff --git a/example/ipsec_offload/odp_ipsec_offload.c b/example/ipsec_offload/odp_ipsec_offload.c index 90b3f640..4d95b2e5 100644 --- a/example/ipsec_offload/odp_ipsec_offload.c +++ b/example/ipsec_offload/odp_ipsec_offload.c @@ -606,6 +606,9 @@ main(int argc, char *argv[])
ipsec_init_post();
+ /* Configure scheduler */ + odp_schedule_config(NULL); + /* Initialize interfaces (which resolves FWD DB entries */ for (i = 0; i < global->appl.if_count; i++) initialize_intf(global->appl.if_names[i], diff --git a/example/packet/odp_packet_dump.c b/example/packet/odp_packet_dump.c index 5dcb7893..4e3aec8f 100644 --- a/example/packet/odp_packet_dump.c +++ b/example/packet/odp_packet_dump.c @@ -640,6 +640,8 @@ int main(int argc, char *argv[])
global->pool = ODP_POOL_INVALID;
+ odp_schedule_config(NULL); + odp_sys_info_print();
if (open_pktios(global)) { diff --git a/example/packet/odp_pktio.c b/example/packet/odp_pktio.c index 9d96dd2c..f71ae537 100644 --- a/example/packet/odp_pktio.c +++ b/example/packet/odp_pktio.c @@ -412,6 +412,9 @@ int main(int argc, char *argv[]) } odp_pool_print(pool);
+ /* Config and start scheduler */ + odp_schedule_config(NULL); + /* Create a pktio instance for each interface */ for (i = 0; i < args->appl.if_count; ++i) create_pktio(args->appl.if_names[i], pool, args->appl.mode); diff --git a/example/timer/odp_timer_accuracy.c b/example/timer/odp_timer_accuracy.c index 3b0d7e38..9409e340 100644 --- a/example/timer/odp_timer_accuracy.c +++ b/example/timer/odp_timer_accuracy.c @@ -426,6 +426,9 @@ int main(int argc, char *argv[])
odp_sys_info_print();
+ /* Configure scheduler */ + odp_schedule_config(NULL); + num = test_global.opt.num;
test_global.timer = calloc(num, sizeof(odp_timer_t)); diff --git a/example/timer/odp_timer_simple.c b/example/timer/odp_timer_simple.c index 116f8ba6..ddefb0d2 100644 --- a/example/timer/odp_timer_simple.c +++ b/example/timer/odp_timer_simple.c @@ -81,6 +81,9 @@ int main(int argc ODP_UNUSED, char *argv[] ODP_UNUSED) goto err; }
+ /* Configure scheduler */ + odp_schedule_config(NULL); + /* * Create a queue for timer test */ diff --git a/example/timer/odp_timer_test.c b/example/timer/odp_timer_test.c index 9e431b47..68970078 100644 --- a/example/timer/odp_timer_test.c +++ b/example/timer/odp_timer_test.c @@ -409,6 +409,9 @@ int main(int argc, char *argv[]) printf("period: %i usec\n", gbls->args.period_us); printf("timeouts: %i\n", gbls->args.tmo_count);
+ /* Configure scheduler */ + odp_schedule_config(NULL); + /* * Create pool for timeouts */
commit 7563bcf7716cdedf82a9a4f2a8121c45f669a45c Author: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Date: Wed Nov 7 17:41:04 2018 +0300
performance: add calls to odp_schedule_config()
Signed-off-by: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Signed-off-by: Balasubramanian Manoharan bala.manoharan@linaro.org 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/performance/odp_cpu_bench.c b/test/performance/odp_cpu_bench.c index 0d0a23eb..ceabc5b8 100644 --- a/test/performance/odp_cpu_bench.c +++ b/test/performance/odp_cpu_bench.c @@ -528,7 +528,7 @@ int main(int argc, char *argv[]) odp_cpumask_t cpumask; odp_pool_capability_t pool_capa; odp_pool_t pool; - odp_schedule_capability_t schedule_capa; + odp_schedule_config_t schedule_config; odp_shm_t shm; odp_shm_t lookup_tbl_shm; odp_pool_param_t params; @@ -607,26 +607,24 @@ int main(int argc, char *argv[]) printf("first CPU: %i\n", odp_cpumask_first(&cpumask)); printf("cpu mask: %s\n", cpumaskstr);
- if (odp_schedule_capability(&schedule_capa)) { - printf("Error: Schedule capa failed.\n"); - return -1; - } + odp_schedule_config_init(&schedule_config); + odp_schedule_config(&schedule_config);
/* Make sure a single queue can store all the packets in a group */ pkts_per_group = QUEUES_PER_GROUP * PKTS_PER_QUEUE; - if (schedule_capa.max_queue_size && - schedule_capa.max_queue_size < pkts_per_group) - pkts_per_group = schedule_capa.max_queue_size; + if (schedule_config.queue_size && + schedule_config.queue_size < pkts_per_group) + pkts_per_group = schedule_config.queue_size;
/* Divide queues evenly into groups */ - if (schedule_capa.max_queues < QUEUES_PER_GROUP) { + if (schedule_config.num_queues < QUEUES_PER_GROUP) { LOG_ERR("Error: min %d queues required\n", QUEUES_PER_GROUP); return -1; } - num_queues = num_workers > schedule_capa.max_queues ? - schedule_capa.max_queues : num_workers; + num_queues = num_workers > schedule_config.num_queues ? + schedule_config.num_queues : num_workers; num_groups = (num_queues + QUEUES_PER_GROUP - 1) / QUEUES_PER_GROUP; - if (num_groups * QUEUES_PER_GROUP > schedule_capa.max_queues) + if (num_groups * QUEUES_PER_GROUP > schedule_config.num_queues) num_groups--; num_queues = num_groups * QUEUES_PER_GROUP;
diff --git a/test/performance/odp_crypto.c b/test/performance/odp_crypto.c index 61da80e8..635b69f7 100644 --- a/test/performance/odp_crypto.c +++ b/test/performance/odp_crypto.c @@ -1089,6 +1089,7 @@ int main(int argc, char *argv[])
odp_queue_param_init(&qparam); if (cargs.schedule) { + odp_schedule_config(NULL); qparam.type = ODP_QUEUE_TYPE_SCHED; qparam.sched.prio = ODP_SCHED_PRIO_DEFAULT; qparam.sched.sync = ODP_SCHED_SYNC_PARALLEL; diff --git a/test/performance/odp_ipsec.c b/test/performance/odp_ipsec.c index 2184c7a9..e5d53931 100644 --- a/test/performance/odp_ipsec.c +++ b/test/performance/odp_ipsec.c @@ -1079,6 +1079,7 @@ int main(int argc, char *argv[])
odp_queue_param_init(&qparam); if (cargs.schedule) { + odp_schedule_config(NULL); qparam.type = ODP_QUEUE_TYPE_SCHED; qparam.sched.prio = ODP_SCHED_PRIO_DEFAULT; qparam.sched.sync = ODP_SCHED_SYNC_PARALLEL; diff --git a/test/performance/odp_l2fwd.c b/test/performance/odp_l2fwd.c index e1eddb13..cdd67206 100644 --- a/test/performance/odp_l2fwd.c +++ b/test/performance/odp_l2fwd.c @@ -1561,6 +1561,8 @@ int main(int argc, char *argv[])
bind_workers();
+ odp_schedule_config(NULL); + /* Default */ if (num_groups == 0) { group[0] = ODP_SCHED_GROUP_ALL; diff --git a/test/performance/odp_pktio_ordered.c b/test/performance/odp_pktio_ordered.c index 5f647923..ce4925f5 100644 --- a/test/performance/odp_pktio_ordered.c +++ b/test/performance/odp_pktio_ordered.c @@ -1064,6 +1064,7 @@ int main(int argc, char *argv[]) odp_pool_param_t params; odp_shm_t shm; odp_schedule_capability_t schedule_capa; + odp_schedule_config_t schedule_config; odp_pool_capability_t pool_capa; odph_ethaddr_t new_addr; odph_odpthread_t thread_tbl[MAX_WORKERS]; @@ -1120,6 +1121,8 @@ int main(int argc, char *argv[]) /* Parse and store the application arguments */ parse_args(argc, argv, &gbl_args->appl);
+ odp_schedule_config(NULL); + if (gbl_args->appl.in_mode == SCHED_ORDERED) { /* At least one ordered lock required */ if (schedule_capa.max_ordered_locks < 1) { @@ -1149,9 +1152,9 @@ int main(int argc, char *argv[]) pool_size = pool_capa.pkt.max_num;
queue_size = MAX_NUM_PKT; - if (schedule_capa.max_queue_size && - schedule_capa.max_queue_size < MAX_NUM_PKT) - queue_size = schedule_capa.max_queue_size; + if (schedule_config.queue_size && + schedule_config.queue_size < MAX_NUM_PKT) + queue_size = schedule_config.queue_size;
/* Pool should not be larger than queue, otherwise queue enqueues at * packet input may fail. */ diff --git a/test/performance/odp_pktio_perf.c b/test/performance/odp_pktio_perf.c index 7e8a03ee..0e1af0c4 100644 --- a/test/performance/odp_pktio_perf.c +++ b/test/performance/odp_pktio_perf.c @@ -759,6 +759,9 @@ static int test_init(void) iface = gbl_args->args.ifaces[0]; schedule = gbl_args->args.schedule;
+ if (schedule) + odp_schedule_config(NULL); + /* create pktios and associate input/output queues */ gbl_args->pktio_tx = create_pktio(iface, schedule); if (gbl_args->args.num_ifaces > 1) { diff --git a/test/performance/odp_sched_latency.c b/test/performance/odp_sched_latency.c index 873738ef..c0792fa4 100644 --- a/test/performance/odp_sched_latency.c +++ b/test/performance/odp_sched_latency.c @@ -705,6 +705,8 @@ int main(int argc, char *argv[]) memset(globals, 0, sizeof(test_globals_t)); memcpy(&globals->args, &args, sizeof(test_args_t));
+ odp_schedule_config(NULL); + /* * Create event pool */ diff --git a/test/performance/odp_sched_perf.c b/test/performance/odp_sched_perf.c index b25c3e19..c301263e 100644 --- a/test/performance/odp_sched_perf.c +++ b/test/performance/odp_sched_perf.c @@ -43,6 +43,7 @@ typedef struct test_stat_t { typedef struct test_global_t { test_options_t test_options;
+ odp_schedule_config_t schedule_config; odp_barrier_t barrier; odp_pool_t pool; odp_cpumask_t cpumask; @@ -251,7 +252,6 @@ static int create_pool(test_global_t *global)
static int create_queues(test_global_t *global) { - odp_schedule_capability_t schedule_capa; odp_queue_param_t queue_param; odp_queue_t queue; odp_buffer_t buf; @@ -279,20 +279,16 @@ static int create_queues(test_global_t *global)
printf(" queue type %s\n\n", type_str);
- if (odp_schedule_capability(&schedule_capa)) { - printf("Error: Schedule capa failed.\n"); - return -1; - } - - if (tot_queue > schedule_capa.max_queues) { + if (tot_queue > global->schedule_config.num_queues) { printf("Max queues supported %u\n", - schedule_capa.max_queues); + global->schedule_config.num_queues); return -1; }
- if (schedule_capa.max_queue_size && - queue_size > schedule_capa.max_queue_size) { - printf("Max queue size %u\n", schedule_capa.max_queue_size); + if (global->schedule_config.queue_size && + queue_size > global->schedule_config.queue_size) { + printf("Max queue size %u\n", + global->schedule_config.queue_size); return -1; }
@@ -603,6 +599,9 @@ int main(int argc, char **argv) return -1; }
+ odp_schedule_config_init(&global->schedule_config); + odp_schedule_config(&global->schedule_config); + if (set_num_cpu(global)) return -1;
diff --git a/test/performance/odp_sched_pktio.c b/test/performance/odp_sched_pktio.c index ef5fb015..42f879eb 100644 --- a/test/performance/odp_sched_pktio.c +++ b/test/performance/odp_sched_pktio.c @@ -127,6 +127,8 @@ typedef struct { uint64_t rx_pkt_sum; uint64_t tx_pkt_sum;
+ odp_schedule_config_t schedule_config; + } test_global_t;
static test_global_t *test_global; @@ -726,6 +728,9 @@ static int config_setup(test_global_t *test_global) cpu = odp_cpumask_next(cpumask, cpu); }
+ odp_schedule_config_init(&test_global->schedule_config); + odp_schedule_config(&test_global->schedule_config); + if (odp_pool_capability(&pool_capa)) { printf("Error: Pool capability failed.\n"); return -1; @@ -1112,15 +1117,9 @@ static int create_pipeline_queues(test_global_t *test_global) int i, j, k, num_pktio, stages, queues, ctx_size; pipe_queue_context_t *ctx; odp_queue_param_t queue_param; - odp_schedule_capability_t schedule_capa; odp_schedule_sync_t sched_sync; int ret = 0;
- if (odp_schedule_capability(&schedule_capa)) { - printf("Error: Schedule capa failed.\n"); - return -1; - } - num_pktio = test_global->opt.num_pktio; stages = test_global->opt.pipe_stages; queues = test_global->opt.pipe_queues; @@ -1133,10 +1132,10 @@ static int create_pipeline_queues(test_global_t *test_global) queue_param.sched.group = ODP_SCHED_GROUP_ALL;
queue_param.size = test_global->opt.pipe_queue_size; - if (schedule_capa.max_queue_size && - queue_param.size > schedule_capa.max_queue_size) { + if (test_global->schedule_config.queue_size && + queue_param.size > test_global->schedule_config.queue_size) { printf("Error: Pipeline queue max size is %u\n", - schedule_capa.max_queue_size); + test_global->schedule_config.queue_size); return -1; }
diff --git a/test/performance/odp_scheduling.c b/test/performance/odp_scheduling.c index 5e74b172..f17e1aed 100644 --- a/test/performance/odp_scheduling.c +++ b/test/performance/odp_scheduling.c @@ -814,7 +814,7 @@ int main(int argc, char *argv[]) odph_odpthread_params_t thr_params; odp_queue_capability_t capa; odp_pool_capability_t pool_capa; - odp_schedule_capability_t schedule_capa; + odp_schedule_config_t schedule_config; uint32_t num_queues, num_buf;
printf("\nODP example starts\n\n"); @@ -900,15 +900,14 @@ int main(int argc, char *argv[]) return -1; }
- if (odp_schedule_capability(&schedule_capa)) { - printf("Error: Schedule capa failed.\n"); - return -1; - } + odp_schedule_config_init(&schedule_config); + odp_schedule_config(&schedule_config);
globals->queues_per_prio = QUEUES_PER_PRIO; num_queues = globals->queues_per_prio * NUM_PRIOS; - if (num_queues > schedule_capa.max_queues) - globals->queues_per_prio = schedule_capa.max_queues / + if (schedule_config.num_queues && + num_queues > schedule_config.num_queues) + globals->queues_per_prio = schedule_config.num_queues / NUM_PRIOS;
/* One plain queue is also used */
commit 55daa2b0c3b024bfe9b17966fe3d7f10aaa27363 Author: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Date: Wed Nov 7 17:41:04 2018 +0300
validation: add calls to odp_schedule_config()
Signed-off-by: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Signed-off-by: Balasubramanian Manoharan bala.manoharan@linaro.org 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/common/odp_cunit_common.c b/test/common/odp_cunit_common.c index 6b9ded4a..ed0651ad 100644 --- a/test/common/odp_cunit_common.c +++ b/test/common/odp_cunit_common.c @@ -87,6 +87,10 @@ static int tests_global_init(odp_instance_t *inst) fprintf(stderr, "error: odp_init_local() failed.\n"); return -1; } + if (0 != odp_schedule_config(NULL)) { + fprintf(stderr, "error: odp_schedule_config(NULL) failed.\n"); + return -1; + }
return 0; } diff --git a/test/validation/api/timer/timer.c b/test/validation/api/timer/timer.c index 197ad2d2..968812c8 100644 --- a/test/validation/api/timer/timer.c +++ b/test/validation/api/timer/timer.c @@ -82,6 +82,9 @@ static int timer_global_init(odp_instance_t *inst) global_mem = odp_shm_addr(global_shm); memset(global_mem, 0, sizeof(global_shared_mem_t));
+ /* Configure scheduler */ + odp_schedule_config(NULL); + return 0; }
commit bab62d6ee6e1072bedbb49bcf747fecfb99b24df Author: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Date: Wed Nov 7 17:39:48 2018 +0300
linux-gen: implement odp_schedule_config() API call
Add odp_schedule_config() stub, which does nothing at this point. Use it to actually check (in debug mode) that application call it in proper place.
Signed-off-by: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Signed-off-by: Balasubramanian Manoharan bala.manoharan@linaro.org 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/include/odp_schedule_if.h b/platform/linux-generic/include/odp_schedule_if.h index abc64d0d..15c91590 100644 --- a/platform/linux-generic/include/odp_schedule_if.h +++ b/platform/linux-generic/include/odp_schedule_if.h @@ -87,10 +87,17 @@ int sched_cb_pktin_poll(int pktio_index, int pktin_index, int sched_cb_pktin_poll_one(int pktio_index, int rx_queue, odp_event_t evts[]); void sched_cb_pktio_stop_finalize(int pktio_index);
+/* For debugging */ +#ifdef ODP_DEBUG +extern int _odp_schedule_configured; +#endif + /* API functions */ typedef struct { uint64_t (*schedule_wait_time)(uint64_t ns); int (*schedule_capability)(odp_schedule_capability_t *capa); + void (*schedule_config_init)(odp_schedule_config_t *config); + int (*schedule_config)(const odp_schedule_config_t *config); odp_event_t (*schedule)(odp_queue_t *from, uint64_t wait); int (*schedule_multi)(odp_queue_t *from, uint64_t wait, odp_event_t events[], int num); diff --git a/platform/linux-generic/odp_schedule_basic.c b/platform/linux-generic/odp_schedule_basic.c index 4bc5b4ab..9cf00acb 100644 --- a/platform/linux-generic/odp_schedule_basic.c +++ b/platform/linux-generic/odp_schedule_basic.c @@ -598,6 +598,8 @@ static int schedule_init_queue(uint32_t queue_index, int i; int prio = prio_level_from_api(sched_param->prio);
+ ODP_ASSERT(_odp_schedule_configured); + pri_set_queue(queue_index, prio); sched->queue[queue_index].grp = sched_param->group; sched->queue[queue_index].prio = prio; @@ -798,6 +800,19 @@ static int schedule_term_local(void) return 0; }
+static void schedule_config_init(odp_schedule_config_t *config) +{ + config->num_queues = ODP_CONFIG_QUEUES - NUM_INTERNAL_QUEUES; + config->queue_size = queue_glb->config.max_queue_size; +} + +static int schedule_config(const odp_schedule_config_t *config) +{ + (void)config; + + return 0; +} + static inline int copy_from_stash(odp_event_t out_ev[], unsigned int max) { int i = 0; @@ -1587,6 +1602,8 @@ const schedule_fn_t schedule_basic_fn = { const schedule_api_t schedule_basic_api = { .schedule_wait_time = schedule_wait_time, .schedule_capability = schedule_capability, + .schedule_config_init = schedule_config_init, + .schedule_config = schedule_config, .schedule = schedule, .schedule_multi = schedule_multi, .schedule_multi_wait = schedule_multi_wait, diff --git a/platform/linux-generic/odp_schedule_if.c b/platform/linux-generic/odp_schedule_if.c index 92e0a62f..cb52f155 100644 --- a/platform/linux-generic/odp_schedule_if.c +++ b/platform/linux-generic/odp_schedule_if.c @@ -25,6 +25,10 @@ extern const schedule_api_t schedule_scalable_api; const schedule_fn_t *sched_fn; const schedule_api_t *sched_api;
+#ifdef ODP_DEBUG +int _odp_schedule_configured; +#endif + uint64_t odp_schedule_wait_time(uint64_t ns) { return sched_api->schedule_wait_time(ns); @@ -35,14 +39,46 @@ int odp_schedule_capability(odp_schedule_capability_t *capa) return sched_api->schedule_capability(capa); }
+void odp_schedule_config_init(odp_schedule_config_t *config) +{ + memset(config, 0, sizeof(*config)); + + sched_api->schedule_config_init(config); +} + +int odp_schedule_config(const odp_schedule_config_t *config) +{ + int ret; + odp_schedule_config_t defconfig; + + ODP_ASSERT(!_odp_schedule_configured); + + if (!config) { + odp_schedule_config_init(&defconfig); + config = &defconfig; + } + + ret = sched_api->schedule_config(config); +#ifdef ODP_DEBUG + if (ret >= 0) + _odp_schedule_configured = 1; +#endif + + return ret; +} + odp_event_t odp_schedule(odp_queue_t *from, uint64_t wait) { + ODP_ASSERT(_odp_schedule_configured); + return sched_api->schedule(from, wait); }
int odp_schedule_multi(odp_queue_t *from, uint64_t wait, odp_event_t events[], int num) { + ODP_ASSERT(_odp_schedule_configured); + return sched_api->schedule_multi(from, wait, events, num); }
diff --git a/platform/linux-generic/odp_schedule_scalable.c b/platform/linux-generic/odp_schedule_scalable.c index b426ca67..92a5c72b 100644 --- a/platform/linux-generic/odp_schedule_scalable.c +++ b/platform/linux-generic/odp_schedule_scalable.c @@ -2000,6 +2000,19 @@ static int schedule_term_local(void) return rc; }
+static void schedule_config_init(odp_schedule_config_t *config) +{ + config->num_queues = ODP_CONFIG_QUEUES - NUM_INTERNAL_QUEUES; + config->queue_size = 0; /* FIXME ? */ +} + +static int schedule_config(const odp_schedule_config_t *config) +{ + (void)config; + + return 0; +} + static int num_grps(void) { return MAX_SCHED_GROUP; @@ -2147,6 +2160,8 @@ const schedule_fn_t schedule_scalable_fn = { const schedule_api_t schedule_scalable_api = { .schedule_wait_time = schedule_wait_time, .schedule_capability = schedule_capability, + .schedule_config_init = schedule_config_init, + .schedule_config = schedule_config, .schedule = schedule, .schedule_multi = schedule_multi, .schedule_multi_wait = schedule_multi_wait, diff --git a/platform/linux-generic/odp_schedule_sp.c b/platform/linux-generic/odp_schedule_sp.c index e748699d..b8f805ac 100644 --- a/platform/linux-generic/odp_schedule_sp.c +++ b/platform/linux-generic/odp_schedule_sp.c @@ -257,6 +257,19 @@ static int term_local(void) return 0; }
+static void schedule_config_init(odp_schedule_config_t *config) +{ + config->num_queues = ODP_CONFIG_QUEUES - NUM_INTERNAL_QUEUES; + config->queue_size = queue_glb->config.max_queue_size; +} + +static int schedule_config(const odp_schedule_config_t *config) +{ + (void)config; + + return 0; +} + static uint32_t max_ordered_locks(void) { return NUM_ORDERED_LOCKS; @@ -362,6 +375,11 @@ static int init_queue(uint32_t qi, const odp_schedule_param_t *sched_param) odp_schedule_group_t group = sched_param->group; int prio = 0;
+#ifdef ODP_DEBUG + if (!_odp_schedule_configured) + ODP_ABORT("Scheduler not configured!\n"); +#endif + if (group < 0 || group >= NUM_GROUP) return -1;
@@ -959,6 +977,8 @@ const schedule_fn_t schedule_sp_fn = { const schedule_api_t schedule_sp_api = { .schedule_wait_time = schedule_wait_time, .schedule_capability = schedule_capability, + .schedule_config_init = schedule_config_init, + .schedule_config = schedule_config, .schedule = schedule, .schedule_multi = schedule_multi, .schedule_multi_wait = schedule_multi_wait,
commit 6cede326ec2f9d9d5965419c1963a7cd541a7802 Author: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Date: Wed Nov 7 16:46:50 2018 +0300
linux-gen: schedule: rename config to get_config
Rename config function to get_config to avoid collisions.
Signed-off-by: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Signed-off-by: Balasubramanian Manoharan bala.manoharan@linaro.org 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/include/odp_schedule_if.h b/platform/linux-generic/include/odp_schedule_if.h index 88961269..abc64d0d 100644 --- a/platform/linux-generic/include/odp_schedule_if.h +++ b/platform/linux-generic/include/odp_schedule_if.h @@ -53,7 +53,7 @@ typedef void (*schedule_order_unlock_lock_fn_t)(void); typedef void (*schedule_order_lock_start_fn_t)(void); typedef void (*schedule_order_lock_wait_fn_t)(void); typedef uint32_t (*schedule_max_ordered_locks_fn_t)(void); -typedef void (*schedule_config_fn_t)(schedule_config_t *config); +typedef void (*schedule_get_config_fn_t)(schedule_config_t *config);
typedef struct schedule_fn_t { schedule_pktio_start_fn_t pktio_start; @@ -74,7 +74,7 @@ typedef struct schedule_fn_t { schedule_order_lock_wait_fn_t wait_order_lock; schedule_order_unlock_lock_fn_t order_unlock_lock; schedule_max_ordered_locks_fn_t max_ordered_locks; - schedule_config_fn_t config; + schedule_get_config_fn_t get_config;
} schedule_fn_t;
diff --git a/platform/linux-generic/odp_schedule_basic.c b/platform/linux-generic/odp_schedule_basic.c index 116cbc5c..4bc5b4ab 100644 --- a/platform/linux-generic/odp_schedule_basic.c +++ b/platform/linux-generic/odp_schedule_basic.c @@ -1545,7 +1545,7 @@ static int schedule_num_grps(void) return NUM_SCHED_GRPS; }
-static void schedule_config(schedule_config_t *config) +static void schedule_get_config(schedule_config_t *config) { *config = *(&sched->config_if); }; @@ -1580,7 +1580,7 @@ const schedule_fn_t schedule_basic_fn = { .order_lock = order_lock, .order_unlock = order_unlock, .max_ordered_locks = schedule_max_ordered_locks, - .config = schedule_config + .get_config = schedule_get_config };
/* Fill in scheduler API calls */ diff --git a/platform/linux-generic/odp_thread.c b/platform/linux-generic/odp_thread.c index 7728929b..b30174dd 100644 --- a/platform/linux-generic/odp_thread.c +++ b/platform/linux-generic/odp_thread.c @@ -142,10 +142,10 @@ int odp_thread_init_local(odp_thread_type_t type) group_worker = 1; group_control = 1;
- if (sched_fn->config) { + if (sched_fn->get_config) { schedule_config_t schedule_config;
- sched_fn->config(&schedule_config); + sched_fn->get_config(&schedule_config); group_all = schedule_config.group_enable.all; group_worker = schedule_config.group_enable.worker; group_control = schedule_config.group_enable.control; @@ -196,10 +196,10 @@ int odp_thread_term_local(void) group_worker = 1; group_control = 1;
- if (sched_fn->config) { + if (sched_fn->get_config) { schedule_config_t schedule_config;
- sched_fn->config(&schedule_config); + sched_fn->get_config(&schedule_config); group_all = schedule_config.group_enable.all; group_worker = schedule_config.group_enable.worker; group_control = schedule_config.group_enable.control;
commit e93e8c3ea659c9a64aef3f53ae8932b31dfcef95 Author: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Date: Wed Oct 31 13:45:09 2018 +0300
api: schedule: add scheduler flow aware mode
ODP scheduler configuration to support flow aware mode
Signed-off-by: Balasubramanian Manoharan bala.manoharan@linaro.org Signed-off-by: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Signed-off-by: Balasubramanian Manoharan bala.manoharan@linaro.org 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/event.h b/include/odp/api/spec/event.h index d9f7ab73..affdc7b0 100644 --- a/include/odp/api/spec/event.h +++ b/include/odp/api/spec/event.h @@ -209,6 +209,44 @@ void odp_event_free_multi(const odp_event_t event[], int num); */ void odp_event_free_sp(const odp_event_t event[], int num);
+/** + * Event flow id value + * + * Returns the flow id value set in the event. + * Usage of flow id enables scheduler to maintain multiple synchronization + * contexts per single queue. For example, when multiple flows are assigned to + * an atomic queue, events of a single flow (events from the same queue with + * the same flow id value) are guaranteed to be processed by only single thread + * at a time. For packets received through packet input initial + * event flow id will be same as flow hash generated for packets. The hash + * algorithm and therefore the resulting flow id value is implementation + * specific. Use pktio API configuration options to select the fields used for + * initial flow id calculation. For all other events initial flow id is zero + * An application can change event flow id using odp_event_flow_id_set(). + * + * @param event Event handle + * + * @return Flow id of the event + * + */ +uint32_t odp_event_flow_id(odp_event_t event); + +/** + * Set event flow id value + * + * Store the event flow id for the event and sets the flow id flag. + * When scheduler is configured as flow aware, scheduled queue synchronization + * will be based on this id within each queue. + * When scheduler is configured as flow unaware, event flow id is ignored by + * the implementation. + * The value of flow id must be less than the number of flows configured in the + * scheduler. + * + * @param event Event handle + * @param flow_id Flow event id to be set. + */ +void odp_event_flow_id_set(odp_event_t event, uint32_t flow_id); + /** * @} */ diff --git a/include/odp/api/spec/schedule_types.h b/include/odp/api/spec/schedule_types.h index 0b75d17d..3648c64e 100644 --- a/include/odp/api/spec/schedule_types.h +++ b/include/odp/api/spec/schedule_types.h @@ -78,6 +78,9 @@ extern "C" { * requests another event from the scheduler, which implicitly releases the * context. User may allow the scheduler to release the context earlier than * that by calling odp_schedule_release_atomic(). + * When scheduler is enabled as flow-aware, the event flow id value affects + * scheduling of the event and synchronization is maintained per flow within + * each queue. */
/** @@ -104,6 +107,9 @@ extern "C" { * (e.g. freed or stored) within the context are considered missing from * reordering and are skipped at this time (but can be ordered again within * another context). + * When scheduler is enabled as flow-aware, the event flow id value affects + * scheduling of the event and synchronization is maintained per flow within + * each queue. */
/** @@ -190,6 +196,13 @@ typedef struct odp_schedule_capability_t { * events. */ uint32_t max_queue_size;
+ /** Maximum supported flows per queue. + * Specifies the maximum number of flows per queue supported by the + * implementation. A value of 0 indicates flow aware mode is not + * supported. + */ + uint32_t max_flows; + /** Lock-free (ODP_NONBLOCKING_LF) queues support. * The specification is the same as for the blocking implementation. */ odp_support_t lockfree_queues; @@ -217,6 +230,22 @@ typedef struct odp_schedule_config_t { */ uint32_t queue_size;
+ /** Number of flows per queue to be supported. Scheduler enables flow + * aware mode when flow count is configured greater than 1 (up to + * 'max_flows' capability). + * + * Flows are lightweight entities and events can be assigned to + * specific flows by the application using odp_event_flow_id_set() + * before enqueuing the event into the scheduler. This value is ignored + * unless scheduler supports flow aware mode. + * + * This number should be less than maximum flow supported by the + * implementation. The default value is zero. + * + * @see odp_schedule_capability_t + */ + uint32_t num_flows; + } odp_schedule_config_t;
/**
commit 5d1f07269026cdc371973a5edb2373113698e3c8 Author: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Date: Wed Oct 24 17:55:18 2018 +0300
api: schedule: add scheduler config and start API
Add API calls to configure and start scheduler subsystem.
Signed-off-by: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Signed-off-by: Balasubramanian Manoharan bala.manoharan@linaro.org 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/schedule.h b/include/odp/api/spec/schedule.h index 6538c509..43292124 100644 --- a/include/odp/api/spec/schedule.h +++ b/include/odp/api/spec/schedule.h @@ -257,6 +257,44 @@ int odp_schedule_default_prio(void); */ int odp_schedule_num_prio(void);
+/** + * Initialize schedule configuration options + * + * Initialize an odp_schedule_config_t to its default values. + * + * @param[out] config Pointer to schedule configuration structure + */ +void odp_schedule_config_init(odp_schedule_config_t *config); + +/** + * Global schedule configuration + * + * Initialize and configure scheduler with global configuration options + * to schedule events across different scheduled queues. + * This function must be called before scheduler is used (any other scheduler + * function is called except odp_schedule_capability() and + * odp_schedule_config_init()) or any queues are created (by application itself + * or by other ODP modules). + * An application can pass NULL value to use default configuration. It will + * have the same result as filling the structure with + * odp_schedule_config_init() and then passing it to odp_schedule_config(). + * + * The initialization sequeunce should be, + * odp_schedule_capability() + * odp_schedule_config_init() + * odp_schedule_config() + * odp_schedule() + * + * @param config Pointer to scheduler configuration structure or NULL for the + * default configuration + * + * @retval 0 on success + * @retval <0 on failure + * + * @see odp_schedule_capability(), odp_schedule_config_init() + */ +int odp_schedule_config(const odp_schedule_config_t *config); + /** * Query scheduler capabilities * diff --git a/include/odp/api/spec/schedule_types.h b/include/odp/api/spec/schedule_types.h index e7cc0479..0b75d17d 100644 --- a/include/odp/api/spec/schedule_types.h +++ b/include/odp/api/spec/schedule_types.h @@ -200,6 +200,25 @@ typedef struct odp_schedule_capability_t {
} odp_schedule_capability_t;
+/** + * Schedule configuration + */ +typedef struct odp_schedule_config_t { + /** Maximum number of scheduled queues to be supported. + * + * @see odp_schedule_capability_t + */ + uint32_t num_queues; + + /** Maximum number of events required to be stored simultaneously in + * scheduled queue. This number must not exceed 'max_queue_size' + * capability. A value of 0 configures default queue size supported by + * the implementation. + */ + uint32_t queue_size; + +} odp_schedule_config_t; + /** * @} */
commit 3bf94540be3400cb741903b9b44ddc62b14cf397 Author: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Date: Wed Oct 31 13:47:52 2018 +0300
example, tests: move scheduled queue capabilities to sched
Move scheduled queue capabilities to odp_schedule_capability_t structure, as they logically belong to ODP scheduler module, rather than queue module.
Signed-off-by: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Signed-off-by: Balasubramanian Manoharan bala.manoharan@linaro.org 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/example/sysinfo/odp_sysinfo.c b/example/sysinfo/odp_sysinfo.c index f0b0241d..9f55872b 100644 --- a/example/sysinfo/odp_sysinfo.c +++ b/example/sysinfo/odp_sysinfo.c @@ -401,19 +401,15 @@ int main(void) printf(" max ordered locks: %" PRIu32 "\n", schedule_capa.max_ordered_locks); printf(" max groups: %u\n", schedule_capa.max_groups); - printf(" priorities: %u\n", schedule_capa.prios); - printf(" sched.max_num: %" PRIu32 "\n", - queue_capa.sched.max_num); - printf(" sched.max_size: %" PRIu32 "\n", - queue_capa.sched.max_size); - printf(" sched.lf.max_num: %" PRIu32 "\n", - queue_capa.sched.lockfree.max_num); - printf(" sched.lf.max_size: %" PRIu32 "\n", - queue_capa.sched.lockfree.max_size); - printf(" sched.wf.max_num: %" PRIu32 "\n", - queue_capa.sched.waitfree.max_num); - printf(" sched.wf.max_size: %" PRIu32 "\n", - queue_capa.sched.waitfree.max_size); + printf(" priorities: %u\n", schedule_capa.max_prios); + printf(" sched.max_queues: %" PRIu32 "\n", + schedule_capa.max_queues); + printf(" sched.max_queue_size: %" PRIu32 "\n", + schedule_capa.max_queue_size); + printf(" sched.lf_queues: %ssupported\n", + schedule_capa.lockfree_queues ? "" : "not "); + printf(" sched.wf_queues: %ssupported\n", + schedule_capa.waitfree_queues ? "" : "not ");
printf("\n"); printf(" TIMER\n"); diff --git a/test/performance/odp_cpu_bench.c b/test/performance/odp_cpu_bench.c index 196af346..0d0a23eb 100644 --- a/test/performance/odp_cpu_bench.c +++ b/test/performance/odp_cpu_bench.c @@ -528,7 +528,7 @@ int main(int argc, char *argv[]) odp_cpumask_t cpumask; odp_pool_capability_t pool_capa; odp_pool_t pool; - odp_queue_capability_t queue_capa; + odp_schedule_capability_t schedule_capa; odp_shm_t shm; odp_shm_t lookup_tbl_shm; odp_pool_param_t params; @@ -607,27 +607,26 @@ int main(int argc, char *argv[]) printf("first CPU: %i\n", odp_cpumask_first(&cpumask)); printf("cpu mask: %s\n", cpumaskstr);
- /* Create application queues */ - if (odp_queue_capability(&queue_capa)) { - LOG_ERR("Error: odp_queue_capability() failed\n"); - exit(EXIT_FAILURE); + if (odp_schedule_capability(&schedule_capa)) { + printf("Error: Schedule capa failed.\n"); + return -1; }
/* Make sure a single queue can store all the packets in a group */ pkts_per_group = QUEUES_PER_GROUP * PKTS_PER_QUEUE; - if (queue_capa.sched.max_size && - queue_capa.sched.max_size < pkts_per_group) - pkts_per_group = queue_capa.sched.max_size; + if (schedule_capa.max_queue_size && + schedule_capa.max_queue_size < pkts_per_group) + pkts_per_group = schedule_capa.max_queue_size;
/* Divide queues evenly into groups */ - if (queue_capa.sched.max_num < QUEUES_PER_GROUP) { + if (schedule_capa.max_queues < QUEUES_PER_GROUP) { LOG_ERR("Error: min %d queues required\n", QUEUES_PER_GROUP); return -1; } - num_queues = num_workers > queue_capa.sched.max_num ? - queue_capa.sched.max_num : num_workers; + num_queues = num_workers > schedule_capa.max_queues ? + schedule_capa.max_queues : num_workers; num_groups = (num_queues + QUEUES_PER_GROUP - 1) / QUEUES_PER_GROUP; - if (num_groups * QUEUES_PER_GROUP > queue_capa.sched.max_num) + if (num_groups * QUEUES_PER_GROUP > schedule_capa.max_queues) num_groups--; num_queues = num_groups * QUEUES_PER_GROUP;
diff --git a/test/performance/odp_pktio_ordered.c b/test/performance/odp_pktio_ordered.c index f0939eb5..5f647923 100644 --- a/test/performance/odp_pktio_ordered.c +++ b/test/performance/odp_pktio_ordered.c @@ -1063,7 +1063,6 @@ int main(int argc, char *argv[]) odp_pool_t pool; odp_pool_param_t params; odp_shm_t shm; - odp_queue_capability_t queue_capa; odp_schedule_capability_t schedule_capa; odp_pool_capability_t pool_capa; odph_ethaddr_t new_addr; @@ -1090,11 +1089,6 @@ int main(int argc, char *argv[]) exit(EXIT_FAILURE); }
- if (odp_queue_capability(&queue_capa)) { - LOG_ERR("Error: Queue capa failed\n"); - exit(EXIT_FAILURE); - } - if (odp_schedule_capability(&schedule_capa)) { printf("Error: Schedule capa failed.\n"); return -1; @@ -1155,9 +1149,9 @@ int main(int argc, char *argv[]) pool_size = pool_capa.pkt.max_num;
queue_size = MAX_NUM_PKT; - if (queue_capa.sched.max_size && - queue_capa.sched.max_size < MAX_NUM_PKT) - queue_size = queue_capa.sched.max_size; + if (schedule_capa.max_queue_size && + schedule_capa.max_queue_size < MAX_NUM_PKT) + queue_size = schedule_capa.max_queue_size;
/* Pool should not be larger than queue, otherwise queue enqueues at * packet input may fail. */ diff --git a/test/performance/odp_sched_perf.c b/test/performance/odp_sched_perf.c index bbd76c86..b25c3e19 100644 --- a/test/performance/odp_sched_perf.c +++ b/test/performance/odp_sched_perf.c @@ -251,7 +251,7 @@ static int create_pool(test_global_t *global)
static int create_queues(test_global_t *global) { - odp_queue_capability_t queue_capa; + odp_schedule_capability_t schedule_capa; odp_queue_param_t queue_param; odp_queue_t queue; odp_buffer_t buf; @@ -279,19 +279,20 @@ static int create_queues(test_global_t *global)
printf(" queue type %s\n\n", type_str);
- if (odp_queue_capability(&queue_capa)) { - printf("Error: Queue capa failed.\n"); + if (odp_schedule_capability(&schedule_capa)) { + printf("Error: Schedule capa failed.\n"); return -1; }
- if (tot_queue > queue_capa.sched.max_num) { - printf("Max queues supported %u\n", queue_capa.sched.max_num); + if (tot_queue > schedule_capa.max_queues) { + printf("Max queues supported %u\n", + schedule_capa.max_queues); return -1; }
- if (queue_capa.sched.max_size && - queue_size > queue_capa.sched.max_size) { - printf("Max queue size %u\n", queue_capa.sched.max_size); + if (schedule_capa.max_queue_size && + queue_size > schedule_capa.max_queue_size) { + printf("Max queue size %u\n", schedule_capa.max_queue_size); return -1; }
diff --git a/test/performance/odp_sched_pktio.c b/test/performance/odp_sched_pktio.c index 82f74422..ef5fb015 100644 --- a/test/performance/odp_sched_pktio.c +++ b/test/performance/odp_sched_pktio.c @@ -1112,12 +1112,12 @@ static int create_pipeline_queues(test_global_t *test_global) int i, j, k, num_pktio, stages, queues, ctx_size; pipe_queue_context_t *ctx; odp_queue_param_t queue_param; - odp_queue_capability_t queue_capa; + odp_schedule_capability_t schedule_capa; odp_schedule_sync_t sched_sync; int ret = 0;
- if (odp_queue_capability(&queue_capa)) { - printf("Error: Queue capability failed\n"); + if (odp_schedule_capability(&schedule_capa)) { + printf("Error: Schedule capa failed.\n"); return -1; }
@@ -1133,10 +1133,10 @@ static int create_pipeline_queues(test_global_t *test_global) queue_param.sched.group = ODP_SCHED_GROUP_ALL;
queue_param.size = test_global->opt.pipe_queue_size; - if (queue_capa.sched.max_size && - queue_param.size > queue_capa.sched.max_size) { + if (schedule_capa.max_queue_size && + queue_param.size > schedule_capa.max_queue_size) { printf("Error: Pipeline queue max size is %u\n", - queue_capa.sched.max_size); + schedule_capa.max_queue_size); return -1; }
diff --git a/test/performance/odp_scheduling.c b/test/performance/odp_scheduling.c index 5eeb6926..5e74b172 100644 --- a/test/performance/odp_scheduling.c +++ b/test/performance/odp_scheduling.c @@ -814,6 +814,7 @@ int main(int argc, char *argv[]) odph_odpthread_params_t thr_params; odp_queue_capability_t capa; odp_pool_capability_t pool_capa; + odp_schedule_capability_t schedule_capa; uint32_t num_queues, num_buf;
printf("\nODP example starts\n\n"); @@ -899,10 +900,16 @@ int main(int argc, char *argv[]) return -1; }
+ if (odp_schedule_capability(&schedule_capa)) { + printf("Error: Schedule capa failed.\n"); + return -1; + } + globals->queues_per_prio = QUEUES_PER_PRIO; num_queues = globals->queues_per_prio * NUM_PRIOS; - if (num_queues > capa.sched.max_num) - globals->queues_per_prio = capa.sched.max_num / NUM_PRIOS; + if (num_queues > schedule_capa.max_queues) + globals->queues_per_prio = schedule_capa.max_queues / + NUM_PRIOS;
/* One plain queue is also used */ num_queues = (globals->queues_per_prio * NUM_PRIOS) + 1; diff --git a/test/validation/api/queue/queue.c b/test/validation/api/queue/queue.c index 99acc4bf..aab95bab 100644 --- a/test/validation/api/queue/queue.c +++ b/test/validation/api/queue/queue.c @@ -127,18 +127,15 @@ static void queue_test_capa(void) odp_queue_param_t qparams; char name[ODP_QUEUE_NAME_LEN]; odp_queue_t queue[MAX_QUEUES]; - uint32_t num_queues, min, i, j; + uint32_t num_queues, min, i;
memset(&capa, 0, sizeof(odp_queue_capability_t)); CU_ASSERT(odp_queue_capability(&capa) == 0);
CU_ASSERT(capa.max_queues != 0); CU_ASSERT(capa.plain.max_num != 0); - CU_ASSERT(capa.sched.max_num != 0);
min = capa.plain.max_num; - if (min > capa.sched.max_num) - min = capa.sched.max_num;
CU_ASSERT(capa.max_queues >= min);
@@ -150,33 +147,26 @@ static void queue_test_capa(void) odp_queue_param_init(&qparams); CU_ASSERT(qparams.nonblocking == ODP_BLOCKING);
- for (j = 0; j < 2; j++) { - if (j == 0) { - num_queues = capa.plain.max_num; - } else { - num_queues = capa.sched.max_num; - qparams.type = ODP_QUEUE_TYPE_SCHED; - } + num_queues = capa.plain.max_num;
- if (num_queues > MAX_QUEUES) - num_queues = MAX_QUEUES; + if (num_queues > MAX_QUEUES) + num_queues = MAX_QUEUES;
- for (i = 0; i < num_queues; i++) { - generate_name(name, i); - queue[i] = odp_queue_create(name, &qparams); + for (i = 0; i < num_queues; i++) { + generate_name(name, i); + queue[i] = odp_queue_create(name, &qparams);
- if (queue[i] == ODP_QUEUE_INVALID) { - CU_FAIL("Queue create failed"); - num_queues = i; - break; - } - - CU_ASSERT(odp_queue_lookup(name) != ODP_QUEUE_INVALID); + if (queue[i] == ODP_QUEUE_INVALID) { + CU_FAIL("Queue create failed"); + num_queues = i; + break; }
- for (i = 0; i < num_queues; i++) - CU_ASSERT(odp_queue_destroy(queue[i]) == 0); + CU_ASSERT(odp_queue_lookup(name) != ODP_QUEUE_INVALID); } + + for (i = 0; i < num_queues; i++) + CU_ASSERT(odp_queue_destroy(queue[i]) == 0); }
static void queue_test_mode(void) diff --git a/test/validation/api/scheduler/scheduler.c b/test/validation/api/scheduler/scheduler.c index 35c38751..4fdfc243 100644 --- a/test/validation/api/scheduler/scheduler.c +++ b/test/validation/api/scheduler/scheduler.c @@ -20,6 +20,7 @@ #define NUM_BUFS_PAUSE 1000 #define NUM_BUFS_BEFORE_PAUSE 10 #define NUM_GROUPS 2 +#define MAX_QUEUES (64 * 1024)
#define TEST_QUEUE_SIZE_NUM_EV 50
@@ -144,12 +145,16 @@ static void release_context(odp_schedule_sync_t sync) static void scheduler_test_capa(void) { odp_schedule_capability_t capa; + odp_queue_capability_t queue_capa;
memset(&capa, 0, sizeof(odp_schedule_capability_t)); CU_ASSERT_FATAL(odp_schedule_capability(&capa) == 0); + CU_ASSERT_FATAL(odp_queue_capability(&queue_capa) == 0);
CU_ASSERT(capa.max_groups != 0); CU_ASSERT(capa.max_prios != 0); + CU_ASSERT(capa.max_queues != 0); + CU_ASSERT(queue_capa.max_queues >= capa.max_queues); }
static void scheduler_test_wait_time(void) @@ -413,6 +418,7 @@ static void scheduler_test_wait(void) static void scheduler_test_queue_size(void) { odp_queue_capability_t queue_capa; + odp_scheduler_config_t default_config; odp_pool_t pool; odp_pool_param_t pool_param; odp_queue_param_t queue_param; @@ -426,10 +432,11 @@ static void scheduler_test_queue_size(void) ODP_SCHED_SYNC_ORDERED};
CU_ASSERT_FATAL(odp_queue_capability(&queue_capa) == 0); + odp_scheduler_config_init(&default_config); queue_size = TEST_QUEUE_SIZE_NUM_EV; - if (queue_capa.sched.max_size && - queue_size > queue_capa.sched.max_size) - queue_size = queue_capa.sched.max_size; + if (default_config.queue_size && + queue_size > default_config.queue_size) + queue_size = default_config.queue_size;
odp_pool_param_init(&pool_param); pool_param.buf.size = 100; @@ -1684,9 +1691,10 @@ static int create_queues(test_globals_t *globals) }
globals->max_sched_queue_size = BUFS_PER_QUEUE_EXCL; - if (capa.sched.max_size && capa.sched.max_size < BUFS_PER_QUEUE_EXCL) { - printf("Max sched queue size %u\n", capa.sched.max_size); - globals->max_sched_queue_size = capa.sched.max_size; + if (sched_capa.max_queue_size && sched_capa.max_queue_size < + BUFS_PER_QUEUE_EXCL) { + printf("Max sched queue size %u\n", sched_capa.max_queue_size); + globals->max_sched_queue_size = sched_capa.max_queue_size; }
prios = odp_schedule_num_prio(); @@ -1696,7 +1704,7 @@ static int create_queues(test_globals_t *globals) queues_per_prio = QUEUES_PER_PRIO; num_sched = (prios * queues_per_prio * sched_types) + CHAOS_NUM_QUEUES; num_plain = (prios * queues_per_prio); - while ((num_sched > capa.sched.max_num || + while ((num_sched > sched_capa.max_queues || num_plain > capa.plain.max_num || num_sched + num_plain > capa.max_queues) && queues_per_prio) { queues_per_prio--;
commit b6e973744e52db038d9e0886fcaef014eff05cb5 Author: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Date: Wed Oct 31 13:47:52 2018 +0300
linux-gen: queue, schedule: move scheduled queue capabilities to sched
Move scheduled queue capabilities to odp_schedule_capability_t structure, as they logically belong to ODP scheduler module, rather than queue module.
Signed-off-by: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Signed-off-by: Balasubramanian Manoharan bala.manoharan@linaro.org 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_queue_basic.c b/platform/linux-generic/odp_queue_basic.c index e40ce399..0d50c764 100644 --- a/platform/linux-generic/odp_queue_basic.c +++ b/platform/linux-generic/odp_queue_basic.c @@ -58,10 +58,10 @@ static int queue_capa(odp_queue_capability_t *capa, int sched ODP_UNUSED) capa->plain.max_size = queue_glb->config.max_queue_size; capa->plain.lockfree.max_num = queue_glb->queue_lf_num; capa->plain.lockfree.max_size = queue_glb->queue_lf_size; +#if ODP_DEPRECATED_API capa->sched.max_num = capa->max_queues; capa->sched.max_size = queue_glb->config.max_queue_size;
-#if ODP_DEPRECATED_API if (sched) { capa->max_ordered_locks = sched_fn->max_ordered_locks(); capa->max_sched_groups = sched_fn->num_grps(); diff --git a/platform/linux-generic/odp_queue_scalable.c b/platform/linux-generic/odp_queue_scalable.c index 0fdf7cda..8b89a227 100644 --- a/platform/linux-generic/odp_queue_scalable.c +++ b/platform/linux-generic/odp_queue_scalable.c @@ -322,11 +322,11 @@ static int queue_capability(odp_queue_capability_t *capa) capa->max_ordered_locks = sched_fn->max_ordered_locks(); capa->max_sched_groups = sched_fn->num_grps(); capa->sched_prios = odp_schedule_num_prio(); + capa->sched.max_num = ODP_CONFIG_QUEUES - NUM_INTERNAL_QUEUES; + capa->sched.max_size = 0; #endif capa->plain.max_num = ODP_CONFIG_QUEUES - NUM_INTERNAL_QUEUES; capa->plain.max_size = 0; - capa->sched.max_num = ODP_CONFIG_QUEUES - NUM_INTERNAL_QUEUES; - capa->sched.max_size = 0;
return 0; } diff --git a/platform/linux-generic/odp_schedule_basic.c b/platform/linux-generic/odp_schedule_basic.c index e9edb7d0..116cbc5c 100644 --- a/platform/linux-generic/odp_schedule_basic.c +++ b/platform/linux-generic/odp_schedule_basic.c @@ -1557,6 +1557,8 @@ static int schedule_capability(odp_schedule_capability_t *capa) capa->max_ordered_locks = schedule_max_ordered_locks(); capa->max_groups = schedule_num_grps(); capa->max_prios = schedule_num_prio(); + capa->max_queues = ODP_CONFIG_QUEUES - NUM_INTERNAL_QUEUES; + capa->max_queue_size = queue_glb->config.max_queue_size;
return 0; } diff --git a/platform/linux-generic/odp_schedule_scalable.c b/platform/linux-generic/odp_schedule_scalable.c index 7f42fead..b426ca67 100644 --- a/platform/linux-generic/odp_schedule_scalable.c +++ b/platform/linux-generic/odp_schedule_scalable.c @@ -2120,6 +2120,8 @@ static int schedule_capability(odp_schedule_capability_t *capa) capa->max_ordered_locks = schedule_max_ordered_locks(); capa->max_groups = num_grps(); capa->max_prios = schedule_num_prio(); + capa->max_queues = ODP_CONFIG_QUEUES - NUM_INTERNAL_QUEUES; + capa->max_queue_size = 0;
return 0; } diff --git a/platform/linux-generic/odp_schedule_sp.c b/platform/linux-generic/odp_schedule_sp.c index b4ae638d..e748699d 100644 --- a/platform/linux-generic/odp_schedule_sp.c +++ b/platform/linux-generic/odp_schedule_sp.c @@ -930,6 +930,8 @@ static int schedule_capability(odp_schedule_capability_t *capa) capa->max_ordered_locks = max_ordered_locks(); capa->max_groups = num_grps(); capa->max_prios = schedule_num_prio(); + capa->max_queues = ODP_CONFIG_QUEUES - NUM_INTERNAL_QUEUES; + capa->max_queue_size = queue_glb->config.max_queue_size;
return 0; }
commit f30d79bf8689dda7554b5c3d1025fb9030135ab7 Author: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Date: Wed Oct 24 17:50:54 2018 +0300
api: queue, schedule: move scheduled queue capabilities to sched
Move scheduled queue capabilities to odp_schedule_capability_t structure, as they logically belong to ODP scheduler module, rather than queue module.
Signed-off-by: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Signed-off-by: Balasubramanian Manoharan bala.manoharan@linaro.org 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/queue_types.h b/include/odp/api/spec/queue_types.h index 9c7c7de9..c8f31046 100644 --- a/include/odp/api/spec/queue_types.h +++ b/include/odp/api/spec/queue_types.h @@ -139,7 +139,8 @@ typedef struct odp_queue_capability_t { * instead */ unsigned int ODP_DEPRECATE(max_sched_groups);
- /** @deprecated Use prios field of odp_schedule_capability_t instead */ + /** @deprecated Use max_prios field of odp_schedule_capability_t + * instead */ unsigned int ODP_DEPRECATE(sched_prios);
/** Plain queue capabilities */ @@ -182,7 +183,8 @@ typedef struct odp_queue_capability_t {
} plain;
- /** Scheduled queue capabilities */ + /** @deprecated Use queue capabilities in odp_schedule_capability_t + * instead */ struct { /** Maximum number of scheduled (ODP_BLOCKING) queues of the * default size. */ @@ -220,7 +222,7 @@ typedef struct odp_queue_capability_t {
} waitfree;
- } sched; + } ODP_DEPRECATE(sched);
} odp_queue_capability_t;
diff --git a/include/odp/api/spec/schedule_types.h b/include/odp/api/spec/schedule_types.h index f55e53f3..e7cc0479 100644 --- a/include/odp/api/spec/schedule_types.h +++ b/include/odp/api/spec/schedule_types.h @@ -14,6 +14,8 @@ #define ODP_API_SPEC_SCHEDULE_TYPES_H_ #include <odp/visibility_begin.h>
+#include <odp/api/support.h> + #ifdef __cplusplus extern "C" { #endif @@ -178,6 +180,24 @@ typedef struct odp_schedule_capability_t { /** Number of scheduling priorities */ uint32_t max_prios;
+ /** Maximum number of scheduled (ODP_BLOCKING) queues of the default + * size. */ + uint32_t max_queues; + + /** Maximum number of events a scheduled (ODP_BLOCKING) queue can store + * simultaneously. The value of zero means that scheduled queues do not + * have a size limit, but a single queue can store all available + * events. */ + uint32_t max_queue_size; + + /** Lock-free (ODP_NONBLOCKING_LF) queues support. + * The specification is the same as for the blocking implementation. */ + odp_support_t lockfree_queues; + + /** Wait-free (ODP_NONBLOCKING_WF) queues support. + * The specification is the same as for the blocking implementation. */ + odp_support_t waitfree_queues; + } odp_schedule_capability_t;
/**
commit 39502aa8b1a01732b012a424ca6587030d2e0a09 Author: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Date: Wed Oct 24 17:49:29 2018 +0300
example, tests: move scheduler capabilities to scheduler
Add odp_schedule_capability() call to query scheduler capabilities. Move basic scheduler capabilities to new odp_schedule_capability_t structure.
Signed-off-by: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Signed-off-by: Balasubramanian Manoharan bala.manoharan@linaro.org 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/example/sysinfo/odp_sysinfo.c b/example/sysinfo/odp_sysinfo.c index 120910b6..f0b0241d 100644 --- a/example/sysinfo/odp_sysinfo.c +++ b/example/sysinfo/odp_sysinfo.c @@ -238,6 +238,7 @@ int main(void) odp_queue_capability_t queue_capa; odp_timer_capability_t timer_capa; odp_crypto_capability_t crypto_capa; + odp_schedule_capability_t schedule_capa; uint64_t huge_page[MAX_HUGE_PAGES]; char ava_mask_str[ODP_CPUMASK_STR_SIZE]; char work_mask_str[ODP_CPUMASK_STR_SIZE]; @@ -293,6 +294,11 @@ int main(void) return -1; }
+ if (odp_schedule_capability(&schedule_capa)) { + printf("schedule capability failed\n"); + return -1; + } + if (odp_timer_capability(ODP_CLOCK_CPU, &timer_capa)) { printf("timer capability failed\n"); return -1; @@ -393,9 +399,9 @@ int main(void) printf("\n"); printf(" SCHEDULER\n"); printf(" max ordered locks: %" PRIu32 "\n", - queue_capa.max_ordered_locks); - printf(" max groups: %u\n", queue_capa.max_sched_groups); - printf(" priorities: %u\n", queue_capa.sched_prios); + schedule_capa.max_ordered_locks); + printf(" max groups: %u\n", schedule_capa.max_groups); + printf(" priorities: %u\n", schedule_capa.prios); printf(" sched.max_num: %" PRIu32 "\n", queue_capa.sched.max_num); printf(" sched.max_size: %" PRIu32 "\n", diff --git a/test/performance/odp_pktio_ordered.c b/test/performance/odp_pktio_ordered.c index faf41b02..f0939eb5 100644 --- a/test/performance/odp_pktio_ordered.c +++ b/test/performance/odp_pktio_ordered.c @@ -1064,6 +1064,7 @@ int main(int argc, char *argv[]) odp_pool_param_t params; odp_shm_t shm; odp_queue_capability_t queue_capa; + odp_schedule_capability_t schedule_capa; odp_pool_capability_t pool_capa; odph_ethaddr_t new_addr; odph_odpthread_t thread_tbl[MAX_WORKERS]; @@ -1094,6 +1095,11 @@ int main(int argc, char *argv[]) exit(EXIT_FAILURE); }
+ if (odp_schedule_capability(&schedule_capa)) { + printf("Error: Schedule capa failed.\n"); + return -1; + } + if (odp_pool_capability(&pool_capa)) { LOG_ERR("Error: Pool capa failed\n"); exit(EXIT_FAILURE); @@ -1122,7 +1128,7 @@ int main(int argc, char *argv[])
if (gbl_args->appl.in_mode == SCHED_ORDERED) { /* At least one ordered lock required */ - if (queue_capa.max_ordered_locks < 1) { + if (schedule_capa.max_ordered_locks < 1) { LOG_ERR("Error: Ordered locks not available.\n"); exit(EXIT_FAILURE); } diff --git a/test/validation/api/classification/odp_classification_tests.c b/test/validation/api/classification/odp_classification_tests.c index 41201d4a..4f722140 100644 --- a/test/validation/api/classification/odp_classification_tests.c +++ b/test/validation/api/classification/odp_classification_tests.c @@ -152,16 +152,16 @@ void configure_cls_pmr_chain(void) uint32_t addr; uint32_t mask; odp_pmr_param_t pmr_param; - odp_queue_capability_t queue_capa; + odp_schedule_capability_t schedule_capa;
- CU_ASSERT_FATAL(odp_queue_capability(&queue_capa) == 0); + CU_ASSERT_FATAL(odp_schedule_capability(&schedule_capa) == 0);
odp_queue_param_init(&qparam); qparam.type = ODP_QUEUE_TYPE_SCHED; qparam.sched.prio = odp_schedule_default_prio(); qparam.sched.sync = ODP_SCHED_SYNC_PARALLEL; qparam.sched.group = ODP_SCHED_GROUP_ALL; - qparam.sched.lock_count = queue_capa.max_ordered_locks; + qparam.sched.lock_count = schedule_capa.max_ordered_locks; sprintf(queuename, "%s", "SrcQueue");
queue_list[CLS_PMR_CHAIN_SRC] = odp_queue_create(queuename, &qparam); diff --git a/test/validation/api/queue/queue.c b/test/validation/api/queue/queue.c index cf081a99..99acc4bf 100644 --- a/test/validation/api/queue/queue.c +++ b/test/validation/api/queue/queue.c @@ -133,8 +133,6 @@ static void queue_test_capa(void) CU_ASSERT(odp_queue_capability(&capa) == 0);
CU_ASSERT(capa.max_queues != 0); - CU_ASSERT(capa.max_sched_groups != 0); - CU_ASSERT(capa.sched_prios != 0); CU_ASSERT(capa.plain.max_num != 0); CU_ASSERT(capa.sched.max_num != 0);
@@ -715,6 +713,7 @@ static void queue_test_info(void) odp_queue_info_t info; odp_queue_param_t param; odp_queue_capability_t capability; + odp_schedule_capability_t sched_capa; char q_plain_ctx[] = "test_q_plain context data"; char q_order_ctx[] = "test_q_order context data"; uint32_t lock_count; @@ -729,13 +728,14 @@ static void queue_test_info(void)
memset(&capability, 0, sizeof(odp_queue_capability_t)); CU_ASSERT(odp_queue_capability(&capability) == 0); + CU_ASSERT(odp_schedule_capability(&sched_capa) == 0); /* Create a scheduled ordered queue with explicitly set params */ odp_queue_param_init(¶m); param.type = ODP_QUEUE_TYPE_SCHED; param.sched.prio = odp_schedule_default_prio(); param.sched.sync = ODP_SCHED_SYNC_ORDERED; param.sched.group = ODP_SCHED_GROUP_ALL; - param.sched.lock_count = capability.max_ordered_locks; + param.sched.lock_count = sched_capa.max_ordered_locks; if (param.sched.lock_count == 0) printf("\n Ordered locks NOT supported\n"); param.context = q_order_ctx; diff --git a/test/validation/api/scheduler/scheduler.c b/test/validation/api/scheduler/scheduler.c index 2f66f526..35c38751 100644 --- a/test/validation/api/scheduler/scheduler.c +++ b/test/validation/api/scheduler/scheduler.c @@ -141,6 +141,17 @@ static void release_context(odp_schedule_sync_t sync) odp_schedule_release_ordered(); }
+static void scheduler_test_capa(void) +{ + odp_schedule_capability_t capa; + + memset(&capa, 0, sizeof(odp_schedule_capability_t)); + CU_ASSERT_FATAL(odp_schedule_capability(&capa) == 0); + + CU_ASSERT(capa.max_groups != 0); + CU_ASSERT(capa.max_prios != 0); +} + static void scheduler_test_wait_time(void) { int i; @@ -1643,6 +1654,7 @@ static int create_queues(test_globals_t *globals) { int i, j, prios, rc; odp_queue_capability_t capa; + odp_schedule_capability_t sched_capa; odp_pool_t queue_ctx_pool; odp_pool_param_t params; odp_buffer_t queue_ctx_buf; @@ -1659,11 +1671,16 @@ static int create_queues(test_globals_t *globals) return -1; }
+ if (odp_schedule_capability(&sched_capa) < 0) { + printf("Queue capability query failed\n"); + return -1; + } + /* Limit to test maximum */ - if (capa.max_ordered_locks > MAX_ORDERED_LOCKS) { - capa.max_ordered_locks = MAX_ORDERED_LOCKS; + if (sched_capa.max_ordered_locks > MAX_ORDERED_LOCKS) { + sched_capa.max_ordered_locks = MAX_ORDERED_LOCKS; printf("Testing only %u ordered locks\n", - capa.max_ordered_locks); + sched_capa.max_ordered_locks); }
globals->max_sched_queue_size = BUFS_PER_QUEUE_EXCL; @@ -1764,7 +1781,7 @@ static int create_queues(test_globals_t *globals)
snprintf(name, sizeof(name), "sched_%d_%d_o", i, j); p.sched.sync = ODP_SCHED_SYNC_ORDERED; - p.sched.lock_count = capa.max_ordered_locks; + p.sched.lock_count = sched_capa.max_ordered_locks; p.size = 0; q = odp_queue_create(name, &p);
@@ -1773,12 +1790,12 @@ static int create_queues(test_globals_t *globals) return -1; } if (odp_queue_lock_count(q) != - capa.max_ordered_locks) { + sched_capa.max_ordered_locks) { printf("Queue %" PRIu64 " created with " "%d locks instead of expected %d\n", odp_queue_to_u64(q), odp_queue_lock_count(q), - capa.max_ordered_locks); + sched_capa.max_ordered_locks); return -1; }
@@ -1795,7 +1812,7 @@ static int create_queues(test_globals_t *globals) qctx->sequence = 0;
for (ndx = 0; - ndx < capa.max_ordered_locks; + ndx < sched_capa.max_ordered_locks; ndx++) { qctx->lock_sequence[ndx] = 0; } @@ -1949,6 +1966,7 @@ static int scheduler_suite_term(void) }
odp_testinfo_t scheduler_suite[] = { + ODP_TEST_INFO(scheduler_test_capa), ODP_TEST_INFO(scheduler_test_wait_time), ODP_TEST_INFO(scheduler_test_num_prio), ODP_TEST_INFO(scheduler_test_queue_destroy),
commit da5d27b57a0a3c8389c0a0f8c5747308419a094a Author: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Date: Fri Oct 26 03:00:43 2018 +0300
linux-gen: queue, schedule: move scheduler capabilities to scheduler
Signed-off-by: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Signed-off-by: Balasubramanian Manoharan bala.manoharan@linaro.org 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/include/odp_schedule_if.h b/platform/linux-generic/include/odp_schedule_if.h index 5f7f2c4d..88961269 100644 --- a/platform/linux-generic/include/odp_schedule_if.h +++ b/platform/linux-generic/include/odp_schedule_if.h @@ -90,6 +90,7 @@ void sched_cb_pktio_stop_finalize(int pktio_index); /* API functions */ typedef struct { uint64_t (*schedule_wait_time)(uint64_t ns); + int (*schedule_capability)(odp_schedule_capability_t *capa); odp_event_t (*schedule)(odp_queue_t *from, uint64_t wait); int (*schedule_multi)(odp_queue_t *from, uint64_t wait, odp_event_t events[], int num); diff --git a/platform/linux-generic/odp_queue_basic.c b/platform/linux-generic/odp_queue_basic.c index 88c810ca..e40ce399 100644 --- a/platform/linux-generic/odp_queue_basic.c +++ b/platform/linux-generic/odp_queue_basic.c @@ -48,7 +48,7 @@ static int queue_init(queue_entry_t *queue, const char *name, queue_global_t *queue_glb; extern _odp_queue_inline_offset_t _odp_queue_inline_offset;
-static int queue_capa(odp_queue_capability_t *capa, int sched) +static int queue_capa(odp_queue_capability_t *capa, int sched ODP_UNUSED) { memset(capa, 0, sizeof(odp_queue_capability_t));
@@ -61,11 +61,13 @@ static int queue_capa(odp_queue_capability_t *capa, int sched) capa->sched.max_num = capa->max_queues; capa->sched.max_size = queue_glb->config.max_queue_size;
+#if ODP_DEPRECATED_API if (sched) { capa->max_ordered_locks = sched_fn->max_ordered_locks(); capa->max_sched_groups = sched_fn->num_grps(); capa->sched_prios = odp_schedule_num_prio(); } +#endif
return 0; } diff --git a/platform/linux-generic/odp_queue_scalable.c b/platform/linux-generic/odp_queue_scalable.c index 64068ed4..0fdf7cda 100644 --- a/platform/linux-generic/odp_queue_scalable.c +++ b/platform/linux-generic/odp_queue_scalable.c @@ -318,9 +318,11 @@ static int queue_capability(odp_queue_capability_t *capa)
/* Reserve some queues for internal use */ capa->max_queues = ODP_CONFIG_QUEUES - NUM_INTERNAL_QUEUES; +#if ODP_DEPRECATED_API capa->max_ordered_locks = sched_fn->max_ordered_locks(); capa->max_sched_groups = sched_fn->num_grps(); capa->sched_prios = odp_schedule_num_prio(); +#endif capa->plain.max_num = ODP_CONFIG_QUEUES - NUM_INTERNAL_QUEUES; capa->plain.max_size = 0; capa->sched.max_num = ODP_CONFIG_QUEUES - NUM_INTERNAL_QUEUES; diff --git a/platform/linux-generic/odp_schedule_basic.c b/platform/linux-generic/odp_schedule_basic.c index a2db156f..e9edb7d0 100644 --- a/platform/linux-generic/odp_schedule_basic.c +++ b/platform/linux-generic/odp_schedule_basic.c @@ -1548,6 +1548,17 @@ static int schedule_num_grps(void) static void schedule_config(schedule_config_t *config) { *config = *(&sched->config_if); +}; + +static int schedule_capability(odp_schedule_capability_t *capa) +{ + memset(capa, 0, sizeof(odp_schedule_capability_t)); + + capa->max_ordered_locks = schedule_max_ordered_locks(); + capa->max_groups = schedule_num_grps(); + capa->max_prios = schedule_num_prio(); + + return 0; }
/* Fill in scheduler interface */ @@ -1573,6 +1584,7 @@ const schedule_fn_t schedule_basic_fn = { /* Fill in scheduler API calls */ const schedule_api_t schedule_basic_api = { .schedule_wait_time = schedule_wait_time, + .schedule_capability = schedule_capability, .schedule = schedule, .schedule_multi = schedule_multi, .schedule_multi_wait = schedule_multi_wait, diff --git a/platform/linux-generic/odp_schedule_if.c b/platform/linux-generic/odp_schedule_if.c index 4d50a13f..92e0a62f 100644 --- a/platform/linux-generic/odp_schedule_if.c +++ b/platform/linux-generic/odp_schedule_if.c @@ -30,6 +30,11 @@ uint64_t odp_schedule_wait_time(uint64_t ns) return sched_api->schedule_wait_time(ns); }
+int odp_schedule_capability(odp_schedule_capability_t *capa) +{ + return sched_api->schedule_capability(capa); +} + odp_event_t odp_schedule(odp_queue_t *from, uint64_t wait) { return sched_api->schedule(from, wait); diff --git a/platform/linux-generic/odp_schedule_scalable.c b/platform/linux-generic/odp_schedule_scalable.c index 1f301bf4..7f42fead 100644 --- a/platform/linux-generic/odp_schedule_scalable.c +++ b/platform/linux-generic/odp_schedule_scalable.c @@ -2113,6 +2113,17 @@ static uint32_t schedule_max_ordered_locks(void) return CONFIG_QUEUE_MAX_ORD_LOCKS; }
+static int schedule_capability(odp_schedule_capability_t *capa) +{ + memset(capa, 0, sizeof(odp_schedule_capability_t)); + + capa->max_ordered_locks = schedule_max_ordered_locks(); + capa->max_groups = num_grps(); + capa->max_prios = schedule_num_prio(); + + return 0; +} + const schedule_fn_t schedule_scalable_fn = { .pktio_start = pktio_start, .thr_add = thr_add, @@ -2133,6 +2144,7 @@ const schedule_fn_t schedule_scalable_fn = {
const schedule_api_t schedule_scalable_api = { .schedule_wait_time = schedule_wait_time, + .schedule_capability = schedule_capability, .schedule = schedule, .schedule_multi = schedule_multi, .schedule_multi_wait = schedule_multi_wait, diff --git a/platform/linux-generic/odp_schedule_sp.c b/platform/linux-generic/odp_schedule_sp.c index c93c5e02..b4ae638d 100644 --- a/platform/linux-generic/odp_schedule_sp.c +++ b/platform/linux-generic/odp_schedule_sp.c @@ -923,6 +923,17 @@ static void order_unlock(void) { }
+static int schedule_capability(odp_schedule_capability_t *capa) +{ + memset(capa, 0, sizeof(odp_schedule_capability_t)); + + capa->max_ordered_locks = max_ordered_locks(); + capa->max_groups = num_grps(); + capa->max_prios = schedule_num_prio(); + + return 0; +} + /* Fill in scheduler interface */ const schedule_fn_t schedule_sp_fn = { .pktio_start = pktio_start, @@ -945,6 +956,7 @@ const schedule_fn_t schedule_sp_fn = { /* Fill in scheduler API calls */ const schedule_api_t schedule_sp_api = { .schedule_wait_time = schedule_wait_time, + .schedule_capability = schedule_capability, .schedule = schedule, .schedule_multi = schedule_multi, .schedule_multi_wait = schedule_multi_wait,
commit 207efebdb9ca6d329cc89b272865559f5eeff182 Author: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Date: Fri Oct 26 02:50:26 2018 +0300
linux-gen: move NUM_INTERNAL_QUEUES to config
It is really a config value, that allows one to select amount of queues to be reserved for platform internal use, so move it to config header.
Signed-off-by: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Signed-off-by: Balasubramanian Manoharan bala.manoharan@linaro.org 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/include/odp_config_internal.h b/platform/linux-generic/include/odp_config_internal.h index 65f75197..ae6426ef 100644 --- a/platform/linux-generic/include/odp_config_internal.h +++ b/platform/linux-generic/include/odp_config_internal.h @@ -26,6 +26,11 @@ extern "C" { */ #define ODP_CONFIG_QUEUES 1024
+/* + * Queues reserved for ODP internal use + */ +#define NUM_INTERNAL_QUEUES 64 + /* * Maximum number of ordered locks per queue */ diff --git a/platform/linux-generic/odp_queue_basic.c b/platform/linux-generic/odp_queue_basic.c index 1b1ee651..88c810ca 100644 --- a/platform/linux-generic/odp_queue_basic.c +++ b/platform/linux-generic/odp_queue_basic.c @@ -31,8 +31,6 @@ #include <odp/api/plat/queue_inline_types.h> #include <odp_global_data.h>
-#define NUM_INTERNAL_QUEUES 64 - #include <odp/api/plat/ticketlock_inlines.h> #define LOCK(queue_ptr) odp_ticketlock_lock(&((queue_ptr)->s.lock)) #define UNLOCK(queue_ptr) odp_ticketlock_unlock(&((queue_ptr)->s.lock)) diff --git a/platform/linux-generic/odp_queue_scalable.c b/platform/linux-generic/odp_queue_scalable.c index f48fbd86..64068ed4 100644 --- a/platform/linux-generic/odp_queue_scalable.c +++ b/platform/linux-generic/odp_queue_scalable.c @@ -33,8 +33,6 @@ #include <string.h> #include <inttypes.h>
-#define NUM_INTERNAL_QUEUES 64 - #define MIN(a, b) \ ({ \ __typeof__(a) tmp_a = (a); \
commit 12b368d14e19761b7aabc4cac04918582253052b Author: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Date: Wed Oct 24 17:49:29 2018 +0300
api: queue, schedule: move scheduler capabilities to scheduler
Add odp_schedule_capability() call to query scheduler capabilities. Move basic scheduler capabilities to new odp_schedule_capability_t structure.
Signed-off-by: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Signed-off-by: Balasubramanian Manoharan bala.manoharan@linaro.org 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/queue_types.h b/include/odp/api/spec/queue_types.h index be7e79a8..9c7c7de9 100644 --- a/include/odp/api/spec/queue_types.h +++ b/include/odp/api/spec/queue_types.h @@ -19,6 +19,7 @@ extern "C" { #endif
#include <odp/api/schedule_types.h> +#include <odp/api/deprecated.h>
/** @addtogroup odp_queue * @{ @@ -130,14 +131,16 @@ typedef struct odp_queue_capability_t { * types are used simultaneously. */ uint32_t max_queues;
- /** Maximum number of ordered locks per queue */ - uint32_t max_ordered_locks; + /** @deprecated Use max_ordered_locks field of + * odp_schedule_capability_t instead */ + uint32_t ODP_DEPRECATE(max_ordered_locks);
- /** Maximum number of scheduling groups */ - unsigned max_sched_groups; + /** @deprecated Use max_groups field of odp_schedule_capability_t + * instead */ + unsigned int ODP_DEPRECATE(max_sched_groups);
- /** Number of scheduling priorities */ - unsigned sched_prios; + /** @deprecated Use prios field of odp_schedule_capability_t instead */ + unsigned int ODP_DEPRECATE(sched_prios);
/** Plain queue capabilities */ struct { diff --git a/include/odp/api/spec/schedule.h b/include/odp/api/spec/schedule.h index d9b868e3..6538c509 100644 --- a/include/odp/api/spec/schedule.h +++ b/include/odp/api/spec/schedule.h @@ -257,6 +257,18 @@ int odp_schedule_default_prio(void); */ int odp_schedule_num_prio(void);
+/** + * Query scheduler capabilities + * + * Outputs schedule capabilities on success. + * + * @param[out] capa Pointer to capability structure for output + * + * @retval 0 on success + * @retval <0 on failure + */ +int odp_schedule_capability(odp_schedule_capability_t *capa); + /** * Schedule group create * diff --git a/include/odp/api/spec/schedule_types.h b/include/odp/api/spec/schedule_types.h index 76afc6dd..f55e53f3 100644 --- a/include/odp/api/spec/schedule_types.h +++ b/include/odp/api/spec/schedule_types.h @@ -165,6 +165,21 @@ typedef struct odp_schedule_param_t { uint32_t lock_count; } odp_schedule_param_t;
+/** + * Scheduler capabilities + */ +typedef struct odp_schedule_capability_t { + /** Maximum number of ordered locks per queue */ + uint32_t max_ordered_locks; + + /** Maximum number of scheduling groups */ + uint32_t max_groups; + + /** Number of scheduling priorities */ + uint32_t max_prios; + +} odp_schedule_capability_t; + /** * @} */
-----------------------------------------------------------------------
Summary of changes: .travis.yml | 1 + example/classifier/odp_classifier.c | 3 + example/generator/odp_generator.c | 3 + example/ipsec/odp_ipsec.c | 3 + example/ipsec_api/odp_ipsec.c | 3 + example/ipsec_offload/odp_ipsec_offload.c | 3 + example/packet/odp_packet_dump.c | 2 + example/packet/odp_pktio.c | 3 + example/sysinfo/odp_sysinfo.c | 32 +++++---- example/timer/odp_timer_accuracy.c | 3 + example/timer/odp_timer_simple.c | 3 + example/timer/odp_timer_test.c | 3 + include/odp/api/spec/event.h | 38 ++++++++++ include/odp/api/spec/queue_types.h | 21 +++--- include/odp/api/spec/schedule.h | 50 +++++++++++++ include/odp/api/spec/schedule_types.h | 83 ++++++++++++++++++++++ .../linux-generic/include/odp_config_internal.h | 5 ++ platform/linux-generic/include/odp_schedule_if.h | 12 +++- platform/linux-generic/odp_queue_basic.c | 6 +- platform/linux-generic/odp_queue_scalable.c | 8 +-- platform/linux-generic/odp_schedule_basic.c | 35 ++++++++- platform/linux-generic/odp_schedule_if.c | 41 +++++++++++ platform/linux-generic/odp_schedule_scalable.c | 29 ++++++++ platform/linux-generic/odp_schedule_sp.c | 34 +++++++++ platform/linux-generic/odp_thread.c | 8 +-- test/common/odp_cunit_common.c | 4 ++ test/performance/odp_cpu_bench.c | 23 +++--- test/performance/odp_crypto.c | 1 + test/performance/odp_ipsec.c | 1 + test/performance/odp_l2fwd.c | 2 + test/performance/odp_pktio_ordered.c | 19 ++--- test/performance/odp_pktio_perf.c | 3 + test/performance/odp_sched_latency.c | 2 + test/performance/odp_sched_perf.c | 22 +++--- test/performance/odp_sched_pktio.c | 17 +++-- test/performance/odp_scheduling.c | 10 ++- .../api/classification/odp_classification_tests.c | 6 +- test/validation/api/queue/queue.c | 46 +++++------- test/validation/api/scheduler/scheduler.c | 56 +++++++++++---- test/validation/api/timer/timer.c | 3 + 40 files changed, 521 insertions(+), 126 deletions(-)
hooks/post-receive