diff options
author | Petri Savolainen <petri.savolainen@nokia.com> | 2016-06-02 10:06:47 +0300 |
---|---|---|
committer | Maxim Uvarov <maxim.uvarov@linaro.org> | 2016-06-07 18:24:51 +0300 |
commit | 4c4bca38e65120c628f9d02b8fe05c1134979d60 (patch) | |
tree | a31b3819d7e18892781d5a680e6ed0b7c38d326e | |
parent | 366276056833bf82a86908e84f071dd1b94a7287 (diff) |
linux-generic: sched: add skeleton for strict priority
Added configuration option to use strict priority scheduler
implementation instead of the default.
Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com>
Reviewed-and-tested-by: Bill Fischofer <bill.fischofer@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
-rw-r--r-- | configure.ac | 1 | ||||
-rw-r--r-- | platform/linux-generic/Makefile.am | 1 | ||||
-rw-r--r-- | platform/linux-generic/m4/configure.m4 | 1 | ||||
-rw-r--r-- | platform/linux-generic/m4/odp_schedule.m4 | 6 | ||||
-rw-r--r-- | platform/linux-generic/odp_schedule.c | 2 | ||||
-rw-r--r-- | platform/linux-generic/odp_schedule_if.c | 9 | ||||
-rw-r--r-- | platform/linux-generic/odp_schedule_sp.c | 71 |
7 files changed, 88 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac index 39627de70..a12f984f5 100644 --- a/configure.ac +++ b/configure.ac @@ -292,6 +292,7 @@ AC_MSG_RESULT([ ldflags: ${LDFLAGS} am_ldflags: ${AM_LDFLAGS} libs: ${LIBS} + defs: ${DEFS} cunit: ${cunit_support} test_vald: ${test_vald} test_perf: ${test_perf} diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am index 6fa9f31b0..469869e97 100644 --- a/platform/linux-generic/Makefile.am +++ b/platform/linux-generic/Makefile.am @@ -165,6 +165,7 @@ __LIB__libodp_linux_la_SOURCES = \ odp_schedule.c \ odp_schedule_if.c \ odp_schedule_ordered.c \ + odp_schedule_sp.c \ odp_shared_memory.c \ odp_sorted_list.c \ odp_spinlock.c \ diff --git a/platform/linux-generic/m4/configure.m4 b/platform/linux-generic/m4/configure.m4 index de2fcf522..5380046e1 100644 --- a/platform/linux-generic/m4/configure.m4 +++ b/platform/linux-generic/m4/configure.m4 @@ -34,6 +34,7 @@ m4_include([platform/linux-generic/m4/odp_pcap.m4]) m4_include([platform/linux-generic/m4/odp_netmap.m4]) m4_include([platform/linux-generic/m4/odp_dpdk.m4]) m4_include([platform/linux-generic/m4/odp_ipc.m4]) +m4_include([platform/linux-generic/m4/odp_schedule.m4]) AC_CONFIG_FILES([platform/linux-generic/Makefile platform/linux-generic/test/Makefile diff --git a/platform/linux-generic/m4/odp_schedule.m4 b/platform/linux-generic/m4/odp_schedule.m4 new file mode 100644 index 000000000..bc70c1fc8 --- /dev/null +++ b/platform/linux-generic/m4/odp_schedule.m4 @@ -0,0 +1,6 @@ +AC_ARG_ENABLE([schedule-sp], + [ --enable-schedule-sp enable strict priority scheduler], + [if test x$enableval = xyes; then + schedule-sp=yes + ODP_CFLAGS="$ODP_CFLAGS -DODP_SCHEDULE_SP" + fi]) diff --git a/platform/linux-generic/odp_schedule.c b/platform/linux-generic/odp_schedule.c index d4e7fc3be..c5e47fc55 100644 --- a/platform/linux-generic/odp_schedule.c +++ b/platform/linux-generic/odp_schedule.c @@ -954,7 +954,7 @@ static int schedule_num_grps(void) } /* Fill in scheduler interface */ -const schedule_fn_t default_schedule_fn = { +const schedule_fn_t schedule_default_fn = { .pktio_start = schedule_pktio_start, .thr_add = schedule_thr_add, .thr_rem = schedule_thr_rem, diff --git a/platform/linux-generic/odp_schedule_if.c b/platform/linux-generic/odp_schedule_if.c index bf11cd3e1..b6dad51f0 100644 --- a/platform/linux-generic/odp_schedule_if.c +++ b/platform/linux-generic/odp_schedule_if.c @@ -6,6 +6,11 @@ #include <odp_schedule_if.h> -extern const schedule_fn_t default_schedule_fn; +extern const schedule_fn_t schedule_sp_fn; +extern const schedule_fn_t schedule_default_fn; -const schedule_fn_t *sched_fn = &default_schedule_fn; +#ifdef ODP_SCHEDULE_SP +const schedule_fn_t *sched_fn = &schedule_sp_fn; +#else +const schedule_fn_t *sched_fn = &schedule_default_fn; +#endif diff --git a/platform/linux-generic/odp_schedule_sp.c b/platform/linux-generic/odp_schedule_sp.c new file mode 100644 index 000000000..9f1ef162c --- /dev/null +++ b/platform/linux-generic/odp_schedule_sp.c @@ -0,0 +1,71 @@ +/* Copyright (c) 2016, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#include <string.h> +#include <odp/api/schedule.h> +#include <odp_schedule_if.h> +#include <odp_debug_internal.h> + +static int init_global(void) +{ + ODP_DBG("Schedule SP init ...\n"); + + ODP_ABORT("Not implemented."); + + return 0; +} + +static int init_local(void) +{ + return 0; +} + +static int term_global(void) +{ + return 0; +} + +static int term_local(void) +{ + return 0; +} + +/* Fill in scheduler interface */ +const schedule_fn_t schedule_sp_fn = { + .pktio_start = NULL, + .thr_add = NULL, + .thr_rem = NULL, + .num_grps = NULL, + .init_queue = NULL, + .destroy_queue = NULL, + .sched_queue = NULL, + .init_global = init_global, + .term_global = term_global, + .init_local = init_local, + .term_local = term_local +}; + +/* Fill in scheduler API calls */ +const schedule_api_t schedule_sp_api = { + .schedule_wait_time = NULL, + .schedule = NULL, + .schedule_multi = NULL, + .schedule_pause = NULL, + .schedule_resume = NULL, + .schedule_release_atomic = NULL, + .schedule_release_ordered = NULL, + .schedule_prefetch = NULL, + .schedule_num_prio = NULL, + .schedule_group_create = NULL, + .schedule_group_destroy = NULL, + .schedule_group_lookup = NULL, + .schedule_group_join = NULL, + .schedule_group_leave = NULL, + .schedule_group_thrmask = NULL, + .schedule_group_info = NULL, + .schedule_order_lock = NULL, + .schedule_order_unlock = NULL +}; |