[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 09/26] vhost: use avail event idx on vhost_svq_kick
From: |
Jason Wang |
Subject: |
[PULL 09/26] vhost: use avail event idx on vhost_svq_kick |
Date: |
Fri, 28 Oct 2022 13:48:18 +0800 |
From: Eugenio Pérez <eperezma@redhat.com>
So SVQ code knows if an event is needed.
The code is not reachable at the moment.
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
hw/virtio/vhost-shadow-virtqueue.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/hw/virtio/vhost-shadow-virtqueue.c
b/hw/virtio/vhost-shadow-virtqueue.c
index f5c0fad..f306ebe 100644
--- a/hw/virtio/vhost-shadow-virtqueue.c
+++ b/hw/virtio/vhost-shadow-virtqueue.c
@@ -218,12 +218,22 @@ static bool vhost_svq_add_split(VhostShadowVirtqueue *svq,
static void vhost_svq_kick(VhostShadowVirtqueue *svq)
{
+ bool needs_kick;
+
/*
* We need to expose the available array entries before checking the used
* flags
*/
smp_mb();
- if (svq->vring.used->flags & VRING_USED_F_NO_NOTIFY) {
+
+ if (virtio_vdev_has_feature(svq->vdev, VIRTIO_RING_F_EVENT_IDX)) {
+ uint16_t avail_event = *(uint16_t
*)(&svq->vring.used->ring[svq->vring.num]);
+ needs_kick = vring_need_event(avail_event, svq->shadow_avail_idx,
svq->shadow_avail_idx - 1);
+ } else {
+ needs_kick = !(svq->vring.used->flags & VRING_USED_F_NO_NOTIFY);
+ }
+
+ if (!needs_kick) {
return;
}
--
2.7.4
- [PULL 00/26] Net patches, Jason Wang, 2022/10/28
- [PULL 02/26] virtio-net: fix TX timer with tx_burst, Jason Wang, 2022/10/28
- [PULL 01/26] virtio-net: fix bottom-half packet TX on asynchronous completion, Jason Wang, 2022/10/28
- [PULL 06/26] net: improve error message for missing netdev backend, Jason Wang, 2022/10/28
- [PULL 03/26] vdpa: Delete duplicated vdpa_feature_bits entry, Jason Wang, 2022/10/28
- [PULL 04/26] vdpa: Remove shadow CVQ command check, Jason Wang, 2022/10/28
- [PULL 05/26] vhost-vdpa: allow passing opened vhostfd to vhost-vdpa, Jason Wang, 2022/10/28
- [PULL 10/26] vhost: Accept event idx flag, Jason Wang, 2022/10/28
- [PULL 07/26] vhost: allocate event_idx fields on vring, Jason Wang, 2022/10/28
- [PULL 08/26] vhost: toggle device callbacks using used event idx, Jason Wang, 2022/10/28
- [PULL 09/26] vhost: use avail event idx on vhost_svq_kick,
Jason Wang <=
- [PULL 11/26] net: introduce convert_host_port(), Jason Wang, 2022/10/28
- [PULL 13/26] net: simplify net_client_parse() error management, Jason Wang, 2022/10/28
- [PULL 12/26] net: remove the @errp argument of net_client_inits(), Jason Wang, 2022/10/28
- [PULL 14/26] qapi: net: introduce a way to bypass qemu_opts_parse_noisily(), Jason Wang, 2022/10/28
- [PULL 15/26] net: introduce qemu_set_info_str() function, Jason Wang, 2022/10/28
- [PULL 16/26] qapi: net: add stream and dgram netdevs, Jason Wang, 2022/10/28
- [PULL 17/26] net: socket: Don't ignore EINVAL on netdev socket connection, Jason Wang, 2022/10/28
- [PULL 18/26] net: stream: Don't ignore EINVAL on netdev socket connection, Jason Wang, 2022/10/28
- [PULL 19/26] net: stream: add unix socket, Jason Wang, 2022/10/28
- [PULL 20/26] net: dgram: make dgram_dst generic, Jason Wang, 2022/10/28