if (table_id != 0)
{
ip_table_create (FIB_PROTOCOL_IP4, table_id, 0, 0);
- ip_table_bind (FIB_PROTOCOL_IP4, *sw_if_index, table_id, 0);
+ ip_table_bind (FIB_PROTOCOL_IP4, *sw_if_index, table_id);
}
vnet_sw_interface_set_flags (vnet_get_main (), *sw_if_index,
attach_args.name = format (0, "session_test_server");
attach_args.namespace_id = appns_id;
+ /* Allow server to allocate another segment for listens. Needed
+ * because by default we do not allow segment additions */
+ attach_args.options[APP_OPTIONS_ADD_SEGMENT_SIZE] = 32 << 20;
attach_args.options[APP_OPTIONS_NAMESPACE_SECRET] = placeholder_secret;
error = vnet_application_attach (&attach_args);
SESSION_TEST ((error == 0), "server app attached: %U", format_clib_error,
detach_args.app_index = client_index;
vnet_application_detach (&detach_args);
+ ns_args.is_add = 0;
+ error = vnet_app_namespace_add_del (&ns_args);
+ SESSION_TEST ((error == 0), "app ns delete should succeed: %d", error);
+
/* Allow the disconnects to finish before removing the routes. */
vlib_process_suspend (vm, 10e-3);
SESSION_TEST ((error == 0), "client connect should not return error code");
/* wait for accept */
- if (vlib_num_workers ())
+ tries = 0;
+ while (!placeholder_accept && ++tries < 100)
{
- tries = 0;
- while (!placeholder_accept && ++tries < 100)
- {
- vlib_worker_thread_barrier_release (vm);
- vlib_process_suspend (vm, 100e-3);
- vlib_worker_thread_barrier_sync (vm);
- }
+ vlib_worker_thread_barrier_release (vm);
+ vlib_process_suspend (vm, 100e-3);
+ vlib_worker_thread_barrier_sync (vm);
}
SESSION_TEST ((placeholder_segment_count == 1),
detach_args.app_index = server_index;
vnet_application_detach (&detach_args);
+ ns_args.is_add = 0;
+ error = vnet_app_namespace_add_del (&ns_args);
+ SESSION_TEST ((error == 0), "app ns delete should succeed: %d", error);
+
/*
* Cleanup
*/
detach_args.app_index = server_index2;
vnet_application_detach (&detach_args);
+ ns_args.is_add = 0;
+ error = vnet_app_namespace_add_del (&ns_args);
+ SESSION_TEST ((error == 0), "app ns delete should succeed: %d", error);
+
vec_free (ns_id);
vec_free (attach_args.name);
return 0;
{
if (!use_eventfd)
{
- svm_msg_q_lock (mq);
- while (svm_msg_q_is_empty (mq))
- svm_msg_q_wait (mq);
+ svm_msg_q_wait (mq, SVM_MQ_WAIT_EMPTY);
}
else
{
continue;
if (!svm_msg_q_is_empty (mq))
- {
- svm_msg_q_lock (mq);
- break;
- }
+ break;
}
}
}
mq = app_wrk->event_queue;
if (use_eventfd)
{
- svm_msg_q_alloc_producer_eventfd (mq);
- svm_msg_q_alloc_consumer_eventfd (mq);
- prod_fd = svm_msg_q_get_producer_eventfd (mq);
+ svm_msg_q_alloc_eventfd (mq);
+ prod_fd = svm_msg_q_get_eventfd (mq);
SESSION_TEST (prod_fd != -1, "mq producer eventd valid %u", prod_fd);
}
- sm = app_worker_get_or_alloc_connect_segment_manager (app_wrk);
+ sm = app_worker_get_connect_segment_manager (app_wrk);
segment_manager_alloc_session_fifos (sm, 0, &rx_fifo, &tx_fifo);
s.rx_fifo = rx_fifo;
s.tx_fifo = tx_fifo;
for (i = 0; i < n_test_msgs; i++)
{
wait_for_event (mq, prod_fd, epfd, use_eventfd);
- svm_msg_q_sub_w_lock (mq, &msg);
+ svm_msg_q_sub_raw (mq, &msg);
svm_msg_q_free_msg (mq, &msg);
svm_msg_q_unlock (mq);
*counter = *counter + 1;