aboutsummaryrefslogtreecommitdiffstats
path: root/src/vlib/threads.h
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2017-01-04 13:19:27 +0100
committerDave Barach <openvpp@barachs.net>2017-01-14 14:17:03 +0000
commit878c609889dcdc58538d40d8b3f662320f88573d (patch)
treefa241dadbdd1db60b47fe3f077ab3392716690d5 /src/vlib/threads.h
parenteea28d78a3173341727aafee4c414bcb01001339 (diff)
vlib: add buffer and thread callbacks
Change-Id: I8e2e8f94a884ab2f9909d0c83ba00edd38cdab77 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vlib/threads.h')
-rw-r--r--src/vlib/threads.h17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/vlib/threads.h b/src/vlib/threads.h
index 34ab5be8650..75a5a2818fb 100644
--- a/src/vlib/threads.h
+++ b/src/vlib/threads.h
@@ -265,6 +265,13 @@ typedef enum
typedef struct
{
+ clib_error_t *(*vlib_launch_thread_cb) (void *fp, vlib_worker_thread_t * w,
+ unsigned lcore_id);
+ clib_error_t *(*vlib_thread_set_lcore_cb) (u32 thread, u16 lcore);
+} vlib_thread_callbacks_t;
+
+typedef struct
+{
/* Link list of registrations, built by constructors */
vlib_thread_registration_t *next;
@@ -290,8 +297,8 @@ typedef struct
/* Number of pthreads */
u32 n_pthreads;
- /* Number of DPDK eal threads */
- u32 n_eal_threads;
+ /* Number of threads */
+ u32 n_threads;
/* Number of cores to skip, must match the core mask */
u32 skip_cores;
@@ -320,6 +327,9 @@ typedef struct
/* scheduling policy priority */
u32 sched_priority;
+ /* callbacks */
+ vlib_thread_callbacks_t cb;
+ int extern_thread_mgmt;
} vlib_thread_main_t;
extern vlib_thread_main_t vlib_thread_main;
@@ -459,6 +469,9 @@ vlib_get_worker_handoff_queue_elt (u32 frame_queue_index,
return elt;
}
+int vlib_thread_cb_register (struct vlib_main_t *vm,
+ vlib_thread_callbacks_t * cb);
+
#endif /* included_vlib_threads_h */
/*