session: add startup option to poll in main

Type: improvement

Needed to support multi-worker tests

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I68d5590cece24a744513dc6c324dfb2861a38a94
This commit is contained in:
Florin Coras
2020-11-25 08:44:16 -08:00
committed by Damjan Marion
parent bc867c3d21
commit e92c946498
4 changed files with 11 additions and 4 deletions

View File

@ -110,7 +110,7 @@ class QUICTestCase(VppTestCase):
class QUICEchoIntTestCase(QUICTestCase): class QUICEchoIntTestCase(QUICTestCase):
"""QUIC Echo Internal Test Case""" """QUIC Echo Internal Test Case"""
test_bytes = ' test-bytes' test_bytes = ' test-bytes'
extra_vpp_punt_config = ["session", "{", "enable", "}"] extra_vpp_punt_config = ["session", "{", "enable", "poll-main", "}"]
def setUp(self): def setUp(self):
super(QUICEchoIntTestCase, self).setUp() super(QUICEchoIntTestCase, self).setUp()
@ -177,7 +177,7 @@ class QUICEchoExtTestCase(QUICTestCase):
server_fifo_size = "1M" server_fifo_size = "1M"
client_fifo_size = "4M" client_fifo_size = "4M"
extra_vpp_punt_config = ["session", "{", extra_vpp_punt_config = ["session", "{",
"enable", "evt_qs_memfd_seg", "enable", "poll-main", "evt_qs_memfd_seg",
"evt_qs_seg_size", "64M", "evt_qs_seg_size", "64M",
"event-queue-length", f"{evt_q_len}", "event-queue-length", f"{evt_q_len}",
"preallocated-sessions", "1024", "preallocated-sessions", "1024",

View File

@ -49,6 +49,7 @@ class VCLAppWorker(Worker):
class VCLTestCase(VppTestCase): class VCLTestCase(VppTestCase):
""" VCL Test Class """ """ VCL Test Class """
extra_vpp_punt_config = ["session", "{", "poll-main", "}"]
@classmethod @classmethod
def setUpClass(cls): def setUpClass(cls):

View File

@ -1780,8 +1780,8 @@ session_node_enable_disable (u8 is_en)
session_queue_process_node.index, session_queue_process_node.index,
SESSION_Q_PROCESS_STOP, 0); SESSION_Q_PROCESS_STOP, 0);
} }
if (!session_main.poll_main)
continue; continue;
} }
vlib_node_set_state (this_vlib_main, session_queue_node.index, vlib_node_set_state (this_vlib_main, session_queue_node.index,
state); state);
@ -1818,6 +1818,7 @@ session_main_init (vlib_main_t * vm)
smm->is_enabled = 0; smm->is_enabled = 0;
smm->session_enable_asap = 0; smm->session_enable_asap = 0;
smm->poll_main = 0;
smm->session_baseva = HIGH_SEGMENT_BASEVA; smm->session_baseva = HIGH_SEGMENT_BASEVA;
#if (HIGH_SEGMENT_BASEVA > (4ULL << 30)) #if (HIGH_SEGMENT_BASEVA > (4ULL << 30))
@ -1935,6 +1936,8 @@ session_config_fn (vlib_main_t * vm, unformat_input_t * input)
; ;
else if (unformat (input, "use-app-socket-api")) else if (unformat (input, "use-app-socket-api"))
appns_sapi_enable (); appns_sapi_enable ();
else if (unformat (input, "poll-main"))
smm->poll_main = 1;
else else
return clib_error_return (0, "unknown input `%U'", return clib_error_return (0, "unknown input `%U'",
format_unformat_error, input); format_unformat_error, input);

View File

@ -171,6 +171,9 @@ typedef struct session_main_
/** Enable session manager at startup */ /** Enable session manager at startup */
u8 session_enable_asap; u8 session_enable_asap;
/** Poll session node in main thread */
u8 poll_main;
/** vpp fifo event queue configured length */ /** vpp fifo event queue configured length */
u32 configured_event_queue_length; u32 configured_event_queue_length;