virtio_ring: switch to use vring_virtqueue for disable_cb variants
Those variants are used internally so let's switch to use vring_virtqueue as parameter to be consistent with other internal virtqueue helpers. Acked-by: Eugenio Pérez <eperezma@redhat.com> Reviewed-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com> Signed-off-by: Jason Wang <jasowang@redhat.com> Tested-by: Lei Yang <leiyang@redhat.com> Reviewed-by: Eugenio Pérez <eperezma@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Message-Id: <20251230064649.55597-11-jasowang@redhat.com>
This commit is contained in:
parent
62fa22cdab
commit
7e81017673
|
|
@ -873,10 +873,8 @@ static void *virtqueue_get_buf_ctx_split(struct vring_virtqueue *vq,
|
|||
return ret;
|
||||
}
|
||||
|
||||
static void virtqueue_disable_cb_split(struct virtqueue *_vq)
|
||||
static void virtqueue_disable_cb_split(struct vring_virtqueue *vq)
|
||||
{
|
||||
struct vring_virtqueue *vq = to_vvq(_vq);
|
||||
|
||||
if (!(vq->split.avail_flags_shadow & VRING_AVAIL_F_NO_INTERRUPT)) {
|
||||
vq->split.avail_flags_shadow |= VRING_AVAIL_F_NO_INTERRUPT;
|
||||
|
||||
|
|
@ -892,7 +890,7 @@ static void virtqueue_disable_cb_split(struct virtqueue *_vq)
|
|||
vring_used_event(&vq->split.vring) = 0x0;
|
||||
else
|
||||
vq->split.vring.avail->flags =
|
||||
cpu_to_virtio16(_vq->vdev,
|
||||
cpu_to_virtio16(vq->vq.vdev,
|
||||
vq->split.avail_flags_shadow);
|
||||
}
|
||||
}
|
||||
|
|
@ -1785,10 +1783,8 @@ static void *virtqueue_get_buf_ctx_packed(struct vring_virtqueue *vq,
|
|||
return ret;
|
||||
}
|
||||
|
||||
static void virtqueue_disable_cb_packed(struct virtqueue *_vq)
|
||||
static void virtqueue_disable_cb_packed(struct vring_virtqueue *vq)
|
||||
{
|
||||
struct vring_virtqueue *vq = to_vvq(_vq);
|
||||
|
||||
if (vq->packed.event_flags_shadow != VRING_PACKED_EVENT_FLAG_DISABLE) {
|
||||
vq->packed.event_flags_shadow = VRING_PACKED_EVENT_FLAG_DISABLE;
|
||||
|
||||
|
|
@ -2541,9 +2537,9 @@ void virtqueue_disable_cb(struct virtqueue *_vq)
|
|||
struct vring_virtqueue *vq = to_vvq(_vq);
|
||||
|
||||
if (vq->packed_ring)
|
||||
virtqueue_disable_cb_packed(_vq);
|
||||
virtqueue_disable_cb_packed(vq);
|
||||
else
|
||||
virtqueue_disable_cb_split(_vq);
|
||||
virtqueue_disable_cb_split(vq);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(virtqueue_disable_cb);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue