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 <sluong@cisco.com>
Change-Id: I68dab7dd07045cafb49af97b7f70db9b8131ae03
diff --git a/src/vnet/devices/virtio/virtio_std.h b/src/vnet/devices/virtio/virtio_std.h
index 98befb5..619dd66 100644
--- a/src/vnet/devices/virtio/virtio_std.h
+++ b/src/vnet/devices/virtio/virtio_std.h
@@ -77,9 +77,17 @@
 #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