summaryrefslogtreecommitdiffstats
path: root/src/vnet/devices/virtio/vhost_user_output.c
diff options
context:
space:
mode:
authorSteven Luong <sluong@cisco.com>2020-11-17 13:30:44 -0800
committerBeno�t Ganne <bganne@cisco.com>2021-01-08 13:10:58 +0000
commit27ba5008a16eddccc0b285272de7f89fd0aa3a24 (patch)
tree3065040b62ee15ac45b1c1d77dd7421dcb558a5d /src/vnet/devices/virtio/vhost_user_output.c
parented4b38e868c7cabb8e88cc0f1254c95a8f1c5939 (diff)
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
Diffstat (limited to 'src/vnet/devices/virtio/vhost_user_output.c')
-rw-r--r--src/vnet/devices/virtio/vhost_user_output.c13
1 files changed, 7 insertions, 6 deletions
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);