aboutsummaryrefslogtreecommitdiff
path: root/platform/linux-generic/include/odp_schedule_if.h
diff options
context:
space:
mode:
Diffstat (limited to 'platform/linux-generic/include/odp_schedule_if.h')
-rw-r--r--platform/linux-generic/include/odp_schedule_if.h100
1 files changed, 47 insertions, 53 deletions
diff --git a/platform/linux-generic/include/odp_schedule_if.h b/platform/linux-generic/include/odp_schedule_if.h
index e842fb464..7a61b1dc0 100644
--- a/platform/linux-generic/include/odp_schedule_if.h
+++ b/platform/linux-generic/include/odp_schedule_if.h
@@ -1,7 +1,6 @@
-/* Copyright (c) 2013, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2013-2018 Linaro Limited
+ * Copyright (c) 2021 Nokia
*/
#ifndef ODP_SCHEDULE_IF_H_
@@ -12,38 +11,61 @@ extern "C" {
#endif
#include <odp/api/queue.h>
-#include <odp_queue_internal.h>
#include <odp/api/schedule.h>
+#include <odp/api/plat/schedule_inline_types.h>
-typedef void (*schedule_pktio_start_fn_t)(int pktio_index, int num_in_queue,
- int in_queue_idx[]);
+#include <odp_event_internal.h>
+#include <odp_queue_if.h>
+
+#define _ODP_SCHED_ID_BASIC 0
+#define _ODP_SCHED_ID_SP 1
+#define _ODP_SCHED_ID_SCALABLE 2
+
+/* Scheduler identifier */
+extern int _odp_sched_id;
+
+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[],
+ odp_queue_t odpq[]);
typedef int (*schedule_thr_add_fn_t)(odp_schedule_group_t group, int thr);
typedef int (*schedule_thr_rem_fn_t)(odp_schedule_group_t group, int thr);
typedef int (*schedule_num_grps_fn_t)(void);
-typedef int (*schedule_init_queue_fn_t)(uint32_t queue_index,
- const odp_schedule_param_t *sched_param
- );
+typedef int (*schedule_create_queue_fn_t)(uint32_t queue_index,
+ const odp_schedule_param_t *param);
typedef void (*schedule_destroy_queue_fn_t)(uint32_t queue_index);
typedef int (*schedule_sched_queue_fn_t)(uint32_t queue_index);
typedef int (*schedule_unsched_queue_fn_t)(uint32_t queue_index);
-typedef int (*schedule_ord_enq_multi_fn_t)(queue_t q_int,
- void *buf_hdr[], int num, int *ret);
+typedef int (*schedule_ord_enq_multi_fn_t)(odp_queue_t queue, void *event_hdr[],
+ int num, int *ret);
typedef int (*schedule_init_global_fn_t)(void);
typedef int (*schedule_term_global_fn_t)(void);
typedef int (*schedule_init_local_fn_t)(void);
typedef int (*schedule_term_local_fn_t)(void);
typedef void (*schedule_order_lock_fn_t)(void);
typedef void (*schedule_order_unlock_fn_t)(void);
-typedef unsigned (*schedule_max_ordered_locks_fn_t)(void);
-typedef void (*schedule_save_context_fn_t)(uint32_t queue_index);
+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_get_config_fn_t)(schedule_config_t *config);
+typedef const _odp_schedule_api_fn_t *(*schedule_sched_api_fn_t)(void);
typedef struct schedule_fn_t {
- int status_sync;
schedule_pktio_start_fn_t pktio_start;
schedule_thr_add_fn_t thr_add;
schedule_thr_rem_fn_t thr_rem;
schedule_num_grps_fn_t num_grps;
- schedule_init_queue_fn_t init_queue;
+ schedule_create_queue_fn_t create_queue;
schedule_destroy_queue_fn_t destroy_queue;
schedule_sched_queue_fn_t sched_queue;
schedule_ord_enq_multi_fn_t ord_enq_multi;
@@ -53,50 +75,22 @@ typedef struct schedule_fn_t {
schedule_term_local_fn_t term_local;
schedule_order_lock_fn_t order_lock;
schedule_order_unlock_fn_t order_unlock;
+ schedule_order_lock_start_fn_t start_order_lock;
+ 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;
-
- /* Called only when status_sync is set */
- schedule_unsched_queue_fn_t unsched_queue;
- schedule_save_context_fn_t save_context;
+ schedule_get_config_fn_t get_config;
+ schedule_sched_api_fn_t sched_api;
} schedule_fn_t;
/* Interface towards the scheduler */
-extern const schedule_fn_t *sched_fn;
+extern const schedule_fn_t *_odp_sched_fn;
/* Interface for the scheduler */
-int sched_cb_pktin_poll(int pktio_index, int num_queue, int index[]);
-void sched_cb_pktio_stop_finalize(int pktio_index);
-odp_queue_t sched_cb_queue_handle(uint32_t queue_index);
-void sched_cb_queue_destroy_finalize(uint32_t queue_index);
-int sched_cb_queue_deq_multi(uint32_t queue_index, odp_event_t ev[], int num);
-int sched_cb_queue_empty(uint32_t queue_index);
-
-/* API functions */
-typedef struct {
- uint64_t (*schedule_wait_time)(uint64_t);
- odp_event_t (*schedule)(odp_queue_t *, uint64_t);
- int (*schedule_multi)(odp_queue_t *, uint64_t, odp_event_t [], int);
- void (*schedule_pause)(void);
- void (*schedule_resume)(void);
- void (*schedule_release_atomic)(void);
- void (*schedule_release_ordered)(void);
- void (*schedule_prefetch)(int);
- int (*schedule_num_prio)(void);
- odp_schedule_group_t (*schedule_group_create)(const char *,
- const odp_thrmask_t *);
- int (*schedule_group_destroy)(odp_schedule_group_t);
- odp_schedule_group_t (*schedule_group_lookup)(const char *);
- int (*schedule_group_join)(odp_schedule_group_t, const odp_thrmask_t *);
- int (*schedule_group_leave)(odp_schedule_group_t,
- const odp_thrmask_t *);
- int (*schedule_group_thrmask)(odp_schedule_group_t, odp_thrmask_t *);
- int (*schedule_group_info)(odp_schedule_group_t,
- odp_schedule_group_info_t *);
- void (*schedule_order_lock)(unsigned);
- void (*schedule_order_unlock)(unsigned);
-
-} schedule_api_t;
+int _odp_sched_cb_pktin_poll(int pktio_index, int pktin_index,
+ _odp_event_hdr_t *hdr_tbl[], int num);
+void _odp_sched_cb_pktio_stop_finalize(int pktio_index);
#ifdef __cplusplus
}