aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/devices/virtio
diff options
context:
space:
mode:
authorMohsin Kazmi <sykazmi@cisco.com>2018-04-25 15:58:05 +0200
committerMohsin Kazmi <sykazmi@cisco.com>2018-05-28 11:14:41 +0200
commita50a14c5577e82866b05f325e359c86ba7145730 (patch)
tree66dd4d9fe7d2692b76a78472260d85eff34de75d /src/vnet/devices/virtio
parent4fed5b1b34b346f25feef34c590b4dd428343756 (diff)
itf: Fix admin up down for AF_PACKET and vhost-user
Change-Id: I84327197d59c72d0d046dd2cb4071bf74af6fc28 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Diffstat (limited to 'src/vnet/devices/virtio')
-rw-r--r--src/vnet/devices/virtio/vhost-user.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/vnet/devices/virtio/vhost-user.c b/src/vnet/devices/virtio/vhost-user.c
index 7e10a60f5fb..4e745d662fb 100644
--- a/src/vnet/devices/virtio/vhost-user.c
+++ b/src/vnet/devices/virtio/vhost-user.c
@@ -2548,16 +2548,14 @@ vhost_user_interface_admin_up_down (vnet_main_t * vnm, u32 hw_if_index,
u32 flags)
{
vnet_hw_interface_t *hif = vnet_get_hw_interface (vnm, hw_if_index);
- uword is_up = (flags & VNET_SW_INTERFACE_FLAG_ADMIN_UP) != 0;
vhost_user_main_t *vum = &vhost_user_main;
vhost_user_intf_t *vui =
pool_elt_at_index (vum->vhost_user_interfaces, hif->dev_instance);
+ u32 hw_flags = 0;
+ vui->admin_up = (flags & VNET_SW_INTERFACE_FLAG_ADMIN_UP) != 0;
+ hw_flags = vui->admin_up ? VNET_HW_INTERFACE_FLAG_LINK_UP : 0;
- vui->admin_up = is_up;
-
- if (is_up && vui->is_up)
- vnet_hw_interface_set_flags (vnm, vui->hw_if_index,
- VNET_HW_INTERFACE_FLAG_LINK_UP);
+ vnet_hw_interface_set_flags (vnm, vui->hw_if_index, hw_flags);
return /* no error */ 0;
}