[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 15/31] vdpa: Add vhost_svq_get_num
From: |
Eugenio Perez Martin |
Subject: |
Re: [PATCH 15/31] vdpa: Add vhost_svq_get_num |
Date: |
Mon, 31 Jan 2022 17:36:23 +0100 |
On Sat, Jan 29, 2022 at 9:15 AM Jason Wang <jasowang@redhat.com> wrote:
>
>
> 在 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.
>
The description is actually misleading now that I re-read it. It
reports the size that the guest negotiated with SVQ for the guest's
vring, not the one that SVQ negotiates with the device for SVQ's
vring. I'll reword for the next version so thanks for pointing it out.
Regarding your comment, the only case it can happen is if SVQ cannot
get device's num, something that we could make an error as you point
out later in the series.
Thanks!
> 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;
>
- Re: [PATCH 09/31] vhost-vdpa: Take into account SVQ in vhost_vdpa_set_vring_call, (continued)
- [PATCH 10/31] vhost: Route host->guest notification through shadow virtqueue, Eugenio Pérez, 2022/01/21
- [PATCH 12/31] vhost: Add vhost_svq_valid_guest_features to shadow vq, Eugenio Pérez, 2022/01/21
- [PATCH 11/31] vhost: Add vhost_svq_valid_device_features to shadow vq, Eugenio Pérez, 2022/01/21
- [PATCH 13/31] vhost: Add vhost_svq_ack_guest_features to shadow vq, Eugenio Pérez, 2022/01/21
- [PATCH 14/31] virtio: Add vhost_shadow_vq_get_vring_addr, Eugenio Pérez, 2022/01/21
- [PATCH 15/31] vdpa: Add vhost_svq_get_num, Eugenio Pérez, 2022/01/21
- [PATCH 16/31] vhost: pass queue index to vhost_vq_get_addr, Eugenio Pérez, 2022/01/21
- [PATCH 17/31] vdpa: adapt vhost_ops callbacks to svq, Eugenio Pérez, 2022/01/21
- [PATCH 18/31] vhost: Shadow virtqueue buffers forwarding, Eugenio Pérez, 2022/01/21
- [PATCH 19/31] utils: Add internal DMAMap to iova-tree, Eugenio Pérez, 2022/01/21