From 27ba5008a16eddccc0b285272de7f89fd0aa3a24 Mon Sep 17 00:00:00 2001 From: Steven Luong Date: Tue, 17 Nov 2020 13:30:44 -0800 Subject: vhost: Add event index for interrupt notification to driver VPP only supports a poor man's approach for interrupt notification to the driver. It uses a simple binary flag for "interrupt needed" or "interrupt not needed". Most drivers support more sophisticated event index already. This feature is to add the long due missing feature and make it configurable, off by default. Type: feature Signed-off-by: Steven Luong Change-Id: I68dab7dd07045cafb49af97b7f70db9b8131ae03 --- src/vnet/devices/virtio/virtio_std.h | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src/vnet/devices/virtio/virtio_std.h') diff --git a/src/vnet/devices/virtio/virtio_std.h b/src/vnet/devices/virtio/virtio_std.h index 98befb5c820..619dd66d5ed 100644 --- a/src/vnet/devices/virtio/virtio_std.h +++ b/src/vnet/devices/virtio/virtio_std.h @@ -77,9 +77,17 @@ typedef enum #define VRING_DESC_F_AVAIL (1 << 7) #define VRING_DESC_F_USED (1 << 15) -#define VRING_EVENT_F_ENABLE 0x0 -#define VRING_EVENT_F_DISABLE 0x1 -#define VRING_EVENT_F_DESC 0x2 +#define foreach_virtio_event_idx_flags \ + _ (VRING_EVENT_F_ENABLE, 0) \ + _ (VRING_EVENT_F_DISABLE, 1) \ + _ (VRING_EVENT_F_DESC, 2) + +typedef enum +{ +#define _(f,n) f = n, + foreach_virtio_event_idx_flags +#undef _ +} virtio_event_idx_flags_t; #define VRING_USED_F_NO_NOTIFY 1 #define VRING_AVAIL_F_NO_INTERRUPT 1 -- cgit 1.2.3-korg