aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/devices/virtio/virtio.h
diff options
context:
space:
mode:
authorMohsin Kazmi <sykazmi@cisco.com>2020-09-28 10:26:33 +0000
committerBeno�t Ganne <bganne@cisco.com>2020-09-28 16:47:30 +0000
commite347acbc31111504c015531e8ad764a86d489309 (patch)
tree3a72d961fd97b9ce7985865d89b0c45d27cab2fc /src/vnet/devices/virtio/virtio.h
parent7741afaf5c66a5d7ed1d2d76ae36a81ec24fdaaa (diff)
virtio: add packet buffering on tx
Type: feature This patch adds packet buffering on tx for slow backend which have some jitter/delays in freeing the vrings. There are some limitations to the current design: 1) It only works in poll mode. 2) Atleast 1 rx queue of an interface (with buffering enabled) should be placed on each worker and main thread. Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com> Change-Id: Ib93c350298b228e80426e58ac77f3bbc93b8be27
Diffstat (limited to 'src/vnet/devices/virtio/virtio.h')
-rw-r--r--src/vnet/devices/virtio/virtio.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/vnet/devices/virtio/virtio.h b/src/vnet/devices/virtio/virtio.h
index b00e1eceb85..acefc387549 100644
--- a/src/vnet/devices/virtio/virtio.h
+++ b/src/vnet/devices/virtio/virtio.h
@@ -20,6 +20,7 @@
#include <vnet/devices/virtio/virtio_std.h>
#include <vnet/devices/virtio/vhost_std.h>
+#include <vnet/devices/virtio/virtio_buffering.h>
#include <vnet/gso/gro.h>
#define foreach_virtio_if_flag \
@@ -76,6 +77,7 @@ typedef struct
u16 last_used_idx;
u16 last_kick_avail_idx;
u32 call_file_index;
+ virtio_vring_buffering_t *buffering;
gro_flow_table_t *flow_table;
} virtio_vring_t;
@@ -123,6 +125,7 @@ typedef struct
CLIB_CACHE_LINE_ALIGN_MARK (cacheline1);
int packet_coalesce;
+ int packet_buffering;
u32 dev_instance;
u32 numa_node;
u64 remote_features;
@@ -203,6 +206,7 @@ extern void virtio_set_net_hdr_size (virtio_if_t * vif);
extern void virtio_show (vlib_main_t * vm, u32 * hw_if_indices, u8 show_descr,
u32 type);
extern void virtio_set_packet_coalesce (virtio_if_t * vif);
+clib_error_t *virtio_set_packet_buffering (virtio_if_t * vif, u16 size);
extern void virtio_pci_legacy_notify_queue (vlib_main_t * vm,
virtio_if_t * vif, u16 queue_id);
extern void virtio_pci_modern_notify_queue (vlib_main_t * vm,