aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/devices/virtio/vhost_user_api.c
diff options
context:
space:
mode:
authorSteven <sluong@cisco.com>2017-03-08 00:23:13 -0800
committerDamjan Marion <dmarion.lists@gmail.com>2017-03-08 18:11:04 +0000
commita1a0901daa6f56039caecbe58e7d7062a145fc98 (patch)
treea48779fe1982a856a5fce36e05489bac1827f1cf /src/vnet/devices/virtio/vhost_user_api.c
parentc6ec8f39240a166a7e04a7834a28107b6353b46a (diff)
vhost: binary API changes for interrupt mode
Add operation_mode for create_vhost_user_if, modify_vhost_user_if, and sw_interface_vhost_user_details. Only polling mode is supported for these APIs. Other mode is rejected and gets VNET_API_ERROR_UNIMPLEMENTED error. Change-Id: I0596f4e2c087aa2b6f78eb3e0b63910b1859641e Signed-off-by: Steven <sluong@cisco.com>
Diffstat (limited to 'src/vnet/devices/virtio/vhost_user_api.c')
-rw-r--r--src/vnet/devices/virtio/vhost_user_api.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/vnet/devices/virtio/vhost_user_api.c b/src/vnet/devices/virtio/vhost_user_api.c
index 8dbd032b117..ac7afa611b6 100644
--- a/src/vnet/devices/virtio/vhost_user_api.c
+++ b/src/vnet/devices/virtio/vhost_user_api.c
@@ -81,7 +81,8 @@ vl_api_create_vhost_user_if_t_handler (vl_api_create_vhost_user_if_t * mp)
rv = vhost_user_create_if (vnm, vm, (char *) mp->sock_filename,
mp->is_server, &sw_if_index, (u64) ~ 0,
mp->renumber, ntohl (mp->custom_dev_instance),
- (mp->use_custom_mac) ? mp->mac_address : NULL);
+ (mp->use_custom_mac) ? mp->mac_address : NULL,
+ mp->operation_mode);
/* Remember an interface tag for the new interface */
if (rv == 0)
@@ -116,7 +117,8 @@ vl_api_modify_vhost_user_if_t_handler (vl_api_modify_vhost_user_if_t * mp)
rv = vhost_user_modify_if (vnm, vm, (char *) mp->sock_filename,
mp->is_server, sw_if_index, (u64) ~ 0,
- mp->renumber, ntohl (mp->custom_dev_instance));
+ mp->renumber, ntohl (mp->custom_dev_instance),
+ mp->operation_mode);
REPLY_MACRO (VL_API_MODIFY_VHOST_USER_IF_REPLY);
}
@@ -162,6 +164,7 @@ send_sw_interface_vhost_user_details (vpe_api_main_t * am,
mp->virtio_net_hdr_sz = ntohl (vui->virtio_net_hdr_sz);
mp->features = clib_net_to_host_u64 (vui->features);
mp->is_server = vui->is_server;
+ mp->operation_mode = vui->operation_mode;
mp->num_regions = ntohl (vui->num_regions);
mp->sock_errno = ntohl (vui->sock_errno);
mp->context = context;