diff options
author | Florin Coras <fcoras@cisco.com> | 2018-07-04 04:15:05 -0700 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2018-07-17 09:02:17 +0000 |
commit | 3c2fed5145d9e40a9ecd178c2866c813eddc6203 (patch) | |
tree | 7ff2408f3b1c4a52fb6d7cd091508de1ce950e5f /src/vnet/tls/tls.c | |
parent | 5da96a77a84ae5414debbc46d390464d51010113 (diff) |
session: use msg queue for events
Change-Id: I3c58367eec2243fe19b75be78a175c5261863e9e
Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/tls/tls.c')
-rw-r--r-- | src/vnet/tls/tls.c | 52 |
1 files changed, 2 insertions, 50 deletions
diff --git a/src/vnet/tls/tls.c b/src/vnet/tls/tls.c index 492b3cc7a2a..cea449163f8 100644 --- a/src/vnet/tls/tls.c +++ b/src/vnet/tls/tls.c @@ -41,63 +41,15 @@ tls_get_available_engine (void) int tls_add_vpp_q_evt (svm_fifo_t * f, u8 evt_type) { - session_fifo_event_t evt; - svm_queue_t *q; - if (svm_fifo_set_event (f)) - { - evt.fifo = f; - evt.event_type = evt_type; - - q = session_manager_get_vpp_event_queue (f->master_thread_index); - if (PREDICT_TRUE (q->cursize < q->maxsize)) - { - svm_queue_add (q, (u8 *) & evt, 0 /* do wait for mutex */ ); - } - else - { - clib_warning ("vpp's evt q full"); - return -1; - } - } + session_send_io_evt_to_thread (f, evt_type); return 0; } static inline int tls_add_app_q_evt (application_t * app, stream_session_t * app_session) { - session_fifo_event_t evt; - svm_queue_t *q; - - if (PREDICT_FALSE (app_session->session_state == SESSION_STATE_CLOSED)) - { - /* Session is closed so app will never clean up. Flush rx fifo */ - u32 to_dequeue = svm_fifo_max_dequeue (app_session->server_rx_fifo); - if (to_dequeue) - svm_fifo_dequeue_drop (app_session->server_rx_fifo, to_dequeue); - return 0; - } - - if (app->cb_fns.builtin_app_rx_callback) - return app->cb_fns.builtin_app_rx_callback (app_session); - - if (svm_fifo_set_event (app_session->server_rx_fifo)) - { - evt.fifo = app_session->server_rx_fifo; - evt.event_type = FIFO_EVENT_APP_RX; - q = app->event_queue; - - if (PREDICT_TRUE (q->cursize < q->maxsize)) - { - svm_queue_add (q, (u8 *) & evt, 0 /* do wait for mutex */ ); - } - else - { - clib_warning ("app evt q full"); - return -1; - } - } - return 0; + return application_send_event (app, app_session, FIFO_EVENT_APP_RX); } u32 |