virtio_ring: remove unnecessary to_vvq call in vring hot path
PATCH 1/1 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 <[email protected]>
--- drivers/virtio/virtio_ring.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/virtio/virtio_ring.c +2 -3
@@ -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);
Signature · 1 line
2.27.0