summaryrefslogtreecommitdiffstats
path: root/src/vnet/devices/virtio/virtio.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/devices/virtio/virtio.h')
-rw-r--r--src/vnet/devices/virtio/virtio.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/vnet/devices/virtio/virtio.h b/src/vnet/devices/virtio/virtio.h
index e401f2ddcd7..841441bd0c6 100644
--- a/src/vnet/devices/virtio/virtio.h
+++ b/src/vnet/devices/virtio/virtio.h
@@ -87,6 +87,7 @@ typedef struct
u32 call_file_index;
u32 *buffers;
u16 last_used_idx;
+ u16 last_kick_avail_idx;
} virtio_vring_t;
typedef struct
@@ -137,6 +138,16 @@ extern void virtio_free_used_desc (vlib_main_t * vm, virtio_vring_t * vring);
format_function_t format_virtio_device_name;
+static_always_inline void
+virtio_kick (virtio_vring_t * vring)
+{
+ u64 x = 1;
+ int __clib_unused r;
+
+ r = write (vring->kick_fd, &x, sizeof (x));
+ vring->last_kick_avail_idx = vring->avail->idx;
+}
+
#endif /* _VNET_DEVICES_VIRTIO_VIRTIO_H_ */
/*