mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Deming Wang <wangdeming@inspur.com>
To: <mst@redhat.com>, <jasowang@redhat.com>
Cc: <virtualization@lists.linux-foundation.org>,
	<linux-kernel@vger.kernel.org>,
	Deming Wang <wangdeming@inspur.com>
Subject: [PATCH] virtio_ring: remove unnecessary to_vvq call in vring hot path
Date: Wed, 22 Jun 2022 04:51:05 -0400	[thread overview]
Message-ID: <20220622085105.1910-1-wangdeming@inspur.com> (raw)

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@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..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


             reply	other threads:[~2022-06-22  8:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-22  8:51 Deming Wang [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-06-22  9:09 Deming Wang
2022-03-24  7:33 Xianting Tian
2022-03-28  9:05 ` Stefano Garzarella
2022-03-28  9:13   ` Xianting Tian

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220622085105.1910-1-wangdeming@inspur.com \
    --to=wangdeming@inspur.com \
    --cc=jasowang@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=virtualization@lists.linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®