From a0e8d9669e980c673f5302e7bff0c06b31d46b56 Mon Sep 17 00:00:00 2001 From: Steven Luong Date: Mon, 18 May 2020 17:12:56 -0700 Subject: virtio: add vhost sw_if_index filter for sw_interface_vhost_user_dump The filter sw_if_index was in the API sw_interface_vhost_user_dump. But it was never implemented in the backend. This patch is to add the backend, vat, and custom dump support for the filter. Type: feature Signed-off-by: Steven Luong Change-Id: Iaa41a7e11bfbcbb4c60092375e4b0dcf0950077b --- src/vat/api_format.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'src/vat/api_format.c') diff --git a/src/vat/api_format.c b/src/vat/api_format.c index 60cfa504480..a3a67c1eb57 100644 --- a/src/vat/api_format.c +++ b/src/vat/api_format.c @@ -12675,15 +12675,28 @@ static void vl_api_sw_interface_vhost_user_details_t_handler_json static int api_sw_interface_vhost_user_dump (vat_main_t * vam) { + unformat_input_t *i = vam->input; vl_api_sw_interface_vhost_user_dump_t *mp; vl_api_control_ping_t *mp_ping; int ret; + u32 sw_if_index = ~0; + + while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) + { + if (unformat (i, "%U", api_unformat_sw_if_index, vam, &sw_if_index)) + ; + else if (unformat (i, "sw_if_index %d", &sw_if_index)) + ; + else + break; + } + print (vam->ofp, "Interface name idx hdr_sz features server regions filename"); /* Get list of vhost-user interfaces */ M (SW_INTERFACE_VHOST_USER_DUMP, mp); - mp->sw_if_index = ntohl (~0); + mp->sw_if_index = ntohl (sw_if_index); S (mp); /* Use a control ping for synchronization */ @@ -20729,7 +20742,7 @@ _(modify_vhost_user_if, \ " | sw_if_index socket \n" \ "[server] [renumber ] [gso] [packed]") \ _(delete_vhost_user_if, " | sw_if_index ") \ -_(sw_interface_vhost_user_dump, "") \ +_(sw_interface_vhost_user_dump, " | sw_if_index ") \ _(show_version, "") \ _(show_threads, "") \ _(vxlan_gpe_add_del_tunnel, \ -- cgit 1.2.3-korg