diff options
author | Steven Luong <sluong@cisco.com> | 2019-05-06 08:51:56 -0700 |
---|---|---|
committer | Dave Barach <openvpp@barachs.net> | 2019-07-31 16:33:15 +0000 |
commit | 4208a4ce8d72d3fb6428527cde1fba7b397bd6f7 (patch) | |
tree | 3a04e358925ab7215c7d358fbf62b6c1eb33b25f /src/vnet/devices/virtio/vhost_user_inline.h | |
parent | 83832e7ced8be8b7de394415feaba70c32e3c38d (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_inline.h')
-rw-r--r-- | src/vnet/devices/virtio/vhost_user_inline.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/vnet/devices/virtio/vhost_user_inline.h b/src/vnet/devices/virtio/vhost_user_inline.h index 544e2d36952..27048c66186 100644 --- a/src/vnet/devices/virtio/vhost_user_inline.h +++ b/src/vnet/devices/virtio/vhost_user_inline.h @@ -270,6 +270,28 @@ vui_is_link_up (vhost_user_intf_t * vui) return vui->admin_up && vui->is_ready; } +static_always_inline void +vhost_user_update_gso_interface_count (vhost_user_intf_t * vui, u8 add) +{ + vnet_main_t *vnm = vnet_get_main (); + vhost_user_main_t *vum = &vhost_user_main; + + if (vui->enable_gso) + { + if (add) + { + vnm->interface_main.gso_interface_count++; + vum->gso_count++; + } + else + { + ASSERT (vnm->interface_main.gso_interface_count > 0); + vnm->interface_main.gso_interface_count--; + ASSERT (vum->gso_count > 0); + vum->gso_count--; + } + } +} #endif /* |