[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20220622090930.2022-1-wangdeming@inspur.com>
Date: Wed, 22 Jun 2022 05:09:30 -0400
From: Deming Wang <wangdeming@...pur.com>
To: <mst@...hat.com>, <jasowang@...hat.com>
CC: <virtualization@...ts.linux-foundation.org>,
<linux-kernel@...r.kernel.org>, Deming Wang <wangdeming@...pur.com>
Subject: [PATCH] virtio_ring: remove unnecessary to_vvq call in vring hot path
It passes '_vq' to virtqueue_detach_unused_buf_packed(),
which still calls to_vvq to get 'vq', let's directly
pass 'vq'. It can avoid unnecessary call of to_vvq in hot path.
Signed-off-by: Deming Wang <wangdeming@...pur.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..905d003f6849 100644
--- a/drivers/virtio/virtio_ring.c
+++ b/drivers/virtio/virtio_ring.c
@@ -1593,9 +1593,8 @@ static bool virtqueue_enable_cb_delayed_packed(struct virtqueue *_vq)
return true;
}
-static void *virtqueue_detach_unused_buf_packed(struct virtqueue *_vq)
+static void *virtqueue_detach_unused_buf_packed(struct vring_virtqueue *vq)
{
- struct vring_virtqueue *vq = to_vvq(_vq);
unsigned int i;
void *buf;
@@ -2115,7 +2114,7 @@ void *virtqueue_detach_unused_buf(struct virtqueue *_vq)
{
struct vring_virtqueue *vq = to_vvq(_vq);
- return vq->packed_ring ? virtqueue_detach_unused_buf_packed(_vq) :
+ return vq->packed_ring ? virtqueue_detach_unused_buf_packed(vq) :
virtqueue_detach_unused_buf_split(_vq);
}
EXPORT_SYMBOL_GPL(virtqueue_detach_unused_buf);
--
2.27.0
Powered by blists - more mailing lists