aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/devices/virtio/vhost_user_api.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2018-01-09 06:39:23 -0800
committerDave Barach <openvpp@barachs.net>2018-01-11 19:46:01 +0000
commit6c4dae27e75fc668f86c9cca0f3f58273b680621 (patch)
tree88c2adee0a2eb2c5e48471da2ef010e46cc270ab /src/vnet/devices/virtio/vhost_user_api.c
parentf72212e00282712f5829a7f76a8cb6f486cdae60 (diff)
api: remove transport specific code from handlers
This does not update api client code. In other words, if the client assumes the transport is shmem based, this patch does not change that. Furthermore, code that checks queue size, for tail dropping, is not updated. Done for the following apis: Plugins - acl - gtpu - memif - nat - pppoe VNET - bfd - bier - tapv2 - vhost user - dhcp - flow - geneve - ip - punt - ipsec/ipsec-gre - l2 - l2tp - lisp-cp/one-cp - lisp-gpe - map - mpls - policer - session - span - udp - tap - vxlan/vxlan-gpe - interface VPP - api/api.c OAM - oam_api.c Stats - stats.c Change-Id: I0e33ecefb2bdab0295698c0add948068a5a83345 Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/devices/virtio/vhost_user_api.c')
-rw-r--r--src/vnet/devices/virtio/vhost_user_api.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/vnet/devices/virtio/vhost_user_api.c b/src/vnet/devices/virtio/vhost_user_api.c
index 9ddd3387a72..442d9146945 100644
--- a/src/vnet/devices/virtio/vhost_user_api.c
+++ b/src/vnet/devices/virtio/vhost_user_api.c
@@ -53,7 +53,7 @@ _(SW_INTERFACE_VHOST_USER_DUMP, sw_interface_vhost_user_dump)
*/
static void
send_sw_interface_event_deleted (vpe_api_main_t * am,
- svm_queue_t * q, u32 sw_if_index)
+ vl_api_registration_t * reg, u32 sw_if_index)
{
vl_api_sw_interface_event_t *mp;
@@ -65,7 +65,7 @@ send_sw_interface_event_deleted (vpe_api_main_t * am,
mp->admin_up_down = 0;
mp->link_up_down = 0;
mp->deleted = 1;
- vl_msg_api_send_shmem (q, (u8 *) & mp);
+ vl_api_send_msg (reg, (u8 *) mp);
}
static void
@@ -127,6 +127,7 @@ vl_api_delete_vhost_user_if_t_handler (vl_api_delete_vhost_user_if_t * mp)
vl_api_delete_vhost_user_if_reply_t *rmp;
vpe_api_main_t *vam = &vpe_api_main;
u32 sw_if_index = ntohl (mp->sw_if_index);
+ vl_api_registration_t *reg;
vnet_main_t *vnm = vnet_get_main ();
vlib_main_t *vm = vlib_get_main ();
@@ -136,18 +137,18 @@ vl_api_delete_vhost_user_if_t_handler (vl_api_delete_vhost_user_if_t * mp)
REPLY_MACRO (VL_API_DELETE_VHOST_USER_IF_REPLY);
if (!rv)
{
- svm_queue_t *q = vl_api_client_index_to_input_queue (mp->client_index);
- if (!q)
+ reg = vl_api_client_index_to_registration (mp->client_index);
+ if (!reg)
return;
vnet_clear_sw_interface_tag (vnm, sw_if_index);
- send_sw_interface_event_deleted (vam, q, sw_if_index);
+ send_sw_interface_event_deleted (vam, reg, sw_if_index);
}
}
static void
send_sw_interface_vhost_user_details (vpe_api_main_t * am,
- svm_queue_t * q,
+ vl_api_registration_t * reg,
vhost_user_intf_details_t * vui,
u32 context)
{
@@ -169,7 +170,7 @@ send_sw_interface_vhost_user_details (vpe_api_main_t * am,
strncpy ((char *) mp->interface_name,
(char *) vui->if_name, ARRAY_LEN (mp->interface_name) - 1);
- vl_msg_api_send_shmem (q, (u8 *) & mp);
+ vl_api_send_msg (reg, (u8 *) mp);
}
static void
@@ -182,10 +183,10 @@ static void
vlib_main_t *vm = vlib_get_main ();
vhost_user_intf_details_t *ifaces = NULL;
vhost_user_intf_details_t *vuid = NULL;
- svm_queue_t *q;
+ vl_api_registration_t *reg;
- q = vl_api_client_index_to_input_queue (mp->client_index);
- if (q == 0)
+ reg = vl_api_client_index_to_registration (mp->client_index);
+ if (!reg)
return;
rv = vhost_user_dump_ifs (vnm, vm, &ifaces);
@@ -194,7 +195,7 @@ static void
vec_foreach (vuid, ifaces)
{
- send_sw_interface_vhost_user_details (am, q, vuid, mp->context);
+ send_sw_interface_vhost_user_details (am, reg, vuid, mp->context);
}
vec_free (ifaces);
}