From 653e43f06a974121343b2c1f0e4533926020877b Mon Sep 17 00:00:00 2001 From: Florin Coras Date: Mon, 4 Mar 2019 10:56:23 -0800 Subject: session: use vpp to switch io events for ct sessions Instead of allocating pairs of message queues per cut-thru session and having the applications map them, this uses vpp as an io event message switch. Change-Id: I51db1c7564df479a7d1a3288342394251fd188bb Signed-off-by: Florin Coras --- src/vnet/session/session.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'src/vnet/session/session.c') diff --git a/src/vnet/session/session.c b/src/vnet/session/session.c index 57567926a1c..6e24d562f98 100644 --- a/src/vnet/session/session.c +++ b/src/vnet/session/session.c @@ -124,13 +124,6 @@ session_program_transport_close (session_t * s) session_worker_t *wrk; session_event_t *evt; - if (!session_has_transport (s)) - { - /* Polling may not be enabled on main thread so close now */ - session_transport_close (s); - return; - } - /* If we are in the handler thread, or being called with the worker barrier * held, just append a new event to pending disconnects vector. */ if (vlib_thread_is_main_w_barrier () || thread_index == s->thread_index) @@ -483,7 +476,7 @@ session_notify_subscribers (u32 app_index, session_t * s, * @return 0 on success or negative number if failed to send notification. */ static inline int -session_enqueue_notify (session_t * s) +session_enqueue_notify_inline (session_t * s) { app_worker_t *app_wrk; @@ -512,6 +505,12 @@ session_enqueue_notify (session_t * s) return 0; } +int +session_enqueue_notify (session_t * s) +{ + return session_enqueue_notify_inline (s); +} + int session_dequeue_notify (session_t * s) { @@ -560,7 +559,11 @@ session_main_flush_enqueue_events (u8 transport_proto, u32 thread_index) errors++; continue; } - if (PREDICT_FALSE (session_enqueue_notify (s))) + + if (svm_fifo_is_empty (s->rx_fifo)) + continue; + + if (PREDICT_FALSE (session_enqueue_notify_inline (s))) errors++; } -- cgit 1.2.3-korg