qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 15/31] vdpa: Add vhost_svq_get_num


From: Jason Wang
Subject: Re: [PATCH 15/31] vdpa: Add vhost_svq_get_num
Date: Sat, 29 Jan 2022 16:14:52 +0800
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.5.0


在 2022/1/22 上午4:27, Eugenio Pérez 写道:
This reports the guest's visible SVQ effective length, not the device's
one.


I think we need to explain if there could be a case that the SVQ size is not equal to the device queue size.

Thanks



Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
---
  hw/virtio/vhost-shadow-virtqueue.h | 1 +
  hw/virtio/vhost-shadow-virtqueue.c | 5 +++++
  2 files changed, 6 insertions(+)

diff --git a/hw/virtio/vhost-shadow-virtqueue.h 
b/hw/virtio/vhost-shadow-virtqueue.h
index 3521e8094d..035207a469 100644
--- a/hw/virtio/vhost-shadow-virtqueue.h
+++ b/hw/virtio/vhost-shadow-virtqueue.h
@@ -29,6 +29,7 @@ const EventNotifier *vhost_svq_get_svq_call_notifier(
                                                const VhostShadowVirtqueue 
*svq);
  void vhost_svq_get_vring_addr(const VhostShadowVirtqueue *svq,
                                struct vhost_vring_addr *addr);
+uint16_t vhost_svq_get_num(const VhostShadowVirtqueue *svq);
  size_t vhost_svq_driver_area_size(const VhostShadowVirtqueue *svq);
  size_t vhost_svq_device_area_size(const VhostShadowVirtqueue *svq);
diff --git a/hw/virtio/vhost-shadow-virtqueue.c b/hw/virtio/vhost-shadow-virtqueue.c
index 0f2c2403ff..f129ec8395 100644
--- a/hw/virtio/vhost-shadow-virtqueue.c
+++ b/hw/virtio/vhost-shadow-virtqueue.c
@@ -212,6 +212,11 @@ void vhost_svq_get_vring_addr(const VhostShadowVirtqueue 
*svq,
      addr->used_user_addr = (uint64_t)svq->vring.used;
  }
+uint16_t vhost_svq_get_num(const VhostShadowVirtqueue *svq)
+{
+    return svq->vring.num;
+}
+
  size_t vhost_svq_driver_area_size(const VhostShadowVirtqueue *svq)
  {
      size_t desc_size = sizeof(vring_desc_t) * svq->vring.num;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]