summaryrefslogtreecommitdiffstats
path: root/src/vnet/devices/virtio/vhost_user_inline.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/devices/virtio/vhost_user_inline.h')
-rw-r--r--src/vnet/devices/virtio/vhost_user_inline.h22
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
/*