Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

virtio: switch to use vring_virtqueue for virtqueue_get 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-8-jasowang@redhat.com>

authored by

Jason Wang and committed by
Michael S. Tsirkin
ceea1cd0 4a0fa90b

+7 -9
+7 -9
drivers/virtio/virtio_ring.c
··· 816 816 return virtqueue_poll_split(vq, vq->last_used_idx); 817 817 } 818 818 819 - static void *virtqueue_get_buf_ctx_split(struct virtqueue *_vq, 819 + static void *virtqueue_get_buf_ctx_split(struct vring_virtqueue *vq, 820 820 unsigned int *len, 821 821 void **ctx) 822 822 { 823 - struct vring_virtqueue *vq = to_vvq(_vq); 824 823 void *ret; 825 824 unsigned int i; 826 825 u16 last_used; ··· 841 842 virtio_rmb(vq->weak_barriers); 842 843 843 844 last_used = (vq->last_used_idx & (vq->split.vring.num - 1)); 844 - i = virtio32_to_cpu(_vq->vdev, 845 + i = virtio32_to_cpu(vq->vq.vdev, 845 846 vq->split.vring.used->ring[last_used].id); 846 - *len = virtio32_to_cpu(_vq->vdev, 847 + *len = virtio32_to_cpu(vq->vq.vdev, 847 848 vq->split.vring.used->ring[last_used].len); 848 849 849 850 if (unlikely(i >= vq->split.vring.num)) { ··· 865 866 if (!(vq->split.avail_flags_shadow & VRING_AVAIL_F_NO_INTERRUPT)) 866 867 virtio_store_mb(vq->weak_barriers, 867 868 &vring_used_event(&vq->split.vring), 868 - cpu_to_virtio16(_vq->vdev, vq->last_used_idx)); 869 + cpu_to_virtio16(vq->vq.vdev, vq->last_used_idx)); 869 870 870 871 LAST_ADD_TIME_INVALID(vq); 871 872 ··· 1719 1720 return virtqueue_poll_packed(vq, READ_ONCE(vq->last_used_idx)); 1720 1721 } 1721 1722 1722 - static void *virtqueue_get_buf_ctx_packed(struct virtqueue *_vq, 1723 + static void *virtqueue_get_buf_ctx_packed(struct vring_virtqueue *vq, 1723 1724 unsigned int *len, 1724 1725 void **ctx) 1725 1726 { 1726 - struct vring_virtqueue *vq = to_vvq(_vq); 1727 1727 u16 last_used, id, last_used_idx; 1728 1728 bool used_wrap_counter; 1729 1729 void *ret; ··· 2522 2524 { 2523 2525 struct vring_virtqueue *vq = to_vvq(_vq); 2524 2526 2525 - return vq->packed_ring ? virtqueue_get_buf_ctx_packed(_vq, len, ctx) : 2526 - virtqueue_get_buf_ctx_split(_vq, len, ctx); 2527 + return vq->packed_ring ? virtqueue_get_buf_ctx_packed(vq, len, ctx) : 2528 + virtqueue_get_buf_ctx_split(vq, len, ctx); 2527 2529 } 2528 2530 EXPORT_SYMBOL_GPL(virtqueue_get_buf_ctx); 2529 2531