summaryrefslogtreecommitdiffstats
path: root/src/vnet/devices/virtio/virtio.h
diff options
context:
space:
mode:
authorMohsin Kazmi <sykazmi@cisco.com>2020-10-12 13:01:24 +0200
committerBeno�t Ganne <bganne@cisco.com>2020-10-21 11:20:01 +0000
commita5203b53d4fa227560333b890d3e79fc220d1bfd (patch)
tree04ac639280910abbf8a12fd973b207f177b67a12 /src/vnet/devices/virtio/virtio.h
parent302b25a00ed913767798d58148ef4d36092ee490 (diff)
virtio: run process to send interrupts to input nodes
Type: improvement virtio interfaces support packet coalescing and buffering which depends on timer expiry to flush the stored packets periodically. virtio input node checks timer expiry and schedules tx queue accordingly. In poll mode, timer expiry is handled naturally, as input node runs periodically. In interrupt mode, virtio input node depends on the interrupts send from backend. Stored packets could starve, if there would not be interrupts to input node. This patch implements a process node which periodically sends interrupt to virtio input node given coalescing or buffering feature is enabled on an interface. Change-Id: Ic38f749f74b001073d4d0579dca149d0a4cea039 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Diffstat (limited to 'src/vnet/devices/virtio/virtio.h')
-rw-r--r--src/vnet/devices/virtio/virtio.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/vnet/devices/virtio/virtio.h b/src/vnet/devices/virtio/virtio.h
index 1cca9f366a8..86660a1f933 100644
--- a/src/vnet/devices/virtio/virtio.h
+++ b/src/vnet/devices/virtio/virtio.h
@@ -57,6 +57,9 @@ typedef enum
#define VIRTIO_RING_FLAG_MASK_INT 1
+#define VIRTIO_EVENT_START_TIMER 1
+#define VIRTIO_EVENT_STOP_TIMER 2
+
typedef struct
{
CLIB_CACHE_LINE_ALIGN_MARK (cacheline0);
@@ -84,6 +87,7 @@ typedef struct
u16 last_used_idx;
u16 last_kick_avail_idx;
u32 call_file_index;
+ vnet_hw_if_rx_mode mode;
virtio_vring_buffering_t *buffering;
gro_flow_table_t *flow_table;
} virtio_vring_t;
@@ -189,6 +193,7 @@ typedef struct
typedef struct
{
+ u32 interrupt_queues_count;
/* logging */
vlib_log_class_t log_default;
@@ -198,6 +203,7 @@ typedef struct
extern virtio_main_t virtio_main;
extern vnet_device_class_t virtio_device_class;
extern vlib_node_registration_t virtio_input_node;
+extern vlib_node_registration_t virtio_send_interrupt_node;
clib_error_t *virtio_vring_init (vlib_main_t * vm, virtio_if_t * vif, u16 idx,
u16 sz);