diff options
author | Mohsin Kazmi <sykazmi@cisco.com> | 2022-01-18 13:53:57 +0100 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2022-01-18 14:29:06 +0000 |
commit | 5bb4cd1bea08e42d308136222963ff31bc521166 (patch) | |
tree | 0fa56b0083561d0f0d77242bb2d1fbd68be897f7 /src/vnet | |
parent | 646c6e09251f80b9ec8399df0090119d3d09802a (diff) |
virtio: remove admin-up flag during interface creation
Type: fix
During the interface creation time, (by default) admin-up
flag is locally set for tap and virtio interfaces.
While, in VPP the state of these interfaces are still
admin-down. User needs to explicitly call
'set interface state <interface-name> up' to admin-up the
newly created tap or virtio interface(s) in VPP. So, this
behavior is inconsistent.
This patch fixes the issue to have consistent behavior
for given interface between local and global administration
state.
Change-Id: Ifd8904a09fbdbe7b386874ac3231dc0527064518
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Diffstat (limited to 'src/vnet')
-rw-r--r-- | src/vnet/devices/tap/tap.c | 1 | ||||
-rw-r--r-- | src/vnet/devices/virtio/pci.c | 3 |
2 files changed, 0 insertions, 4 deletions
diff --git a/src/vnet/devices/tap/tap.c b/src/vnet/devices/tap/tap.c index f5ed30ad7b0..370e738bcf1 100644 --- a/src/vnet/devices/tap/tap.c +++ b/src/vnet/devices/tap/tap.c @@ -695,7 +695,6 @@ tap_create_if (vlib_main_t * vm, tap_create_if_args_t * args) virtio_vring_set_tx_queues (vm, vif); vif->per_interface_next_index = ~0; - vif->flags |= VIRTIO_IF_FLAG_ADMIN_UP; vnet_hw_interface_set_flags (vnm, vif->hw_if_index, VNET_HW_INTERFACE_FLAG_LINK_UP); /* diff --git a/src/vnet/devices/virtio/pci.c b/src/vnet/devices/virtio/pci.c index 3c070b7160c..1d2699bbb36 100644 --- a/src/vnet/devices/virtio/pci.c +++ b/src/vnet/devices/virtio/pci.c @@ -131,13 +131,11 @@ virtio_pci_irq_config_handler (vlib_main_t * vm, vlib_pci_dev_handle_t h, if (virtio_pci_is_link_up (vm, vif) & VIRTIO_NET_S_LINK_UP) { - vif->flags |= VIRTIO_IF_FLAG_ADMIN_UP; vnet_hw_interface_set_flags (vnm, vif->hw_if_index, VNET_HW_INTERFACE_FLAG_LINK_UP); } else { - vif->flags &= ~VIRTIO_IF_FLAG_ADMIN_UP; vnet_hw_interface_set_flags (vnm, vif->hw_if_index, 0); } } @@ -1497,7 +1495,6 @@ virtio_pci_create_if (vlib_main_t * vm, virtio_pci_create_if_args_t * args) if (virtio_pci_is_link_up (vm, vif) & VIRTIO_NET_S_LINK_UP) { - vif->flags |= VIRTIO_IF_FLAG_ADMIN_UP; vnet_hw_interface_set_flags (vnm, vif->hw_if_index, VNET_HW_INTERFACE_FLAG_LINK_UP); } |