diff options
author | Mohsin Kazmi <sykazmi@cisco.com> | 2022-09-14 11:25:54 +0000 |
---|---|---|
committer | Beno�t Ganne <bganne@cisco.com> | 2022-09-16 16:16:53 +0000 |
commit | dd0144a4563212e193b517d05b231350d58fa53e (patch) | |
tree | e4634fcf73ab639292aebebd22f76fa9e5928c9a /src/vnet/devices/virtio/pci.c | |
parent | c795b8836d83b4b062aa21423f842aa765269c2c (diff) |
virtio: add support for per queue packet counter
Type: improvement
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: I21a701a556b88a9d81f0e074a59fa34b3746b1d9
Diffstat (limited to 'src/vnet/devices/virtio/pci.c')
-rw-r--r-- | src/vnet/devices/virtio/pci.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/vnet/devices/virtio/pci.c b/src/vnet/devices/virtio/pci.c index 07744c20301..f678c3960bf 100644 --- a/src/vnet/devices/virtio/pci.c +++ b/src/vnet/devices/virtio/pci.c @@ -642,6 +642,7 @@ virtio_pci_control_vring_packed_init (vlib_main_t * vm, virtio_if_t * vif, vring->device_event->off_wrap = 0; vring->device_event->flags = 0; + vring->total_packets = 0; vring->queue_id = queue_num; vring->queue_size = queue_size; vring->avail_wrap_counter = 1; @@ -694,6 +695,7 @@ virtio_pci_control_vring_split_init (vlib_main_t * vm, virtio_if_t * vif, clib_memset (ptr, 0, i); vnet_virtio_vring_init (vring, queue_size, ptr, VNET_VIRTIO_PCI_VRING_ALIGN); vring->queue_id = queue_num; + vring->total_packets = 0; ASSERT (vring->buffers == 0); virtio_log_debug (vif, "control-queue: number %u, size %u", queue_num, @@ -765,6 +767,7 @@ virtio_pci_vring_split_init (vlib_main_t * vm, virtio_if_t * vif, vring->queue_id = queue_num; vring->avail->flags = VIRTIO_RING_FLAG_MASK_INT; vring->flow_table = 0; + vring->total_packets = 0; ASSERT (vring->buffers == 0); vec_validate_aligned (vring->buffers, queue_size, CLIB_CACHE_LINE_BYTES); @@ -854,6 +857,7 @@ virtio_pci_vring_packed_init (vlib_main_t * vm, virtio_if_t * vif, vring->avail_wrap_counter = 1; vring->used_wrap_counter = 1; + vring->total_packets = 0; ASSERT (vring->buffers == 0); vec_validate_aligned (vring->buffers, queue_size, CLIB_CACHE_LINE_BYTES); |