X-Git-Url: https://gerrit.fd.io/r/gitweb?p=vpp.git;a=blobdiff_plain;f=src%2Fvcl%2Fvcl_private.h;h=0204bd5493eb6de66713bfd4406b1e888c9db163;hp=1a9bb412fd766744c425fdfaf5bd3021e3a3b17c;hb=c1f5a43;hpb=134a996a0279577080b626d5172c1739efa00b92 diff --git a/src/vcl/vcl_private.h b/src/vcl/vcl_private.h index 1a9bb412fd7..0204bd5493e 100644 --- a/src/vcl/vcl_private.h +++ b/src/vcl/vcl_private.h @@ -18,7 +18,6 @@ #include #include -#include #include #if (CLIB_DEBUG > 0) @@ -139,6 +138,7 @@ do { \ typedef struct { + CLIB_CACHE_LINE_ALIGN_MARK (cacheline0); #define _(type, name) type name; foreach_app_session_field #undef _ @@ -153,6 +153,7 @@ typedef struct /* Socket configuration state */ u8 is_vep; u8 is_vep_session; + u8 has_rx_evt; u32 attr; u32 wait_cont_idx; vppcom_epoll_t vep; @@ -218,8 +219,12 @@ typedef struct vcl_worker_ /* Session pool */ vcl_session_t *sessions; + /** Worker/thread index in current process */ u32 wrk_index; + /** Worker index in vpp*/ + u32 vpp_wrk_index; + /** Message queues epoll fd. Initialized only if using mqs with eventfds */ int mqs_epfd; @@ -257,6 +262,12 @@ typedef struct vcl_worker_ /** Vector acting as buffer for mq messages */ svm_msg_q_msg_t *mq_msg_vector; + + /** Vector of unhandled events */ + session_event_t *unhandled_evts_vector; + + /** Used also as a thread stop key buffer */ + pthread_t thread_id; } vcl_worker_t; typedef struct vppcom_main_t_ @@ -265,15 +276,26 @@ typedef struct vppcom_main_t_ u32 debug; pthread_t main_cpu; - /** VPP binary api input queue */ - svm_queue_t *vl_input_queue; + /** Main process pid */ + pid_t main_pid; + + /** Current pid, may be different from main_pid if forked child */ + pid_t current_pid; + + /** App's index in vpp. It's used by vpp to identify the app */ + u32 app_index; /** API client handle */ u32 my_client_index; + /** VPP binary api input queue */ + svm_queue_t *vl_input_queue; + /** State of the connection, shared between msg RX thread and main thread */ volatile app_state_t app_state; + u8 *app_name; + /** VCL configuration */ vppcom_cfg_t cfg; @@ -283,6 +305,9 @@ typedef struct vppcom_main_t_ /** Workers */ vcl_worker_t *workers; + /** Lock to protect worker registrations */ + clib_spinlock_t workers_lock; + #ifdef VCL_ELOG /* VPP Event-logger */ elog_main_t elog_main; @@ -292,13 +317,6 @@ typedef struct vppcom_main_t_ /* VNET_API_ERROR_FOO -> "Foo" hash table */ uword *error_string_by_error_number; - /* Obsolete */ - - /* Event thread */ - vce_event_thread_t event_thread; - - /* IO thread */ - vppcom_session_io_thread_t session_io_thread; } vppcom_main_t; extern vppcom_main_t *vcm; @@ -485,7 +503,7 @@ void vppcom_send_session_enable_disable (u8 is_enable); void vppcom_app_send_attach (void); void vppcom_app_send_detach (void); void vppcom_send_connect_sock (vcl_session_t * session); -void vppcom_send_disconnect_session (u64 vpp_handle, u32 session_index); +void vppcom_send_disconnect_session (u64 vpp_handle); void vppcom_send_bind_sock (vcl_session_t * session); void vppcom_send_unbind_sock (u64 vpp_handle); void vppcom_api_hookup (void);