From f98e59b86d886ad819e98e88b672dbd7c9560edf Mon Sep 17 00:00:00 2001 From: Nathan Skrzypczak Date: Fri, 6 Dec 2019 14:44:25 +0100 Subject: hsa: Add option for multiple ips Type: feature Change-Id: I133f12f9075a09bda0c5c1ed143d03838b33f6da Signed-off-by: Nathan Skrzypczak --- src/plugins/hs_apps/sapi/vpp_echo_common.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'src/plugins/hs_apps/sapi/vpp_echo_common.c') 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; -- cgit 1.2.3-korg