aboutsummaryrefslogtreecommitdiffstats
path: root/vlib/vlib/threads.h
diff options
context:
space:
mode:
authorPavel Kotucek <pkotucek@cisco.com>2016-09-23 08:54:14 +0200
committerDamjan Marion <dmarion.lists@gmail.com>2016-09-27 09:04:22 +0000
commit1e7658340ac4cba20defba056c2e13ec0e1a0a69 (patch)
treefa86dc988d6d1c1ac78c9328651074c5f5347227 /vlib/vlib/threads.h
parent82bf7cddd26b626d3e2d7e3337d52cf2c1b83a22 (diff)
VPP-425: Scheduler policy & priority configuration
Add ability to hadle scheduling policy and priority via config file. CPU section contains new items to specify scheduling policy and priority: cpu { scheduler-priority <num> scheduler-policy [other | batch | idle | fifo | rr ] } Change-Id: Ie20765280e458e1d7deb4a8c66daaa69793f795e Signed-off-by: Pavel Kotucek <pkotucek@cisco.com>
Diffstat (limited to 'vlib/vlib/threads.h')
-rw-r--r--vlib/vlib/threads.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/vlib/vlib/threads.h b/vlib/vlib/threads.h
index 4283b70a61d..589d1f3a1ec 100644
--- a/vlib/vlib/threads.h
+++ b/vlib/vlib/threads.h
@@ -16,6 +16,7 @@
#define included_vlib_threads_h
#include <vlib/main.h>
+#include <linux/sched.h>
vlib_main_t **vlib_mains;
@@ -257,6 +258,21 @@ typedef struct vlib_efd_t
u8 pad;
} vlib_efd_t;
+#define foreach_sched_policy \
+ _(SCHED_OTHER, OTHER, "other") \
+ _(SCHED_BATCH, BATCH, "batch") \
+ _(SCHED_IDLE, IDLE, "idle") \
+ _(SCHED_FIFO, FIFO, "fifo") \
+ _(SCHED_RR, RR, "rr")
+
+typedef enum
+{
+#define _(v,f,s) SCHED_POLICY_##f = v,
+ foreach_sched_policy
+#undef _
+ SCHED_POLICY_N,
+} sched_policy_t;
+
typedef struct
{
/* Link list of registrations, built by constructors */
@@ -314,6 +330,12 @@ typedef struct
/* worker thread initialization barrier */
volatile u32 worker_thread_release;
+ /* scheduling policy */
+ u32 sched_policy;
+
+ /* scheduling policy priority */
+ u32 sched_priority;
+
} vlib_thread_main_t;
vlib_thread_main_t vlib_thread_main;