diff options
author | Florin Coras <fcoras@cisco.com> | 2019-01-02 19:31:22 -0800 |
---|---|---|
committer | Dave Barach <openvpp@barachs.net> | 2019-01-05 21:53:16 +0000 |
commit | 30e79c2e388a98160a3660f4f03103890c9b1b7c (patch) | |
tree | 0b108f43d95e28304924cc6e1d43900b3046c8de /src/vcl/vcl_private.h | |
parent | 3c1cf2c1716f436e5da4a106dd2b9a3df5d3a4a3 (diff) |
vcl/session: add api for changing session app worker
In case of multi process apps, after forking, the parent may decide to
close part or all of the sessions it shares with the child. Because the
sessions have fifos allocated in the parent's segment manager, they must
be moved to the child's segment manager.
Change-Id: I85b4c8c8545005724023ee14043647719cef61dd
Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vcl/vcl_private.h')
-rw-r--r-- | src/vcl/vcl_private.h | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/src/vcl/vcl_private.h b/src/vcl/vcl_private.h index 9dce5182193..2ae4b72f6a4 100644 --- a/src/vcl/vcl_private.h +++ b/src/vcl/vcl_private.h @@ -69,7 +69,8 @@ typedef enum STATE_ACCEPT = 0x08, STATE_VPP_CLOSING = 0x10, STATE_DISCONNECT = 0x20, - STATE_FAILED = 0x40 + STATE_FAILED = 0x40, + STATE_UPDATED = 0x80, } session_state_t; #define SERVER_STATE_OPEN (STATE_ACCEPT|STATE_VPP_CLOSING) @@ -144,6 +145,7 @@ typedef struct vcl_shared_session_ { u32 ss_index; u32 *workers; + u32 session_index; } vcl_shared_session_t; typedef struct @@ -287,6 +289,8 @@ typedef struct vcl_worker_ /** Vector of unhandled events */ session_event_t *unhandled_evts_vector; + u32 *pending_session_wrk_updates; + /** Used also as a thread stop key buffer */ pthread_t thread_id; @@ -517,6 +521,7 @@ int vcl_worker_register_with_vpp (void); int vcl_worker_set_bapi (void); void vcl_worker_share_sessions (vcl_worker_t * parent_wrk); int vcl_worker_unshare_session (vcl_worker_t * wrk, vcl_session_t * s); +vcl_shared_session_t *vcl_shared_session_get (u32 ss_index); int vcl_session_get_refcnt (vcl_session_t * s); void vcl_segment_table_add (u64 segment_handle, u32 svm_segment_index); @@ -543,6 +548,17 @@ vcl_worker_get_current (void) return vcl_worker_get (vcl_get_worker_index ()); } +static inline svm_msg_q_t * +vcl_session_vpp_evt_q (vcl_worker_t * wrk, vcl_session_t * s) +{ + if (vcl_session_is_ct (s)) + return wrk->vpp_event_queues[0]; + else + return wrk->vpp_event_queues[s->vpp_thread_index]; +} + +void vcl_send_session_worker_update (vcl_worker_t * wrk, vcl_session_t * s, + u32 wrk_index); /* * VCL Binary API */ @@ -556,12 +572,10 @@ 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); -void vppcom_send_accept_session_reply (u64 vpp_handle, u32 context, int rv); void vppcom_send_application_tls_cert_add (vcl_session_t * session, char *cert, u32 cert_len); -void -vppcom_send_application_tls_key_add (vcl_session_t * session, char *key, - u32 key_len); +void vppcom_send_application_tls_key_add (vcl_session_t * session, char *key, + u32 key_len); void vcl_send_app_worker_add_del (u8 is_add); void vcl_send_child_worker_del (vcl_worker_t * wrk); |