diff options
author | Mohsin Kazmi <sykazmi@cisco.com> | 2020-06-30 15:28:01 +0200 |
---|---|---|
committer | Andrew Yourtchenko <ayourtch@gmail.com> | 2020-07-14 19:25:51 +0000 |
commit | 82103e9fe16570ca0febee3602ee1ef7bbc4544f (patch) | |
tree | 6e15adac8620d503de9d105294e548727581cb68 | |
parent | 5ac8c6f1f34e96890ccd08dc43b0b896a3b7bf43 (diff) |
tap: fix dump for TUN interfaces
Type: fix
Change-Id: I3bcc8ff1cf0a828ce3ba112694d38e3287d38d8d
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
(cherry picked from commit 86f281a841b5ec67c6a440dfc691e4c42b883df9)
-rw-r--r-- | src/vnet/devices/tap/tap.c | 5 | ||||
-rw-r--r-- | src/vnet/devices/virtio/virtio.h | 1 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/vnet/devices/tap/tap.c b/src/vnet/devices/tap/tap.c index 90f19af8744..bf5366fe8d0 100644 --- a/src/vnet/devices/tap/tap.c +++ b/src/vnet/devices/tap/tap.c @@ -684,6 +684,7 @@ tap_create_if (vlib_main_t * vm, tap_create_if_args_t * args) vif->host_if_name = format (0, "%s%c", host_if_name, 0); vif->net_ns = format (0, "%s%c", args->host_namespace, 0); vif->host_mtu_size = args->host_mtu_size; + vif->tap_flags = args->tap_flags; clib_memcpy (vif->host_mac_addr, args->host_mac_addr.bytes, 6); vif->host_ip4_prefix_len = args->host_ip4_prefix_len; vif->host_ip6_prefix_len = args->host_ip6_prefix_len; @@ -931,7 +932,8 @@ tap_dump_ifs (tap_interface_details_t ** out_tapids) /* *INDENT-OFF* */ pool_foreach (vif, mm->interfaces, - if (vif->type != VIRTIO_IF_TYPE_TAP) + if ((vif->type != VIRTIO_IF_TYPE_TAP) + && (vif->type != VIRTIO_IF_TYPE_TUN)) continue; vec_add2(r_tapids, tapid, 1); clib_memset (tapid, 0, sizeof (*tapid)); @@ -945,6 +947,7 @@ tap_dump_ifs (tap_interface_details_t ** out_tapids) tapid->rx_ring_sz = vring->size; vring = vec_elt_at_index (vif->txq_vrings, TX_QUEUE_ACCESS(0)); tapid->tx_ring_sz = vring->size; + tapid->tap_flags = vif->tap_flags; clib_memcpy(&tapid->host_mac_addr, vif->host_mac_addr, 6); if (vif->host_if_name) { diff --git a/src/vnet/devices/virtio/virtio.h b/src/vnet/devices/virtio/virtio.h index f5dc1c86930..b24064830a3 100644 --- a/src/vnet/devices/virtio/virtio.h +++ b/src/vnet/devices/virtio/virtio.h @@ -181,6 +181,7 @@ typedef struct u32 host_mtu_size; int gso_enabled; int csum_offload_enabled; + u32 tap_flags; int ifindex; virtio_vring_t *cxq_vring; } virtio_if_t; |