X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fplugins%2Fhs_apps%2Fsapi%2Fvpp_echo_common.c;h=e7829f3ab890e7f5fda6e0b991c0aef83a455c7d;hb=f98e59b86d886ad819e98e88b672dbd7c9560edf;hp=a5bdeb4f27bc0d0289567bc6782b8490c717546a;hpb=038c7e662a8673f13ed12310a450ff646e825824;p=vpp.git diff --git a/src/plugins/hs_apps/sapi/vpp_echo_common.c b/src/plugins/hs_apps/sapi/vpp_echo_common.c index a5bdeb4f27b..e7829f3ab89 100644 --- a/src/plugins/hs_apps/sapi/vpp_echo_common.c +++ b/src/plugins/hs_apps/sapi/vpp_echo_common.c @@ -457,6 +457,20 @@ unformat_ip6_address (unformat_input_t * input, va_list * args) } } +uword +unformat_ip46_address (unformat_input_t * input, va_list * args) +{ + ip46_address_t *ip = va_arg (*args, ip46_address_t *); + + if (unformat (input, "%U", unformat_ip4_address, &ip->ip4)) + ; + else if (unformat (input, "%U", unformat_ip6_address, &ip->ip6)) + ; + else + return 0; + return 1; +} + u8 * echo_format_crypto_engine (u8 * s, va_list * args) { @@ -517,14 +531,15 @@ echo_session_handle_add_del (echo_main_t * em, u64 handle, u32 sid) echo_session_t * echo_session_new (echo_main_t * em) { - /* thread safe new prealloced session */ + /* thread safe new prealloced session + * see echo_session_prealloc */ return pool_elt_at_index (em->sessions, clib_atomic_fetch_add (&em->nxt_available_sidx, 1)); } int -echo_send_rpc (echo_main_t * em, void *fp, void *arg, u32 opaque) +echo_send_rpc (echo_main_t * em, void *fp, echo_rpc_args_t * args) { svm_msg_q_msg_t msg; echo_rpc_msg_t *evt; @@ -541,9 +556,8 @@ echo_send_rpc (echo_main_t * em, void *fp, void *arg, u32 opaque) } msg = svm_msg_q_alloc_msg_w_ring (em->rpc_msq_queue, 0); evt = (echo_rpc_msg_t *) svm_msg_q_msg_data (em->rpc_msq_queue, &msg); - evt->arg = arg; - evt->opaque = opaque; evt->fp = fp; + clib_memcpy (&evt->args, args, sizeof (evt->args)); svm_msg_q_add_and_unlock (em->rpc_msq_queue, &msg); return 0;