diff options
author | Janne Peltonen <janne.peltonen@nokia.com> | 2022-04-22 09:01:43 +0300 |
---|---|---|
committer | Petri Savolainen <petri.savolainen@nokia.com> | 2022-05-06 13:22:03 +0300 |
commit | be306d8c07d19a60ab41ddee51bd341b30ac63fd (patch) | |
tree | d5fb28197b27af5a69128ae47a6b5f3ded5f78ce /platform | |
parent | 12a96596d7f977e7a55cd487d9969f905afc1209 (diff) |
linux-gen: schedule: implement odp_schedule_order_wait()
Implement odp_schedule_order_wait() by using the existing order_lock()
(not to be confused with ordered locks) function that does what we need
and does not require unlock. Support is added for the basic and scalable
scheduler but not for the SP scheduler where the function is a nop.
Signed-off-by: Janne Peltonen <janne.peltonen@nokia.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
Diffstat (limited to 'platform')
-rw-r--r-- | platform/linux-generic/include/odp_schedule_if.h | 1 | ||||
-rw-r--r-- | platform/linux-generic/odp_schedule_basic.c | 2 | ||||
-rw-r--r-- | platform/linux-generic/odp_schedule_if.c | 5 | ||||
-rw-r--r-- | platform/linux-generic/odp_schedule_scalable.c | 2 | ||||
-rw-r--r-- | platform/linux-generic/odp_schedule_sp.c | 1 |
5 files changed, 11 insertions, 0 deletions
diff --git a/platform/linux-generic/include/odp_schedule_if.h b/platform/linux-generic/include/odp_schedule_if.h index cec9c8bb8..d9ba165bc 100644 --- a/platform/linux-generic/include/odp_schedule_if.h +++ b/platform/linux-generic/include/odp_schedule_if.h @@ -131,6 +131,7 @@ typedef struct { uint32_t lock_index); void (*schedule_order_lock_start)(uint32_t lock_index); void (*schedule_order_lock_wait)(uint32_t lock_index); + void (*schedule_order_wait)(void); void (*schedule_print)(void); } schedule_api_t; diff --git a/platform/linux-generic/odp_schedule_basic.c b/platform/linux-generic/odp_schedule_basic.c index ad3de237f..b6952bf1f 100644 --- a/platform/linux-generic/odp_schedule_basic.c +++ b/platform/linux-generic/odp_schedule_basic.c @@ -1979,6 +1979,7 @@ static int schedule_capability(odp_schedule_capability_t *capa) capa->max_queues = sched->max_queues; capa->max_queue_size = _odp_queue_glb->config.max_queue_size; capa->max_flow_id = BUF_HDR_MAX_FLOW_ID; + capa->order_wait = ODP_SUPPORT_YES; return 0; } @@ -2117,5 +2118,6 @@ const schedule_api_t _odp_schedule_basic_api = { .schedule_order_unlock_lock = schedule_order_unlock_lock, .schedule_order_lock_start = schedule_order_lock_start, .schedule_order_lock_wait = schedule_order_lock_wait, + .schedule_order_wait = order_lock, .schedule_print = schedule_print }; diff --git a/platform/linux-generic/odp_schedule_if.c b/platform/linux-generic/odp_schedule_if.c index 3b908ea87..564153137 100644 --- a/platform/linux-generic/odp_schedule_if.c +++ b/platform/linux-generic/odp_schedule_if.c @@ -203,6 +203,11 @@ void odp_schedule_order_lock_wait(uint32_t lock_index) _odp_sched_api->schedule_order_lock_wait(lock_index); } +void odp_schedule_order_wait(void) +{ + _odp_sched_api->schedule_order_wait(); +} + void odp_schedule_print(void) { _odp_sched_api->schedule_print(); diff --git a/platform/linux-generic/odp_schedule_scalable.c b/platform/linux-generic/odp_schedule_scalable.c index 4e071a78d..66cb66315 100644 --- a/platform/linux-generic/odp_schedule_scalable.c +++ b/platform/linux-generic/odp_schedule_scalable.c @@ -2167,6 +2167,7 @@ static int schedule_capability(odp_schedule_capability_t *capa) capa->max_prios = schedule_num_prio(); capa->max_queues = CONFIG_MAX_SCHED_QUEUES; capa->max_queue_size = 0; + capa->order_wait = ODP_SUPPORT_YES; return 0; } @@ -2233,5 +2234,6 @@ const schedule_api_t _odp_schedule_scalable_api = { .schedule_order_unlock_lock = schedule_order_unlock_lock, .schedule_order_lock_start = schedule_order_lock_start, .schedule_order_lock_wait = schedule_order_lock_wait, + .schedule_order_wait = order_lock, .schedule_print = schedule_print }; diff --git a/platform/linux-generic/odp_schedule_sp.c b/platform/linux-generic/odp_schedule_sp.c index 9d805a53a..11564d32b 100644 --- a/platform/linux-generic/odp_schedule_sp.c +++ b/platform/linux-generic/odp_schedule_sp.c @@ -1119,5 +1119,6 @@ const schedule_api_t _odp_schedule_sp_api = { .schedule_order_unlock_lock = schedule_order_unlock_lock, .schedule_order_lock_start = schedule_order_lock_start, .schedule_order_lock_wait = schedule_order_lock_wait, + .schedule_order_wait = order_lock, .schedule_print = schedule_print }; |