aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/devices/virtio/vhost_user_api.c
diff options
context:
space:
mode:
authorSteven Luong <sluong@cisco.com>2019-05-06 08:51:56 -0700
committerDave Barach <openvpp@barachs.net>2019-07-31 16:33:15 +0000
commit4208a4ce8d72d3fb6428527cde1fba7b397bd6f7 (patch)
tree3a04e358925ab7215c7d358fbf62b6c1eb33b25f /src/vnet/devices/virtio/vhost_user_api.c
parent83832e7ced8be8b7de394415feaba70c32e3c38d (diff)
devices interface tests: vhosst GSO support
Add gso option in create vhost interface to support gso and checksum offload. Tested with the following startup options in qemu: csum=on,gso=on,guest_csum=on,guest_tso4=on,guest_tso6=on,guest_ufo=on, host_tso4=on,host_tso6=on,host_ufo=on Type: feature Change-Id: I9ba1ee33677a694c4a0dfe66e745b098995902b8 Signed-off-by: Steven Luong <sluong@cisco.com>
Diffstat (limited to 'src/vnet/devices/virtio/vhost_user_api.c')
-rw-r--r--src/vnet/devices/virtio/vhost_user_api.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/src/vnet/devices/virtio/vhost_user_api.c b/src/vnet/devices/virtio/vhost_user_api.c
index 4c765f30961..7899fa2ae78 100644
--- a/src/vnet/devices/virtio/vhost_user_api.c
+++ b/src/vnet/devices/virtio/vhost_user_api.c
@@ -65,12 +65,18 @@ vl_api_create_vhost_user_if_t_handler (vl_api_create_vhost_user_if_t * mp)
if (mp->disable_indirect_desc)
disabled_features |= (1ULL << FEAT_VIRTIO_F_INDIRECT_DESC);
+ /*
+ * feature mask is not supported via binary API. We disable GSO feature in the
+ * feature mask. It may be enabled via enable_gso argument.
+ */
+ disabled_features |= FEATURE_VIRTIO_NET_F_HOST_GUEST_TSO_FEATURE_BITS;
features &= ~disabled_features;
rv = vhost_user_create_if (vnm, vm, (char *) mp->sock_filename,
mp->is_server, &sw_if_index, features,
mp->renumber, ntohl (mp->custom_dev_instance),
- (mp->use_custom_mac) ? mp->mac_address : NULL);
+ (mp->use_custom_mac) ? mp->mac_address : NULL,
+ mp->enable_gso);
/* Remember an interface tag for the new interface */
if (rv == 0)
@@ -99,13 +105,23 @@ vl_api_modify_vhost_user_if_t_handler (vl_api_modify_vhost_user_if_t * mp)
int rv = 0;
vl_api_modify_vhost_user_if_reply_t *rmp;
u32 sw_if_index = ntohl (mp->sw_if_index);
+ u64 features = (u64) ~ (0ULL);
+ u64 disabled_features = (u64) (0ULL);
vnet_main_t *vnm = vnet_get_main ();
vlib_main_t *vm = vlib_get_main ();
+ /*
+ * feature mask is not supported via binary API. We disable GSO feature in the
+ * feature mask. It may be enabled via enable_gso argument.
+ */
+ disabled_features |= FEATURE_VIRTIO_NET_F_HOST_GUEST_TSO_FEATURE_BITS;
+ features &= ~disabled_features;
+
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->is_server, sw_if_index, features,
+ mp->renumber, ntohl (mp->custom_dev_instance),
+ mp->enable_gso);
REPLY_MACRO (VL_API_MODIFY_VHOST_USER_IF_REPLY);
}