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/vhost_user_output.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/vnet/devices/virtio/vhost_user_output.c') diff --git a/src/vnet/devices/virtio/vhost_user_output.c b/src/vnet/devices/virtio/vhost_user_output.c index 80eefa6d9ed..465c0ea0903 100644 --- a/src/vnet/devices/virtio/vhost_user_output.c +++ b/src/vnet/devices/virtio/vhost_user_output.c @@ -279,7 +279,8 @@ vhost_user_handle_tx_offload (vhost_user_intf_t * vui, vlib_buffer_t * b, } 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 @@ vhost_user_mark_desc_available (vlib_main_t * vm, vhost_user_vring_t * rxvq, 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 @@ retry: 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 @@ done: 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 @@ done: 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); -- cgit 1.2.3-korg