aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/session
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/session')
-rw-r--r--src/vnet/session/session.h9
-rw-r--r--src/vnet/session/transport.c6
2 files changed, 14 insertions, 1 deletions
diff --git a/src/vnet/session/session.h b/src/vnet/session/session.h
index f874ac2a263..b583c3ef0dd 100644
--- a/src/vnet/session/session.h
+++ b/src/vnet/session/session.h
@@ -189,6 +189,9 @@ typedef struct session_main_
* Trade memory for speed, for now */
u32 *session_type_to_next;
+ /** Thread for cl and ho that rely on cl allocs */
+ u32 transport_cl_thread;
+
transport_proto_t last_transport_proto_type;
/*
@@ -619,6 +622,12 @@ transport_add_tx_event (transport_connection_t * tc)
session_send_io_evt_to_thread (s->tx_fifo, SESSION_IO_EVT_TX);
}
+always_inline u32
+transport_cl_thread (void)
+{
+ return session_main.transport_cl_thread;
+}
+
/*
* Listen sessions
*/
diff --git a/src/vnet/session/transport.c b/src/vnet/session/transport.c
index 2c88a4c4931..5975197609d 100644
--- a/src/vnet/session/transport.c
+++ b/src/vnet/session/transport.c
@@ -853,7 +853,11 @@ transport_init (void)
smm->local_endpoints_table_memory);
num_threads = 1 /* main thread */ + vtm->n_threads;
if (num_threads > 1)
- clib_spinlock_init (&local_endpoints_lock);
+ {
+ clib_spinlock_init (&local_endpoints_lock);
+ /* Main not polled if there are workers */
+ smm->transport_cl_thread = 1;
+ }
}
/*