aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/devices/virtio/format.c
diff options
context:
space:
mode:
authorMohsin Kazmi <sykazmi@cisco.com>2020-04-06 14:19:54 +0200
committerDamjan Marion <dmarion@me.com>2020-04-17 11:28:14 +0000
commit206acf84d6a04590e385f427edba1094c3bdf195 (patch)
treec724f0d2fedd494e163394a6a339c18dc72c0a37 /src/vnet/devices/virtio/format.c
parent95eb01fdc65b692065ace6d76870d8cc9f3e2c84 (diff)
tap: add initial support for tun
Type: feature Change-Id: I699a01ac925fe5c475a36032edb7018618bb4dd4 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Diffstat (limited to 'src/vnet/devices/virtio/format.c')
-rw-r--r--src/vnet/devices/virtio/format.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/vnet/devices/virtio/format.c b/src/vnet/devices/virtio/format.c
index 729635de35b..fe46d92cba9 100644
--- a/src/vnet/devices/virtio/format.c
+++ b/src/vnet/devices/virtio/format.c
@@ -36,6 +36,8 @@ format_virtio_device_name (u8 * s, va_list * args)
s = format (s, "virtio-%x/%x/%x/%x", vif->pci_addr.domain,
vif->pci_addr.bus, vif->pci_addr.slot,
vif->pci_addr.function);
+ else if (vif->type == VIRTIO_IF_TYPE_TUN)
+ s = format (s, "tun%u", vif->id);
else
s = format (s, "virtio-%lu", vif->dev_instance);
@@ -49,6 +51,8 @@ format_virtio_log_name (u8 * s, va_list * args)
if (vif->type == VIRTIO_IF_TYPE_TAP)
s = format (s, "tap%u", vif->id);
+ else if (vif->type == VIRTIO_IF_TYPE_TUN)
+ s = format (s, "tun%u", vif->id);
else if (vif->type == VIRTIO_IF_TYPE_PCI)
s = format (s, "%U", format_vlib_pci_addr, &vif->pci_addr);
else