diff options
author | Steven Luong <sluong@cisco.com> | 2020-11-17 13:30:44 -0800 |
---|---|---|
committer | Beno�t Ganne <bganne@cisco.com> | 2021-01-08 13:10:58 +0000 |
commit | 27ba5008a16eddccc0b285272de7f89fd0aa3a24 (patch) | |
tree | 3065040b62ee15ac45b1c1d77dd7421dcb558a5d /src/vnet/devices/virtio/vhost_user_input.c | |
parent | ed4b38e868c7cabb8e88cc0f1254c95a8f1c5939 (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_input.c')
-rw-r--r-- | src/vnet/devices/virtio/vhost_user_input.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/vnet/devices/virtio/vhost_user_input.c b/src/vnet/devices/virtio/vhost_user_input.c index 53230a61bc7..7ea70c629f8 100644 --- a/src/vnet/devices/virtio/vhost_user_input.c +++ b/src/vnet/devices/virtio/vhost_user_input.c @@ -320,16 +320,17 @@ vhost_user_handle_rx_offload (vlib_buffer_t * b0, u8 * b0_data, } static_always_inline void -vhost_user_input_do_interrupt (vlib_main_t * vm, vhost_user_vring_t * txvq, +vhost_user_input_do_interrupt (vlib_main_t * vm, vhost_user_intf_t * vui, + vhost_user_vring_t * txvq, vhost_user_vring_t * rxvq) { f64 now = vlib_time_now (vm); if ((txvq->n_since_last_int) && (txvq->int_deadline < now)) - vhost_user_send_call (vm, txvq); + vhost_user_send_call (vm, vui, txvq); if ((rxvq->n_since_last_int) && (rxvq->int_deadline < now)) - vhost_user_send_call (vm, rxvq); + vhost_user_send_call (vm, vui, rxvq); } static_always_inline void @@ -400,7 +401,7 @@ vhost_user_if_input (vlib_main_t * vm, { /* do we have pending interrupts ? */ vhost_user_vring_t *rxvq = &vui->vrings[VHOST_VRING_IDX_RX (qid)]; - vhost_user_input_do_interrupt (vm, txvq, rxvq); + vhost_user_input_do_interrupt (vm, vui, txvq, rxvq); } /* @@ -742,7 +743,7 @@ stop: txvq->n_since_last_int += n_rx_packets; if (txvq->n_since_last_int > vum->coalesce_frames) - vhost_user_send_call (vm, txvq); + vhost_user_send_call (vm, vui, txvq); } /* increase rx counters */ @@ -1116,7 +1117,7 @@ vhost_user_if_input_packed (vlib_main_t * vm, vhost_user_main_t * vum, /* do we have pending interrupts ? */ vhost_user_vring_t *rxvq = &vui->vrings[VHOST_VRING_IDX_RX (qid)]; - vhost_user_input_do_interrupt (vm, txvq, rxvq); + vhost_user_input_do_interrupt (vm, vui, txvq, rxvq); /* * For adaptive mode, it is optimized to reduce interrupts. @@ -1389,7 +1390,7 @@ vhost_user_if_input_packed (vlib_main_t * vm, vhost_user_main_t * vum, { txvq->n_since_last_int += n_rx_packets; if (txvq->n_since_last_int > vum->coalesce_frames) - vhost_user_send_call (vm, txvq); + vhost_user_send_call (vm, vui, txvq); } /* increase rx counters */ |