summaryrefslogtreecommitdiffstats
path: root/src/vlibmemory/socket_client.c
diff options
context:
space:
mode:
authorTomasz Kulasek <tomaszx.kulasek@intel.com>2019-01-31 18:26:32 +0100
committerFlorin Coras <florin.coras@gmail.com>2019-02-05 21:56:19 +0000
commit97dcf5bd26ca6de580943f5d39681f0144782c3d (patch)
tree7a7b3849d9296c80f69de54df9aa1bbc524aea70 /src/vlibmemory/socket_client.c
parent4edc37eb90a74bcd1aad20d6447159c05853d23e (diff)
sock api: allow to start client with no rx_thread
Change-Id: Ia30ff1e62304e65f27497ce05f8e40631c06d69e Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Diffstat (limited to 'src/vlibmemory/socket_client.c')
-rw-r--r--src/vlibmemory/socket_client.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/vlibmemory/socket_client.c b/src/vlibmemory/socket_client.c
index 38bcc2a5156..ca1e53538ae 100644
--- a/src/vlibmemory/socket_client.c
+++ b/src/vlibmemory/socket_client.c
@@ -304,8 +304,18 @@ static void vl_api_sock_init_shm_reply_t_handler
new_name = format (0, "%v[shm]%c", scm->name, 0);
vl_client_install_client_message_handlers ();
- vl_client_connect_to_vlib_no_map ("pvt", (char *) new_name,
- 32 /* input_queue_length */ );
+ if (scm->want_shm_pthread)
+ {
+ vl_client_connect_to_vlib_no_map ("pvt", (char *) new_name,
+ 32 /* input_queue_length */ );
+ }
+ else
+ {
+ vl_client_connect_to_vlib_no_rx_pthread_no_map ("pvt",
+ (char *) new_name, 32
+ /* input_queue_length */
+ );
+ }
vl_socket_client_enable_disable (0);
vec_free (new_name);
}
@@ -402,13 +412,16 @@ vl_socket_client_connect (char *socket_path, char *client_name,
}
int
-vl_socket_client_init_shm (vl_api_shm_elem_config_t * config)
+vl_socket_client_init_shm (vl_api_shm_elem_config_t * config,
+ int want_pthread)
{
socket_client_main_t *scm = &socket_client_main;
vl_api_sock_init_shm_t *mp;
int rv, i;
u64 *cfg;
+ scm->want_shm_pthread = want_pthread;
+
mp = vl_socket_client_msg_alloc (sizeof (*mp) +
vec_len (config) * sizeof (u64));
clib_memset (mp, 0, sizeof (*mp));