Code Review
/
vpp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
session: segment manager refactor
[vpp.git]
/
src
/
tests
/
vnet
/
session
/
udp_echo.c
diff --git
a/src/tests/vnet/session/udp_echo.c
b/src/tests/vnet/session/udp_echo.c
index
4e17a17
..
e425169
100644
(file)
--- a/
src/tests/vnet/session/udp_echo.c
+++ b/
src/tests/vnet/session/udp_echo.c
@@
-202,7
+202,7
@@
vl_api_application_attach_reply_t_handler (vl_api_application_attach_reply_t *
mp)
{
uri_udp_test_main_t *utm = &uri_udp_test_main;
mp)
{
uri_udp_test_main_t *utm = &uri_udp_test_main;
- svm_fifo_segment_create_args_t _a, *a = &_a;
+ svm_fifo_segment_create_args_t _a
= { 0 }
, *a = &_a;
int rv;
if (mp->retval)
int rv;
if (mp->retval)
@@
-851,7
+851,7
@@
vl_api_connect_session_reply_t_handler (vl_api_connect_session_reply_t * mp)
utm->state = STATE_READY;
}
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) \
_(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
_(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, \
{
#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);
vl_api_##n##_t_endian, \
vl_api_##n##_t_print, \
sizeof(vl_api_##n##_t), 1);
- foreach_
uri
_msg;
+ foreach_
tcp_echo
_msg;
#undef _
}
#undef _
}
@@
-956,7
+956,7
@@
server_handle_event_queue (uri_udp_test_main_t * utm)
while (1)
{
while (1)
{
- svm_queue_sub (utm->our_event_queue, (u8 *) e,
0 /* nowait */
);
+ svm_queue_sub (utm->our_event_queue, (u8 *) e,
SVM_Q_WAIT, 0
);
switch (e->event_type)
{
case FIFO_EVENT_APP_RX:
switch (e->event_type)
{
case FIFO_EVENT_APP_RX:
@@
-1044,15
+1044,16
@@
int
main (int argc, char **argv)
{
uri_udp_test_main_t *utm = &uri_udp_test_main;
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;
unformat_input_t _argv, *a = &_argv;
+ int i_am_master = 1;
+ session_t *session;
u8 *chroot_prefix;
u8 *chroot_prefix;
+ char *app_name;
+ mheap_t *h;
u8 *heap;
u8 *heap;
- u8 *bind_name = (u8 *) "udp://0.0.0.0/1234";
u32 tmp;
u32 tmp;
- mheap_t *h;
- session_t *session;
int i;
int i;
- int i_am_master = 1;
clib_mem_init (0, 256 << 20);
clib_mem_init (0, 256 << 20);
@@
-1065,13
+1066,12
@@
main (int argc, char **argv)
vec_validate (utm->rx_buf, 8192);
utm->session_index_by_vpp_handles = hash_create (0, sizeof (uword));
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;
clib_time_init (&utm->clib_time);
init_error_string_table (utm);
utm->my_pid = getpid ();
utm->configured_segment_size = 1 << 20;
clib_time_init (&utm->clib_time);
init_error_string_table (utm);
- svm_fifo_segment_init (0x200000000ULL, 20);
+ svm_fifo_segment_
main_
init (0x200000000ULL, 20);
unformat_init_command_line (a, argv);
while (unformat_check_input (a) != UNFORMAT_END_OF_INPUT)
unformat_init_command_line (a, argv);
while (unformat_check_input (a) != UNFORMAT_END_OF_INPUT)
@@
-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->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 ();
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");
{
svm_region_exit ();
fformat (stderr, "Couldn't connect to vpe, exiting...\n");