[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20220622081038.1681-1-wangdeming@inspur.com>
Date: Wed, 22 Jun 2022 04:10:38 -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 virtqueue_enable_cb_prepare_packed
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 hot path.
Signed-off-by: Deming Wang <wangdeming@...pur.com>
---
drivers/virtio/virtio_ring.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c
index 13a7348cedff..3418e10f21a5 100644
--- a/drivers/virtio/virtio_ring.c
+++ b/drivers/virtio/virtio_ring.c
@@ -1486,10 +1486,8 @@ static void virtqueue_disable_cb_packed(struct virtqueue *_vq)
}
}
-static unsigned int virtqueue_enable_cb_prepare_packed(struct virtqueue *_vq)
+static unsigned int virtqueue_enable_cb_prepare_packed(struct vring_virtqueue *vq)
{
- struct vring_virtqueue *vq = to_vvq(_vq);
-
START_USE(vq);
/*
@@ -2032,7 +2030,7 @@ unsigned int virtqueue_enable_cb_prepare(struct virtqueue *_vq)
if (vq->event_triggered)
vq->event_triggered = false;
- return vq->packed_ring ? virtqueue_enable_cb_prepare_packed(_vq) :
+ return vq->packed_ring ? virtqueue_enable_cb_prepare_packed(vq) :
virtqueue_enable_cb_prepare_split(_vq);
}
EXPORT_SYMBOL_GPL(virtqueue_enable_cb_prepare);
--
2.27.0
Powered by blists - more mailing lists