summaryrefslogtreecommitdiffstats
path: root/src/vnet/devices/virtio/virtio.c
diff options
context:
space:
mode:
authorMohsin Kazmi <sykazmi@cisco.com>2021-09-22 18:56:05 +0000
committerMohsin Kazmi <sykazmi@cisco.com>2021-09-22 20:19:45 +0000
commite4efbe73a31062f18d5963caedb1718a3d2c34ea (patch)
treee8c1872c6a2737fd90635d0e78c909a46b3871f4 /src/vnet/devices/virtio/virtio.c
parent0455431a00cb32c1f312437c71afa9290fc7e074 (diff)
virtio: fix the type of argument in virtio_show()
Type: fix virtio have three different interfaces (tap, tun and native virtio). virtio_show() is used by CLI commands to show information about these interfaces. It uses interface type to print interface specific information. virtio_show() should use proper type for virtio interfaces (TAP, TUN, VIRTIO). Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com> Change-Id: I2043dc2cfe2e2f6c7c9348b8494aa4a27cab31f3
Diffstat (limited to 'src/vnet/devices/virtio/virtio.c')
-rw-r--r--src/vnet/devices/virtio/virtio.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/vnet/devices/virtio/virtio.c b/src/vnet/devices/virtio/virtio.c
index b8054d13e5b..73cd95e14c1 100644
--- a/src/vnet/devices/virtio/virtio.c
+++ b/src/vnet/devices/virtio/virtio.c
@@ -295,7 +295,8 @@ virtio_set_net_hdr_size (virtio_if_t * vif)
}
inline void
-virtio_show (vlib_main_t * vm, u32 * hw_if_indices, u8 show_descr, u32 type)
+virtio_show (vlib_main_t *vm, u32 *hw_if_indices, u8 show_descr,
+ virtio_if_type_t type)
{
u32 i, j, hw_if_index;
virtio_if_t *vif;
@@ -407,8 +408,8 @@ virtio_show (vlib_main_t * vm, u32 * hw_if_indices, u8 show_descr, u32 type)
}
vlib_cli_output (vm, " Number of RX Virtqueue %u", vif->num_rxqs);
vlib_cli_output (vm, " Number of TX Virtqueue %u", vif->num_txqs);
- if (vif->cxq_vring != NULL
- && vif->features & VIRTIO_FEATURE (VIRTIO_NET_F_CTRL_VQ))
+ if (type == VIRTIO_IF_TYPE_PCI && vif->cxq_vring != NULL &&
+ vif->features & VIRTIO_FEATURE (VIRTIO_NET_F_CTRL_VQ))
vlib_cli_output (vm, " Number of CTRL Virtqueue 1");
vec_foreach_index (i, vif->rxq_vrings)
{
@@ -542,8 +543,8 @@ virtio_show (vlib_main_t * vm, u32 * hw_if_indices, u8 show_descr, u32 type)
}
}
}
- if (vif->cxq_vring != NULL
- && vif->features & VIRTIO_FEATURE (VIRTIO_NET_F_CTRL_VQ))
+ if (type == VIRTIO_IF_TYPE_PCI && vif->cxq_vring != NULL &&
+ vif->features & VIRTIO_FEATURE (VIRTIO_NET_F_CTRL_VQ))
{
vring = vif->cxq_vring;
vlib_cli_output (vm, " Virtqueue (CTRL) %d", vring->queue_id);