[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20220622085105.1910-1-wangdeming@inspur.com>
Date: Wed, 22 Jun 2022 04:51:05 -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_enable_cb_delayed_packed(), which
still calls to_vvq to get 'vq', let's directly pass
to_vvq to gunnecessary 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..4d41d5a90816 100644
--- a/drivers/virtio/virtio_ring.c
+++ b/drivers/virtio/virtio_ring.c
@@ -1534,9 +1534,8 @@ static bool virtqueue_poll_packed(struct virtqueue *_vq, u16 off_wrap)
return is_used_desc_packed(vq, used_idx, wrap_counter);
}
-static bool virtqueue_enable_cb_delayed_packed(struct virtqueue *_vq)
+static bool virtqueue_enable_cb_delayed_packed(struct vring_virtqueue *vq)
{
- struct vring_virtqueue *vq = to_vvq(_vq);
u16 used_idx, wrap_counter;
u16 bufs;
@@ -2098,7 +2097,7 @@ bool virtqueue_enable_cb_delayed(struct virtqueue *_vq)
if (vq->event_triggered)
vq->event_triggered = false;
- return vq->packed_ring ? virtqueue_enable_cb_delayed_packed(_vq) :
+ return vq->packed_ring ? virtqueue_enable_cb_delayed_packed(vq) :
virtqueue_enable_cb_delayed_split(_vq);
}
EXPORT_SYMBOL_GPL(virtqueue_enable_cb_delayed);
--
2.27.0
Powered by blists - more mailing lists