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/vhost_user_output.c b/src/vnet/devices/virtio/vhost_user_output.c
index 80eefa6..465c0ea 100644
--- a/src/vnet/devices/virtio/vhost_user_output.c
+++ b/src/vnet/devices/virtio/vhost_user_output.c
@@ -279,7 +279,8 @@
 }
 
 static_always_inline void
-vhost_user_mark_desc_available (vlib_main_t * vm, vhost_user_vring_t * rxvq,
+vhost_user_mark_desc_available (vlib_main_t * vm, vhost_user_intf_t * vui,
+				vhost_user_vring_t * rxvq,
 				u16 * n_descs_processed, u8 chained,
 				vlib_frame_t * frame, u32 n_left)
 {
@@ -334,7 +335,7 @@
 
       rxvq->n_since_last_int += frame->n_vectors - n_left;
       if (rxvq->n_since_last_int > vum->coalesce_frames)
-	vhost_user_send_call (vm, rxvq);
+	vhost_user_send_call (vm, vui, rxvq);
     }
 }
 
@@ -645,7 +646,7 @@
 	  copy_len = 0;
 
 	  /* give buffers back to driver */
-	  vhost_user_mark_desc_available (vm, rxvq, &n_descs_processed,
+	  vhost_user_mark_desc_available (vm, vui, rxvq, &n_descs_processed,
 					  chained, frame, n_left);
 	}
 
@@ -660,8 +661,8 @@
 	vlib_error_count (vm, node->node_index,
 			  VHOST_USER_TX_FUNC_ERROR_MMAP_FAIL, 1);
 
-      vhost_user_mark_desc_available (vm, rxvq, &n_descs_processed, chained,
-				      frame, n_left);
+      vhost_user_mark_desc_available (vm, vui, rxvq, &n_descs_processed,
+				      chained, frame, n_left);
     }
 
   /*
@@ -1019,7 +1020,7 @@
       rxvq->n_since_last_int += frame->n_vectors - n_left;
 
       if (rxvq->n_since_last_int > vum->coalesce_frames)
-	vhost_user_send_call (vm, rxvq);
+	vhost_user_send_call (vm, vui, rxvq);
     }
 
   vhost_user_vring_unlock (vui, qid);