2 * Copyright (c) 2016 Cisco and/or its affiliates.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at:
7 * http://www.apache.org/licenses/LICENSE-2.0
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
18 #include <vlib/vlib.h>
19 #include <vnet/vnet.h>
20 #include <svm/svm_fifo_segment.h>
21 #include <vlibmemory/api.h>
22 #include <vpp/api/vpe_msg_enum.h>
23 #include <vnet/session/application_interface.h>
25 #define vl_typedefs /* define message structures */
26 #include <vpp/api/vpe_all_api_h.h>
29 /* declare message handlers for each api */
31 #define vl_endianfun /* define message structures */
32 #include <vpp/api/vpe_all_api_h.h>
35 /* instantiate all the print functions we know about */
36 #define vl_print(handle, ...)
38 #include <vpp/api/vpe_all_api_h.h>
41 /* Satisfy external references when not linking with -lvlib */
42 vlib_main_t vlib_global_main;
43 vlib_main_t **vlib_mains;
47 svm_fifo_t *server_rx_fifo;
48 svm_fifo_t *server_tx_fifo;
50 u32 vpp_session_index;
51 u32 vpp_session_thread;
65 unix_shared_memory_queue_t *vl_input_queue;
67 /* API client handle */
70 /* The URI we're playing with */
76 /* Hash table for disconnect processing */
77 uword *session_index_by_vpp_handles;
79 /* intermediate rx buffer */
82 /* URI for slave's connect */
85 u32 connected_session_index;
89 /* drop all packets */
93 unix_shared_memory_queue_t *our_event_queue;
95 /* $$$ single thread only for the moment */
96 unix_shared_memory_queue_t *vpp_event_queue;
100 /* For deadman timers */
101 clib_time_t clib_time;
103 /* State of the connection, shared between msg RX thread and main thread */
104 volatile connection_state_t state;
106 /* Signal variables */
107 volatile int time_to_stop;
108 volatile int time_to_print_stats;
110 u32 configured_segment_size;
112 /* VNET_API_ERROR_FOO -> "Foo" hash table */
113 uword *error_string_by_error_number;
115 u8 *connect_test_data;
116 pthread_t client_rx_thread_handle;
117 u32 client_bytes_received;
118 u8 test_return_packets;
121 svm_fifo_segment_main_t *segment_main;
122 } uri_tcp_test_main_t;
124 uri_tcp_test_main_t uri_tcp_test_main;
129 #define NITER 4000000
133 wait_for_state_change (uri_tcp_test_main_t * utm, connection_state_t state)
136 #define TIMEOUT 600.0
138 #define TIMEOUT 600.0
141 f64 timeout = clib_time_now (&utm->clib_time) + TIMEOUT;
143 while (clib_time_now (&utm->clib_time) < timeout)
145 if (utm->state == state)
147 if (utm->state == STATE_FAILED)
150 clib_warning ("timeout waiting for STATE_READY");
155 init_error_string_table (uri_tcp_test_main_t * utm)
157 utm->error_string_by_error_number = hash_create (0, sizeof (uword));
159 #define _(n,v,s) hash_set (utm->error_string_by_error_number, -v, s);
160 foreach_vnet_api_error;
163 hash_set (utm->error_string_by_error_number, 99, "Misc");
167 stop_signal (int signum)
169 uri_tcp_test_main_t *um = &uri_tcp_test_main;
171 um->time_to_stop = 1;
175 stats_signal (int signum)
177 uri_tcp_test_main_t *um = &uri_tcp_test_main;
179 um->time_to_print_stats = 1;
182 static clib_error_t *
183 setup_signal_handlers (void)
185 signal (SIGINT, stats_signal);
186 signal (SIGQUIT, stop_signal);
187 signal (SIGTERM, stop_signal);
193 vlib_cli_output (struct vlib_main_t *vm, char *fmt, ...)
195 clib_warning ("BUG");
199 connect_to_vpp (char *name)
201 uri_tcp_test_main_t *utm = &uri_tcp_test_main;
202 api_main_t *am = &api_main;
204 if (vl_client_connect_to_vlib ("/vpe-api", name, 32) < 0)
207 utm->vl_input_queue = am->shmem_hdr->vl_input_queue;
208 utm->my_client_index = am->my_client_index;
214 vl_api_map_another_segment_t_handler (vl_api_map_another_segment_t * mp)
216 svm_fifo_segment_create_args_t _a, *a = &_a;
219 a->segment_name = (char *) mp->segment_name;
220 a->segment_size = mp->segment_size;
221 /* Attach to the segment vpp created */
222 rv = svm_fifo_segment_attach (a);
225 clib_warning ("svm_fifo_segment_attach ('%s') failed",
229 clib_warning ("Mapped new segment '%s' size %d", mp->segment_name,
234 vl_api_disconnect_session_t_handler (vl_api_disconnect_session_t * mp)
236 uri_tcp_test_main_t *utm = &uri_tcp_test_main;
238 vl_api_disconnect_session_reply_t *rmp;
243 key = (((u64) mp->session_thread_index) << 32) | (u64) mp->session_index;
245 p = hash_get (utm->session_index_by_vpp_handles, key);
249 session = pool_elt_at_index (utm->sessions, p[0]);
250 hash_unset (utm->session_index_by_vpp_handles, key);
251 pool_put (utm->sessions, session);
255 clib_warning ("couldn't find session key %llx", key);
259 utm->time_to_stop = 1;
261 rmp = vl_msg_api_alloc (sizeof (*rmp));
262 memset (rmp, 0, sizeof (*rmp));
264 rmp->_vl_msg_id = ntohs (VL_API_DISCONNECT_SESSION_REPLY);
266 rmp->session_index = mp->session_index;
267 rmp->session_thread_index = mp->session_thread_index;
268 vl_msg_api_send_shmem (utm->vl_input_queue, (u8 *) & rmp);
272 vl_api_reset_session_t_handler (vl_api_reset_session_t * mp)
274 uri_tcp_test_main_t *utm = &uri_tcp_test_main;
276 vl_api_reset_session_reply_t *rmp;
281 key = (((u64) mp->session_thread_index) << 32) | (u64) mp->session_index;
283 p = hash_get (utm->session_index_by_vpp_handles, key);
287 session = pool_elt_at_index (utm->sessions, p[0]);
288 hash_unset (utm->session_index_by_vpp_handles, key);
289 pool_put (utm->sessions, session);
293 clib_warning ("couldn't find session key %llx", key);
297 rmp = vl_msg_api_alloc (sizeof (*rmp));
298 memset (rmp, 0, sizeof (*rmp));
299 rmp->_vl_msg_id = ntohs (VL_API_DISCONNECT_SESSION_REPLY);
301 rmp->session_index = mp->session_index;
302 rmp->session_thread_index = mp->session_thread_index;
303 vl_msg_api_send_shmem (utm->vl_input_queue, (u8 *) & rmp);
307 client_handle_fifo_event_rx (uri_tcp_test_main_t * utm,
308 session_fifo_event_t * e)
311 int n_read, bytes, i;
315 bytes = e->enqueue_length;
318 n_read = svm_fifo_dequeue_nowait (rx_fifo, 0, vec_len (utm->rx_buf),
323 for (i = 0; i < n_read; i++)
325 if (utm->rx_buf[i] != ((utm->client_bytes_received + i) & 0xff))
327 clib_warning ("error at byte %lld, 0x%x not 0x%x",
328 utm->client_bytes_received + i,
330 ((utm->client_bytes_received + i) & 0xff));
333 utm->client_bytes_received += n_read;
337 while (n_read < 0 || bytes > 0);
341 client_handle_event_queue (uri_tcp_test_main_t * utm)
343 session_fifo_event_t _e, *e = &_e;;
345 unix_shared_memory_queue_sub (utm->our_event_queue, (u8 *) e,
347 switch (e->event_type)
349 case FIFO_EVENT_SERVER_RX:
350 client_handle_fifo_event_rx (utm, e);
353 case FIFO_EVENT_SERVER_EXIT:
357 clib_warning ("unknown event type %d", e->event_type);
363 client_rx_thread_fn (void *arg)
365 session_fifo_event_t _e, *e = &_e;
366 uri_tcp_test_main_t *utm = &uri_tcp_test_main;
368 utm->client_bytes_received = 0;
371 unix_shared_memory_queue_sub (utm->our_event_queue, (u8 *) e,
373 switch (e->event_type)
375 case FIFO_EVENT_SERVER_RX:
376 client_handle_fifo_event_rx (utm, e);
379 case FIFO_EVENT_SERVER_EXIT:
382 clib_warning ("unknown event type %d", e->event_type);
386 if (PREDICT_FALSE (utm->time_to_stop == 1))
394 vl_api_connect_uri_reply_t_handler (vl_api_connect_uri_reply_t * mp)
396 uri_tcp_test_main_t *utm = &uri_tcp_test_main;
397 svm_fifo_segment_create_args_t _a, *a = &_a;
400 svm_fifo_t *rx_fifo, *tx_fifo;
406 clib_warning ("connection failed with code: %d", mp->retval);
407 utm->state = STATE_FAILED;
415 if (mp->segment_name_length == 0)
417 clib_warning ("segment_name_length zero");
418 utm->state = STATE_FAILED;
422 a->segment_name = (char *) mp->segment_name;
423 a->segment_size = mp->segment_size;
425 ASSERT (mp->client_event_queue_address);
427 /* Attach to the segment vpp created */
428 rv = svm_fifo_segment_attach (a);
431 clib_warning ("svm_fifo_segment_attach ('%s') failed",
440 utm->our_event_queue = (unix_shared_memory_queue_t *)
441 mp->client_event_queue_address;
443 utm->vpp_event_queue = (unix_shared_memory_queue_t *)
444 mp->vpp_event_queue_address;
450 pool_get (utm->sessions, session);
451 session_index = session - utm->sessions;
453 rx_fifo = (svm_fifo_t *) mp->server_rx_fifo;
454 rx_fifo->client_session_index = session_index;
455 tx_fifo = (svm_fifo_t *) mp->server_tx_fifo;
456 tx_fifo->client_session_index = session_index;
458 session->server_rx_fifo = rx_fifo;
459 session->server_tx_fifo = tx_fifo;
460 session->vpp_session_index = mp->session_index;
461 session->vpp_session_thread = mp->session_thread_index;
464 utm->connected_session_index = session_index;
465 utm->state = STATE_READY;
467 /* Add it to lookup table */
468 key = (((u64) mp->session_thread_index) << 32) | (u64) mp->session_index;
469 hash_set (utm->session_index_by_vpp_handles, key, session_index);
471 /* Start RX thread */
472 rv = pthread_create (&utm->client_rx_thread_handle,
473 NULL /*attr */ , client_rx_thread_fn, 0);
476 clib_warning ("pthread_create returned %d", rv);
477 rv = VNET_API_ERROR_SYSCALL_ERROR_1;
482 client_send_data (uri_tcp_test_main_t * utm)
484 u8 *test_data = utm->connect_test_data;
487 int mypid = getpid ();
490 int buffer_offset, bytes_to_send = 0;
491 session_fifo_event_t evt;
492 static int serial_number = 0;
494 u32 max_chunk = 64 << 10, write;
496 session = pool_elt_at_index (utm->sessions, utm->connected_session_index);
497 tx_fifo = session->server_tx_fifo;
499 vec_validate (utm->rx_buf, vec_len (test_data) - 1);
501 for (i = 0; i < 1; i++)
503 bytes_to_send = vec_len (test_data);
505 while (bytes_to_send > 0)
507 write = bytes_to_send > max_chunk ? max_chunk : bytes_to_send;
508 rv = svm_fifo_enqueue_nowait (tx_fifo, mypid, write,
509 test_data + buffer_offset);
517 /* Fabricate TX event, send to vpp */
519 evt.event_type = FIFO_EVENT_SERVER_TX;
520 /* $$$$ for event logging */
521 evt.enqueue_length = rv;
522 evt.event_id = serial_number++;
524 unix_shared_memory_queue_add (utm->vpp_event_queue,
526 0 /* do wait for mutex */ );
531 if (utm->test_return_packets)
533 f64 timeout = clib_time_now (&utm->clib_time) + 2;
535 /* Wait for the outstanding packets */
536 while (utm->client_bytes_received < vec_len (test_data))
538 if (clib_time_now (&utm->clib_time) > timeout)
540 clib_warning ("timed out waiting for the missing packets");
545 utm->time_to_stop = 1;
550 client_connect (uri_tcp_test_main_t * utm)
552 vl_api_connect_uri_t *cmp;
553 cmp = vl_msg_api_alloc (sizeof (*cmp));
554 memset (cmp, 0, sizeof (*cmp));
556 cmp->_vl_msg_id = ntohs (VL_API_CONNECT_URI);
557 cmp->client_index = utm->my_client_index;
558 cmp->context = ntohl (0xfeedface);
559 memcpy (cmp->uri, utm->connect_uri, vec_len (utm->connect_uri));
560 vl_msg_api_send_shmem (utm->vl_input_queue, (u8 *) & cmp);
564 client_disconnect (uri_tcp_test_main_t * utm)
566 session_t *connected_session;
567 vl_api_disconnect_session_t *dmp;
568 connected_session = pool_elt_at_index (utm->sessions,
569 utm->connected_session_index);
570 dmp = vl_msg_api_alloc (sizeof (*dmp));
571 memset (dmp, 0, sizeof (*dmp));
572 dmp->_vl_msg_id = ntohs (VL_API_DISCONNECT_SESSION);
573 dmp->client_index = utm->my_client_index;
574 dmp->session_index = connected_session->vpp_session_index;
575 dmp->session_thread_index = connected_session->vpp_session_thread;
576 vl_msg_api_send_shmem (utm->vl_input_queue, (u8 *) & dmp);
580 client_test (uri_tcp_test_main_t * utm)
584 client_connect (utm);
586 if (wait_for_state_change (utm, STATE_READY))
592 vec_validate (utm->connect_test_data, 64 * 1024 - 1);
593 for (i = 0; i < vec_len (utm->connect_test_data); i++)
594 utm->connect_test_data[i] = i & 0xff;
597 client_send_data (utm);
600 client_disconnect (utm);
604 vl_api_bind_uri_reply_t_handler (vl_api_bind_uri_reply_t * mp)
606 uri_tcp_test_main_t *utm = &uri_tcp_test_main;
607 svm_fifo_segment_create_args_t _a, *a = &_a;
612 clib_warning ("bind failed: %d", mp->retval);
613 utm->state = STATE_FAILED;
617 if (mp->segment_name_length == 0)
619 clib_warning ("segment_name_length zero");
623 a->segment_name = (char *) mp->segment_name;
624 a->segment_size = mp->segment_size;
626 ASSERT (mp->server_event_queue_address);
628 /* Attach to the segment vpp created */
629 rv = svm_fifo_segment_attach (a);
632 clib_warning ("svm_fifo_segment_attach ('%s') failed",
637 utm->our_event_queue =
638 (unix_shared_memory_queue_t *) mp->server_event_queue_address;
640 utm->state = STATE_READY;
644 vl_api_unbind_uri_reply_t_handler (vl_api_unbind_uri_reply_t * mp)
646 uri_tcp_test_main_t *utm = &uri_tcp_test_main;
649 clib_warning ("returned %d", ntohl (mp->retval));
651 utm->state = STATE_START;
655 vl_api_accept_session_t_handler (vl_api_accept_session_t * mp)
657 uri_tcp_test_main_t *utm = &uri_tcp_test_main;
658 vl_api_accept_session_reply_t *rmp;
659 svm_fifo_t *rx_fifo, *tx_fifo;
661 static f64 start_time;
665 if (start_time == 0.0)
666 start_time = clib_time_now (&utm->clib_time);
668 utm->vpp_event_queue = (unix_shared_memory_queue_t *)
669 mp->vpp_event_queue_address;
671 /* Allocate local session and set it up */
672 pool_get (utm->sessions, session);
673 session_index = session - utm->sessions;
675 rx_fifo = (svm_fifo_t *) mp->server_rx_fifo;
676 rx_fifo->client_session_index = session_index;
677 tx_fifo = (svm_fifo_t *) mp->server_tx_fifo;
678 tx_fifo->client_session_index = session_index;
680 session->server_rx_fifo = rx_fifo;
681 session->server_tx_fifo = tx_fifo;
683 /* Add it to lookup table */
684 key = (((u64) mp->session_thread_index) << 32) | (u64) mp->session_index;
685 hash_set (utm->session_index_by_vpp_handles, key, session_index);
687 utm->state = STATE_READY;
690 if (pool_elts (utm->sessions) && (pool_elts (utm->sessions) % 20000) == 0)
692 f64 now = clib_time_now (&utm->clib_time);
693 fformat (stdout, "%d active sessions in %.2f seconds, %.2f/sec...\n",
694 pool_elts (utm->sessions), now - start_time,
695 (f64) pool_elts (utm->sessions) / (now - start_time));
699 * Send accept reply to vpp
701 rmp = vl_msg_api_alloc (sizeof (*rmp));
702 memset (rmp, 0, sizeof (*rmp));
703 rmp->_vl_msg_id = ntohs (VL_API_ACCEPT_SESSION_REPLY);
704 rmp->session_type = mp->session_type;
705 rmp->session_index = mp->session_index;
706 rmp->session_thread_index = mp->session_thread_index;
707 vl_msg_api_send_shmem (utm->vl_input_queue, (u8 *) & rmp);
711 server_handle_fifo_event_rx (uri_tcp_test_main_t * utm,
712 session_fifo_event_t * e)
714 svm_fifo_t *rx_fifo, *tx_fifo;
717 session_fifo_event_t evt;
718 unix_shared_memory_queue_t *q;
722 tx_fifo = utm->sessions[rx_fifo->client_session_index].server_tx_fifo;
724 bytes = e->enqueue_length;
727 n_read = svm_fifo_dequeue_nowait (rx_fifo, 0, vec_len (utm->rx_buf),
730 /* Reflect if a non-drop session */
731 if (!utm->drop_packets && n_read > 0)
735 rv = svm_fifo_enqueue_nowait (tx_fifo, 0, n_read, utm->rx_buf);
739 /* Fabricate TX event, send to vpp */
741 evt.event_type = FIFO_EVENT_SERVER_TX;
742 /* $$$$ for event logging */
743 evt.enqueue_length = n_read;
744 evt.event_id = e->event_id;
745 q = utm->vpp_event_queue;
746 unix_shared_memory_queue_add (q, (u8 *) & evt,
747 0 /* do wait for mutex */ );
753 while (n_read < 0 || bytes > 0);
757 server_handle_event_queue (uri_tcp_test_main_t * utm)
759 session_fifo_event_t _e, *e = &_e;;
763 unix_shared_memory_queue_sub (utm->our_event_queue, (u8 *) e,
765 switch (e->event_type)
767 case FIFO_EVENT_SERVER_RX:
768 server_handle_fifo_event_rx (utm, e);
771 case FIFO_EVENT_SERVER_EXIT:
775 clib_warning ("unknown event type %d", e->event_type);
778 if (PREDICT_FALSE (utm->time_to_stop == 1))
780 if (PREDICT_FALSE (utm->time_to_print_stats == 1))
782 utm->time_to_print_stats = 0;
783 fformat (stdout, "%d connections\n", pool_elts (utm->sessions));
789 server_bind (uri_tcp_test_main_t * utm)
791 vl_api_bind_uri_t *bmp;
792 u32 fifo_size = 3 << 20;
793 bmp = vl_msg_api_alloc (sizeof (*bmp));
794 memset (bmp, 0, sizeof (*bmp));
796 bmp->_vl_msg_id = ntohs (VL_API_BIND_URI);
797 bmp->client_index = utm->my_client_index;
798 bmp->context = ntohl (0xfeedface);
799 bmp->initial_segment_size = 256 << 20; /* size of initial segment */
800 bmp->options[SESSION_OPTIONS_FLAGS] =
801 SESSION_OPTIONS_FLAGS_USE_FIFO | SESSION_OPTIONS_FLAGS_ADD_SEGMENT;
802 bmp->options[SESSION_OPTIONS_RX_FIFO_SIZE] = fifo_size;
803 bmp->options[SESSION_OPTIONS_TX_FIFO_SIZE] = fifo_size;
804 bmp->options[SESSION_OPTIONS_ADD_SEGMENT_SIZE] = 128 << 20;
805 memcpy (bmp->uri, utm->uri, vec_len (utm->uri));
806 vl_msg_api_send_shmem (utm->vl_input_queue, (u8 *) & bmp);
810 server_unbind (uri_tcp_test_main_t * utm)
812 vl_api_unbind_uri_t *ump;
814 ump = vl_msg_api_alloc (sizeof (*ump));
815 memset (ump, 0, sizeof (*ump));
817 ump->_vl_msg_id = ntohs (VL_API_UNBIND_URI);
818 ump->client_index = utm->my_client_index;
819 memcpy (ump->uri, utm->uri, vec_len (utm->uri));
820 vl_msg_api_send_shmem (utm->vl_input_queue, (u8 *) & ump);
824 server_test (uri_tcp_test_main_t * utm)
829 if (wait_for_state_change (utm, STATE_READY))
831 clib_warning ("timeout waiting for STATE_READY");
835 /* Enter handle event loop */
836 server_handle_event_queue (utm);
841 if (wait_for_state_change (utm, STATE_START))
843 clib_warning ("timeout waiting for STATE_START");
847 fformat (stdout, "Test complete...\n");
850 #define foreach_uri_msg \
851 _(BIND_URI_REPLY, bind_uri_reply) \
852 _(UNBIND_URI_REPLY, unbind_uri_reply) \
853 _(ACCEPT_SESSION, accept_session) \
854 _(CONNECT_URI_REPLY, connect_uri_reply) \
855 _(DISCONNECT_SESSION, disconnect_session) \
856 _(RESET_SESSION, reset_session) \
857 _(MAP_ANOTHER_SEGMENT, map_another_segment)
860 uri_api_hookup (uri_tcp_test_main_t * utm)
863 vl_msg_api_set_handlers(VL_API_##N, #n, \
864 vl_api_##n##_t_handler, \
866 vl_api_##n##_t_endian, \
867 vl_api_##n##_t_print, \
868 sizeof(vl_api_##n##_t), 1);
874 main (int argc, char **argv)
876 uri_tcp_test_main_t *utm = &uri_tcp_test_main;
877 unformat_input_t _argv, *a = &_argv;
880 u8 *bind_name = (u8 *) "tcp://0.0.0.0/1234";
885 int i_am_master = 1, drop_packets = 0, test_return_packets = 0;
887 clib_mem_init (0, 256 << 20);
889 heap = clib_mem_get_per_cpu_heap ();
890 h = mheap_header (heap);
892 /* make the main heap thread-safe */
893 h->flags |= MHEAP_FLAG_THREAD_SAFE;
895 vec_validate (utm->rx_buf, 65536);
897 utm->session_index_by_vpp_handles = hash_create (0, sizeof (uword));
899 utm->my_pid = getpid ();
900 utm->configured_segment_size = 1 << 20;
902 clib_time_init (&utm->clib_time);
903 init_error_string_table (utm);
904 svm_fifo_segment_init (0x200000000ULL, 20);
905 unformat_init_command_line (a, argv);
907 while (unformat_check_input (a) != UNFORMAT_END_OF_INPUT)
909 if (unformat (a, "chroot prefix %s", &chroot_prefix))
911 vl_set_memory_root_path ((char *) chroot_prefix);
913 else if (unformat (a, "uri %s", &bind_name))
915 else if (unformat (a, "segment-size %dM", &tmp))
916 utm->configured_segment_size = tmp << 20;
917 else if (unformat (a, "segment-size %dG", &tmp))
918 utm->configured_segment_size = tmp << 30;
919 else if (unformat (a, "master"))
921 else if (unformat (a, "slave"))
923 else if (unformat (a, "drop"))
925 else if (unformat (a, "test"))
926 test_return_packets = 1;
929 fformat (stderr, "%s: usage [master|slave]\n");
934 utm->uri = format (0, "%s%c", bind_name, 0);
935 utm->i_am_master = i_am_master;
936 utm->segment_main = &svm_fifo_segment_main;
937 utm->drop_packets = drop_packets;
938 utm->test_return_packets = test_return_packets;
939 utm->connect_uri = format (0, "tcp://6.0.1.2/1234%c", 0);
941 setup_signal_handlers ();
942 uri_api_hookup (utm);
944 if (connect_to_vpp (i_am_master ? "uri_tcp_server" : "uri_tcp_client") < 0)
947 fformat (stderr, "Couldn't connect to vpe, exiting...\n");
951 if (i_am_master == 0)
957 /* $$$$ hack preallocation */
958 for (i = 0; i < 200000; i++)
960 pool_get (utm->sessions, session);
961 memset (session, 0, sizeof (*session));
963 for (i = 0; i < 200000; i++)
964 pool_put_index (utm->sessions, i);
968 vl_client_disconnect_from_vlib ();
973 * fd.io coding-style-patch-verification: ON
976 * eval: (c-set-style "gnu")