vhost-user: Interface state updates
Fix inconsistencies between admin and link interface states
Admin down should imply link down:
link_up = admin_up && link_ready
Change-Id: I4d668d82d035b5d2ae508727f34f1722a0c3e677
Signed-off-by: Juraj Sloboda <jsloboda@cisco.com>
diff --git a/src/vnet/devices/virtio/vhost_user_inline.h b/src/vnet/devices/virtio/vhost_user_inline.h
index 9f61351..7e988eb 100644
--- a/src/vnet/devices/virtio/vhost_user_inline.h
+++ b/src/vnet/devices/virtio/vhost_user_inline.h
@@ -251,6 +251,12 @@
vq->int_deadline = vlib_time_now (vm) + vum->coalesce_time;
}
+static_always_inline u8
+vui_is_link_up (vhost_user_intf_t * vui)
+{
+ return vui->admin_up && vui->is_ready;
+}
+
#endif
/*