* [PATCH] virtio_ring: remove unnecessary to_vvq call in poll_packed
@ 2022-06-22 8:27 Deming Wang
0 siblings, 0 replies; only message in thread
From: Deming Wang @ 2022-06-22 8:27 UTC (permalink / raw)
To: mst, jasowang; +Cc: virtualization, linux-kernel, Deming Wang
It passes '_vq' to virtqueue_use_indirect(), which still calls
to_vvq to get 'vq', let's directly pass 'vq'. It can avoid
unnecessary call of to_vvq in virtqueue_poll_packed.
Signed-off-by: Deming Wang <wangdeming@inspur.com>
---
drivers/virtio/virtio_ring.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c
index 13a7348cedff..cb6323e0088b 100644
--- a/drivers/virtio/virtio_ring.c
+++ b/drivers/virtio/virtio_ring.c
@@ -1522,9 +1522,8 @@ static unsigned int virtqueue_enable_cb_prepare_packed(struct virtqueue *_vq)
VRING_PACKED_EVENT_F_WRAP_CTR);
}
-static bool virtqueue_poll_packed(struct virtqueue *_vq, u16 off_wrap)
+static bool virtqueue_poll_packed(struct vring_virtqueue *vq, u16 off_wrap)
{
- struct vring_virtqueue *vq = to_vvq(_vq);
bool wrap_counter;
u16 used_idx;
@@ -2054,7 +2053,7 @@ bool virtqueue_poll(struct virtqueue *_vq, unsigned int last_used_idx)
return false;
virtio_mb(vq->weak_barriers);
- return vq->packed_ring ? virtqueue_poll_packed(_vq, last_used_idx) :
+ return vq->packed_ring ? virtqueue_poll_packed(vq, last_used_idx) :
virtqueue_poll_split(_vq, last_used_idx);
}
EXPORT_SYMBOL_GPL(virtqueue_poll);
--
2.27.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2022-06-22 8:29 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-22 8:27 [PATCH] virtio_ring: remove unnecessary to_vvq call in poll_packed Deming Wang
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.