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 48018032f54e6e50f509d073c8735f7a5c0bbcb1 (commit) via 380fa4598b4c58101a2f07ff179ae67fdcba70ab (commit) via 297cd7e9f93e31dd5a640b707895d702d17b30ae (commit) via d945bf9517ab5abfc59447ab30456d1ca9716a5a (commit) from 67d6f7120962594e6b9e3343fd7cf13eda956b15 (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 48018032f54e6e50f509d073c8735f7a5c0bbcb1 Author: Petri Savolainen petri.savolainen@linaro.org Date: Thu Oct 25 17:38:24 2018 +0300
linux-gen: thread: use automatic schedule group configuration
Read from scheduler configuration if an automatic schedule group is enabled or disabled.
Signed-off-by: Petri Savolainen petri.savolainen@linaro.org Reviewed-by: Bill Fischofer bill.fischofer@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/platform/linux-generic/odp_thread.c b/platform/linux-generic/odp_thread.c index 4fc6acc9..7728929b 100644 --- a/platform/linux-generic/odp_thread.c +++ b/platform/linux-generic/odp_thread.c @@ -136,6 +136,20 @@ int odp_thread_init_local(odp_thread_type_t type) { int id; int cpu; + int group_all, group_worker, group_control; + + group_all = 1; + group_worker = 1; + group_control = 1; + + if (sched_fn->config) { + schedule_config_t schedule_config; + + sched_fn->config(&schedule_config); + group_all = schedule_config.group_enable.all; + group_worker = schedule_config.group_enable.worker; + group_control = schedule_config.group_enable.control; + }
odp_spinlock_lock(&thread_globals->lock); id = alloc_id(type); @@ -159,11 +173,13 @@ int odp_thread_init_local(odp_thread_type_t type)
_odp_this_thread = &thread_globals->thr[id];
- sched_fn->thr_add(ODP_SCHED_GROUP_ALL, id); + if (group_all) + sched_fn->thr_add(ODP_SCHED_GROUP_ALL, id);
- if (type == ODP_THREAD_WORKER) + if (type == ODP_THREAD_WORKER && group_worker) sched_fn->thr_add(ODP_SCHED_GROUP_WORKER, id); - else if (type == ODP_THREAD_CONTROL) + + if (type == ODP_THREAD_CONTROL && group_control) sched_fn->thr_add(ODP_SCHED_GROUP_CONTROL, id);
return 0; @@ -172,14 +188,30 @@ int odp_thread_init_local(odp_thread_type_t type) int odp_thread_term_local(void) { int num; + int group_all, group_worker, group_control; int id = _odp_this_thread->thr; odp_thread_type_t type = _odp_this_thread->type;
- sched_fn->thr_rem(ODP_SCHED_GROUP_ALL, id); + group_all = 1; + group_worker = 1; + group_control = 1;
- if (type == ODP_THREAD_WORKER) + if (sched_fn->config) { + schedule_config_t schedule_config; + + sched_fn->config(&schedule_config); + group_all = schedule_config.group_enable.all; + group_worker = schedule_config.group_enable.worker; + group_control = schedule_config.group_enable.control; + } + + if (group_all) + sched_fn->thr_rem(ODP_SCHED_GROUP_ALL, id); + + if (type == ODP_THREAD_WORKER && group_worker) sched_fn->thr_rem(ODP_SCHED_GROUP_WORKER, id); - else if (type == ODP_THREAD_CONTROL) + + if (type == ODP_THREAD_CONTROL && group_control) sched_fn->thr_rem(ODP_SCHED_GROUP_CONTROL, id);
odp_spinlock_lock(&thread_globals->lock);
commit 380fa4598b4c58101a2f07ff179ae67fdcba70ab Author: Petri Savolainen petri.savolainen@linaro.org Date: Thu Oct 25 17:26:37 2018 +0300
linux-gen: sched: add config request function to interface
Added config request function to scheduler internal interface. Other modules may use this to examine scheduler configuration.
Signed-off-by: Petri Savolainen petri.savolainen@linaro.org Reviewed-by: Bill Fischofer bill.fischofer@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 13e209f2..df875c48 100644 --- a/platform/linux-generic/include/odp_schedule_if.h +++ b/platform/linux-generic/include/odp_schedule_if.h @@ -19,6 +19,15 @@ extern "C" { /* Number of ordered locks per queue */ #define SCHEDULE_ORDERED_LOCKS_PER_QUEUE 2
+typedef struct schedule_config_t { + struct { + int all; + int worker; + int control; + } group_enable; + +} schedule_config_t; + typedef void (*schedule_pktio_start_fn_t)(int pktio_index, int num_in_queue, int in_queue_idx[], @@ -44,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_save_context_fn_t)(uint32_t queue_index); +typedef void (*schedule_config_fn_t)(schedule_config_t *config);
typedef struct schedule_fn_t { schedule_pktio_start_fn_t pktio_start; @@ -65,6 +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_fn_t;
diff --git a/platform/linux-generic/odp_schedule_basic.c b/platform/linux-generic/odp_schedule_basic.c index 7208200a..74942341 100644 --- a/platform/linux-generic/odp_schedule_basic.c +++ b/platform/linux-generic/odp_schedule_basic.c @@ -226,6 +226,9 @@ typedef struct {
order_context_t order[ODP_CONFIG_QUEUES];
+ /* Scheduler interface config options (not used in fast path) */ + schedule_config_t config_if; + } sched_global_t;
/* Check that queue[] variables are large enough */ @@ -320,7 +323,37 @@ static int read_config_file(sched_global_t *sched) return -1; } } - ODP_PRINT("\n\n"); + + ODP_PRINT("\n"); + + str = "sched_basic.group_enable.all"; + if (!_odp_libconfig_lookup_int(str, &val)) { + ODP_ERR("Config option '%s' not found.\n", str); + return -1; + } + + sched->config_if.group_enable.all = val; + ODP_PRINT(" %s: %i\n", str, val); + + str = "sched_basic.group_enable.worker"; + if (!_odp_libconfig_lookup_int(str, &val)) { + ODP_ERR("Config option '%s' not found.\n", str); + return -1; + } + + sched->config_if.group_enable.worker = val; + ODP_PRINT(" %s: %i\n", str, val); + + str = "sched_basic.group_enable.control"; + if (!_odp_libconfig_lookup_int(str, &val)) { + ODP_ERR("Config option '%s' not found.\n", str); + return -1; + } + + sched->config_if.group_enable.control = val; + ODP_PRINT(" %s: %i\n", str, val); + + ODP_PRINT("\n");
return 0; } @@ -1474,6 +1507,11 @@ static int schedule_num_grps(void) return NUM_SCHED_GRPS; }
+static void schedule_config(schedule_config_t *config) +{ + *config = *(&sched->config_if); +} + /* Fill in scheduler interface */ const schedule_fn_t schedule_basic_fn = { .pktio_start = schedule_pktio_start, @@ -1490,7 +1528,8 @@ const schedule_fn_t schedule_basic_fn = { .term_local = schedule_term_local, .order_lock = order_lock, .order_unlock = order_unlock, - .max_ordered_locks = schedule_max_ordered_locks + .max_ordered_locks = schedule_max_ordered_locks, + .config = schedule_config };
/* Fill in scheduler API calls */
commit 297cd7e9f93e31dd5a640b707895d702d17b30ae Author: Petri Savolainen petri.savolainen@linaro.org Date: Thu Oct 25 16:53:39 2018 +0300
linux-gen: config: add schedule group config file options
Added options to disable unused automatic schedule groups.
Signed-off-by: Petri Savolainen petri.savolainen@linaro.org Reviewed-by: Bill Fischofer bill.fischofer@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/config/odp-linux-generic.conf b/config/odp-linux-generic.conf index 2417d23f..4585a896 100644 --- a/config/odp-linux-generic.conf +++ b/config/odp-linux-generic.conf @@ -16,7 +16,7 @@
# Mandatory fields odp_implementation = "linux-generic" -config_file_version = "0.1.2" +config_file_version = "0.1.3"
# Shared memory options shm: { @@ -114,4 +114,15 @@ sched_basic: { burst_size_default = [ 32, 32, 32, 32, 32, 16, 8, 4] burst_size_max = [255, 255, 255, 255, 255, 16, 16, 8]
+ # Automatically updated schedule groups + # + # API specification defines that ODP_SCHED_GROUP_ALL, + # _WORKER and _CONTROL are updated automatically. These options can be + # used to disable these group when not used. Set value to 0 to disable + # a group. Performance may improve when unused groups are disabled. + group_enable: { + all = 1 + worker = 1 + control = 1 + } } diff --git a/platform/linux-generic/test/process-mode.conf b/platform/linux-generic/test/process-mode.conf index 7a06544a..f631f54b 100644 --- a/platform/linux-generic/test/process-mode.conf +++ b/platform/linux-generic/test/process-mode.conf @@ -1,6 +1,6 @@ # Mandatory fields odp_implementation = "linux-generic" -config_file_version = "0.1.2" +config_file_version = "0.1.3"
# Shared memory options shm: {
commit d945bf9517ab5abfc59447ab30456d1ca9716a5a Author: Petri Savolainen petri.savolainen@linaro.org Date: Thu Oct 25 16:26:42 2018 +0300
test: sched_pktio: add burst size option
Added option to control maximum burst size, which is requested from scheduler.
Signed-off-by: Petri Savolainen petri.savolainen@linaro.org Reviewed-by: Bill Fischofer bill.fischofer@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/test/performance/odp_sched_pktio.c b/test/performance/odp_sched_pktio.c index 91771e87..82f74422 100644 --- a/test/performance/odp_sched_pktio.c +++ b/test/performance/odp_sched_pktio.c @@ -24,7 +24,6 @@ #define MAX_PKT_LEN 1514 #define MAX_PKT_NUM (128 * 1024) #define MIN_PKT_SEG_LEN 64 -#define BURST_SIZE 32 #define CHECK_PERIOD 10000 #define TEST_PASSED_LIMIT 5000 #define TIMEOUT_OFFSET_NS 1000000 @@ -38,6 +37,7 @@ typedef struct test_options_t { int num_worker; int num_pktio; int num_pktio_queue; + int burst_size; int pipe_stages; int pipe_queues; uint32_t pipe_queue_size; @@ -182,7 +182,6 @@ static inline void send_packets(test_global_t *test_global,
static int worker_thread_direct(void *arg) { - odp_event_t ev[BURST_SIZE]; int num_pkt, out; odp_pktout_queue_t pktout; odp_queue_t queue; @@ -191,6 +190,7 @@ static int worker_thread_direct(void *arg) test_global_t *test_global = worker_arg->test_global_ptr; int worker_id = worker_arg->worker_id; uint32_t polls = 0; + int burst_size = test_global->opt.burst_size;
printf("Worker %i started\n", worker_id);
@@ -198,10 +198,11 @@ static int worker_thread_direct(void *arg) odp_barrier_wait(&test_global->worker_start);
while (1) { - odp_packet_t pkt[BURST_SIZE]; + odp_event_t ev[burst_size]; + odp_packet_t pkt[burst_size];
num_pkt = odp_schedule_multi(&queue, ODP_SCHED_NO_WAIT, - ev, BURST_SIZE); + ev, burst_size);
polls++;
@@ -267,7 +268,6 @@ static inline odp_queue_t next_queue(test_global_t *test_global, int input,
static int worker_thread_pipeline(void *arg) { - odp_event_t ev[BURST_SIZE]; int i, num_pkt, input, output, output_queue; odp_queue_t queue, dst_queue; odp_pktout_queue_t pktout; @@ -281,6 +281,7 @@ static int worker_thread_pipeline(void *arg) int num_pktio = test_global->opt.num_pktio; int num_pktio_queue = test_global->opt.num_pktio_queue; uint32_t polls = 0; + int burst_size = test_global->opt.burst_size;
printf("Worker %i started\n", worker_id);
@@ -288,10 +289,11 @@ static int worker_thread_pipeline(void *arg) odp_barrier_wait(&test_global->worker_start);
while (1) { - odp_packet_t pkt[BURST_SIZE]; + odp_event_t ev[burst_size]; + odp_packet_t pkt[burst_size];
num_pkt = odp_schedule_multi(&queue, ODP_SCHED_NO_WAIT, - ev, BURST_SIZE); + ev, burst_size);
polls++;
@@ -399,7 +401,6 @@ static int worker_thread_pipeline(void *arg)
static int worker_thread_timers(void *arg) { - odp_event_t ev[BURST_SIZE]; int num, num_pkt, out, tmos, i, src_pktio, src_queue; odp_pktout_queue_t pktout; odp_queue_t queue; @@ -410,6 +411,7 @@ static int worker_thread_timers(void *arg) test_global_t *test_global = worker_arg->test_global_ptr; int worker_id = worker_arg->worker_id; uint32_t polls = 0; + int burst_size = test_global->opt.burst_size; uint64_t tick = test_global->timer.timeout_tick;
printf("Worker (timers) %i started\n", worker_id); @@ -418,10 +420,11 @@ static int worker_thread_timers(void *arg) odp_barrier_wait(&test_global->worker_start);
while (1) { - odp_packet_t pkt[BURST_SIZE]; + odp_event_t ev[burst_size]; + odp_packet_t pkt[burst_size];
num = odp_schedule_multi(&queue, ODP_SCHED_NO_WAIT, - ev, BURST_SIZE); + ev, burst_size);
polls++;
@@ -534,6 +537,7 @@ static void print_usage(const char *progname) " -i, --interface <name> Packet IO interfaces (comma-separated, no spaces)\n" " -c, --num_cpu <number> Worker thread count. Default: 1\n" " -q, --num_queue <number> Number of pktio queues. Default: Worker thread count\n" + " -b, --burst <number> Maximum number of events requested from scheduler. Default: 32\n" " -t, --timeout <number> Flow inactivity timeout (in usec) per packet. Default: 0 (don't use timers)\n" " --pipe-stages <number> Number of pipeline stages per interface\n" " --pipe-queues <number> Number of queues per pipeline stage\n" @@ -553,6 +557,7 @@ static int parse_options(int argc, char *argv[], test_options_t *test_options) {"interface", required_argument, NULL, 'i'}, {"num_cpu", required_argument, NULL, 'c'}, {"num_queue", required_argument, NULL, 'q'}, + {"burst", required_argument, NULL, 'b'}, {"timeout", required_argument, NULL, 't'}, {"sched_mode", required_argument, NULL, 'm'}, {"pipe-stages", required_argument, NULL, 0}, @@ -562,7 +567,7 @@ static int parse_options(int argc, char *argv[], test_options_t *test_options) {"help", no_argument, NULL, 'h'}, {NULL, 0, NULL, 0} }; - const char *shortopts = "+i:c:q:t:m:sh"; + const char *shortopts = "+i:c:q:b:t:m:sh"; int ret = 0;
memset(test_options, 0, sizeof(test_options_t)); @@ -570,6 +575,7 @@ static int parse_options(int argc, char *argv[], test_options_t *test_options) test_options->sched_mode = SCHED_MODE_ATOMIC; test_options->num_worker = 1; test_options->num_pktio_queue = 0; + test_options->burst_size = 32; test_options->pipe_queue_size = 256;
/* let helper collect its own arguments (e.g. --odph_proc) */ @@ -628,6 +634,9 @@ static int parse_options(int argc, char *argv[], test_options_t *test_options) case 'q': test_options->num_pktio_queue = atoi(optarg); break; + case 'b': + test_options->burst_size = atoi(optarg); + break; case 't': test_options->timeout_us = atol(optarg); break; @@ -771,6 +780,7 @@ static void print_config(test_global_t *test_global) " queues per interface: %i\n", test_global->opt.num_pktio_queue);
+ printf(" burst size: %u\n", test_global->opt.burst_size); printf(" collect statistics: %u\n", test_global->opt.collect_stat); printf(" timeout usec: %li\n", test_global->opt.timeout_us);
-----------------------------------------------------------------------
Summary of changes: config/odp-linux-generic.conf | 13 ++++++- platform/linux-generic/include/odp_schedule_if.h | 12 ++++++- platform/linux-generic/odp_schedule_basic.c | 43 +++++++++++++++++++++-- platform/linux-generic/odp_thread.c | 44 ++++++++++++++++++++---- platform/linux-generic/test/process-mode.conf | 2 +- test/performance/odp_sched_pktio.c | 32 +++++++++++------ 6 files changed, 124 insertions(+), 22 deletions(-)
hooks/post-receive