From 309f7aac170767028a2e6e7e9424ec3d13304aff Mon Sep 17 00:00:00 2001 From: Florin Coras Date: Fri, 18 Mar 2022 08:33:08 -0700 Subject: session: move connects to first worker Type: improvement Signed-off-by: Florin Coras Change-Id: I035e3fdbb52eca010ad7b2c20ca2930cb1645978 --- src/plugins/hs_apps/echo_client.c | 8 ++------ src/plugins/unittest/session_test.c | 8 -------- 2 files changed, 2 insertions(+), 14 deletions(-) (limited to 'src/plugins') diff --git a/src/plugins/hs_apps/echo_client.c b/src/plugins/hs_apps/echo_client.c index c6c7ede2f92..14d47be7422 100644 --- a/src/plugins/hs_apps/echo_client.c +++ b/src/plugins/hs_apps/echo_client.c @@ -826,7 +826,6 @@ ec_connect_rpc (void *args) { ec_main_t *ecm = &ec_main; vnet_connect_args_t _a = {}, *a = &_a; - vlib_main_t *vm = vlib_get_main (); int rv, needs_crypto; u32 n_clients, ci; @@ -838,8 +837,6 @@ ec_connect_rpc (void *args) ci = ecm->connect_conn_index; - vlib_worker_thread_barrier_sync (vm); - while (ci < n_clients) { /* Crude pacing for call setups */ @@ -873,8 +870,6 @@ ec_connect_rpc (void *args) ci += 1; } - vlib_worker_thread_barrier_release (vm); - if (ci < ecm->expected_connections && ecm->run_test != EC_EXITING) ec_program_connects (); @@ -884,7 +879,8 @@ ec_connect_rpc (void *args) void ec_program_connects (void) { - session_send_rpc_evt_to_thread_force (0, ec_connect_rpc, 0); + session_send_rpc_evt_to_thread_force (transport_cl_thread (), ec_connect_rpc, + 0); } #define ec_cli(_fmt, _args...) \ diff --git a/src/plugins/unittest/session_test.c b/src/plugins/unittest/session_test.c index 6a292c783eb..70d9fd02048 100644 --- a/src/plugins/unittest/session_test.c +++ b/src/plugins/unittest/session_test.c @@ -404,14 +404,6 @@ session_test_endpoint_cfg (vlib_main_t * vm, unformat_input_t * input) SESSION_TEST ((tc->lcl_port == placeholder_client_port), "ports should be equal"); - /* These sessions, because of the way they're established are pinned to - * main thread, even when we have workers and we avoid polling main thread, - * i.e., we can't cleanup pending disconnects, so force cleanup for both - */ - session_transport_cleanup (s); - s = session_get (accepted_session_index, accepted_session_thread); - session_transport_cleanup (s); - vnet_app_detach_args_t detach_args = { .app_index = server_index, .api_client_index = ~0, -- cgit 1.2.3-korg