summaryrefslogtreecommitdiffstats
path: root/src/tests/vnet/session/udp_echo.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2018-01-15 01:08:33 -0800
committerDave Barach <openvpp@barachs.net>2018-01-25 23:53:35 +0000
commitb384b543313b6b47a277c903e9d4fcd4343054fa (patch)
tree1996e3a25eb3a32fe5bbc405d75f38dd041a5a40 /src/tests/vnet/session/udp_echo.c
parent4e578068fc3fe8ba176d211123ddd88962dab315 (diff)
session: add support for memfd segments
- update segment manager and session api to work with both flavors of ssvm segments - added generic ssvm slave/master init and del functions - cleanup/refactor tcp_echo - fixed uses of svm fifo pool as vector Change-Id: Ieee8b163faa407da6e77e657a2322de213a9d2a0 Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/tests/vnet/session/udp_echo.c')
-rw-r--r--src/tests/vnet/session/udp_echo.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/src/tests/vnet/session/udp_echo.c b/src/tests/vnet/session/udp_echo.c
index 07e72376732..e92bf4067ea 100644
--- a/src/tests/vnet/session/udp_echo.c
+++ b/src/tests/vnet/session/udp_echo.c
@@ -851,7 +851,7 @@ vl_api_connect_session_reply_t_handler (vl_api_connect_session_reply_t * mp)
utm->state = STATE_READY;
}
-#define foreach_uri_msg \
+#define foreach_tcp_echo_msg \
_(BIND_URI_REPLY, bind_uri_reply) \
_(CONNECT_URI, connect_uri) \
_(CONNECT_SESSION_REPLY, connect_session_reply) \
@@ -863,7 +863,7 @@ _(APPLICATION_ATTACH_REPLY, application_attach_reply) \
_(APPLICATION_DETACH_REPLY, application_detach_reply) \
void
-uri_api_hookup (uri_udp_test_main_t * utm)
+tcp_echo_api_hookup (uri_udp_test_main_t * utm)
{
#define _(N,n) \
vl_msg_api_set_handlers(VL_API_##N, #n, \
@@ -872,7 +872,7 @@ uri_api_hookup (uri_udp_test_main_t * utm)
vl_api_##n##_t_endian, \
vl_api_##n##_t_print, \
sizeof(vl_api_##n##_t), 1);
- foreach_uri_msg;
+ foreach_tcp_echo_msg;
#undef _
}
@@ -1044,15 +1044,16 @@ int
main (int argc, char **argv)
{
uri_udp_test_main_t *utm = &uri_udp_test_main;
+ u8 *bind_name = (u8 *) "udp://0.0.0.0/1234";
unformat_input_t _argv, *a = &_argv;
+ int i_am_master = 1;
+ session_t *session;
u8 *chroot_prefix;
+ char *app_name;
+ mheap_t *h;
u8 *heap;
- u8 *bind_name = (u8 *) "udp://0.0.0.0/1234";
u32 tmp;
- mheap_t *h;
- session_t *session;
int i;
- int i_am_master = 1;
clib_mem_init (0, 256 << 20);
@@ -1065,7 +1066,6 @@ main (int argc, char **argv)
vec_validate (utm->rx_buf, 8192);
utm->session_index_by_vpp_handles = hash_create (0, sizeof (uword));
-
utm->my_pid = getpid ();
utm->configured_segment_size = 1 << 20;
@@ -1101,14 +1101,13 @@ main (int argc, char **argv)
utm->uri = format (0, "%s%c", bind_name, 0);
utm->i_am_master = i_am_master;
utm->segment_main = &svm_fifo_segment_main;
-
utm->connect_uri = format (0, "udp://6.0.1.2/1234%c", 0);
setup_signal_handlers ();
+ tcp_echo_api_hookup (utm);
- uri_api_hookup (utm);
-
- if (connect_to_vpp (i_am_master ? "uri_udp_master" : "uri_udp_slave") < 0)
+ app_name = i_am_master ? "udp_echo_master" : "udp_echo_slave";
+ if (connect_to_vpp (app_name) < 0)
{
svm_region_exit ();
fformat (stderr, "Couldn't connect to vpe, exiting...\n");