summaryrefslogtreecommitdiffstats
path: root/src/vnet/session/session.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2019-03-04 10:56:23 -0800
committerDave Barach <openvpp@barachs.net>2019-03-06 17:53:39 +0000
commit653e43f06a974121343b2c1f0e4533926020877b (patch)
tree6ab92561e8eccbda6b29316f794de531032a1259 /src/vnet/session/session.c
parenta55df1081762b4e40698ef7d9196551851be646a (diff)
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 <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/session/session.c')
-rw-r--r--src/vnet/session/session.c21
1 files changed, 12 insertions, 9 deletions
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;
@@ -513,6 +506,12 @@ session_enqueue_notify (session_t * s)
}
int
+session_enqueue_notify (session_t * s)
+{
+ return session_enqueue_notify_inline (s);
+}
+
+int
session_dequeue_notify (session_t * s)
{
app_worker_t *app_wrk;
@@ -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++;
}