All of lore.kernel.org
 help / color / mirror / Atom feed
From: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
To: virtualization@lists.linux-foundation.org
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Subject: [PATCH 1/6] virtio: rename vring_unmap_state_packed() to vring_unmap_extra_packed()
Date: Fri,  7 Jan 2022 14:33:01 +0800	[thread overview]
Message-ID: <20220107063306.23240-2-xuanzhuo@linux.alibaba.com> (raw)
In-Reply-To: <20220107063306.23240-1-xuanzhuo@linux.alibaba.com>

The actual parameter handled by vring_unmap_state_packed() is that
vring_desc_extra, so this function should use "extra" instead of "state".

Signed-off-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
---
 drivers/virtio/virtio_ring.c | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c
index 028b05d44546..81531cbb08a7 100644
--- a/drivers/virtio/virtio_ring.c
+++ b/drivers/virtio/virtio_ring.c
@@ -984,24 +984,24 @@ static struct virtqueue *vring_create_virtqueue_split(
  * Packed ring specific functions - *_packed().
  */
 
-static void vring_unmap_state_packed(const struct vring_virtqueue *vq,
-				     struct vring_desc_extra *state)
+static void vring_unmap_extra_packed(const struct vring_virtqueue *vq,
+				     struct vring_desc_extra *extra)
 {
 	u16 flags;
 
 	if (!vq->use_dma_api)
 		return;
 
-	flags = state->flags;
+	flags = extra->flags;
 
 	if (flags & VRING_DESC_F_INDIRECT) {
 		dma_unmap_single(vring_dma_dev(vq),
-				 state->addr, state->len,
+				 extra->addr, extra->len,
 				 (flags & VRING_DESC_F_WRITE) ?
 				 DMA_FROM_DEVICE : DMA_TO_DEVICE);
 	} else {
 		dma_unmap_page(vring_dma_dev(vq),
-			       state->addr, state->len,
+			       extra->addr, extra->len,
 			       (flags & VRING_DESC_F_WRITE) ?
 			       DMA_FROM_DEVICE : DMA_TO_DEVICE);
 	}
@@ -1301,8 +1301,7 @@ static inline int virtqueue_add_packed(struct virtqueue *_vq,
 	for (n = 0; n < total_sg; n++) {
 		if (i == err_idx)
 			break;
-		vring_unmap_state_packed(vq,
-					 &vq->packed.desc_extra[curr]);
+		vring_unmap_extra_packed(vq, &vq->packed.desc_extra[curr]);
 		curr = vq->packed.desc_extra[curr].next;
 		i++;
 		if (i >= vq->packed.vring.num)
@@ -1381,8 +1380,8 @@ static void detach_buf_packed(struct vring_virtqueue *vq,
 	if (unlikely(vq->use_dma_api)) {
 		curr = id;
 		for (i = 0; i < state->num; i++) {
-			vring_unmap_state_packed(vq,
-				&vq->packed.desc_extra[curr]);
+			vring_unmap_extra_packed(vq,
+						 &vq->packed.desc_extra[curr]);
 			curr = vq->packed.desc_extra[curr].next;
 		}
 	}
-- 
2.31.0

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

  reply	other threads:[~2022-01-07  6:33 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-07  6:33 [PATCH 0/6] virtio: support advance DMA Xuan Zhuo
2022-01-07  6:33 ` Xuan Zhuo [this message]
2022-01-10  6:19   ` [PATCH 1/6] virtio: rename vring_unmap_state_packed() to vring_unmap_extra_packed() Jason Wang
2022-01-07  6:33 ` [PATCH 2/6] virtio: split: alloc indirect desc with extra Xuan Zhuo
2022-01-10  6:43   ` Jason Wang
2022-01-10  7:19     ` Xuan Zhuo
2022-01-10  7:41       ` Jason Wang
2022-01-10  7:52         ` Xuan Zhuo
2022-01-10  8:54           ` Jason Wang
2022-01-10  9:23             ` Xuan Zhuo
2022-01-10  9:49               ` Michael S. Tsirkin
2022-01-10  9:58                 ` Xuan Zhuo
2022-01-10 10:06                   ` Michael S. Tsirkin
2022-01-11  2:44               ` Jason Wang
2022-01-11  5:57                 ` Xuan Zhuo
2022-01-07  6:33 ` [PATCH 3/6] virtio: packed: " Xuan Zhuo
2022-01-07  6:33 ` [PATCH 4/6] virtio: split: virtqueue_add_split() support dma address Xuan Zhuo
2022-01-10  6:45   ` Jason Wang
2022-01-10  7:24     ` Xuan Zhuo
2022-01-07  6:33 ` [PATCH 5/6] virtio: packed: virtqueue_add_packed() " Xuan Zhuo
2022-01-07  6:33 ` [PATCH 6/6] virtio: add api virtio_dma_map() for advance dma Xuan Zhuo
2022-01-10  7:12   ` Michael S. Tsirkin
2022-01-10  7:24     ` Xuan Zhuo
2022-01-10  9:59 ` [PATCH 0/6] virtio: support advance DMA Michael S. Tsirkin
2022-01-11  2:54   ` Jason Wang
2022-01-11  6:17     ` Xuan Zhuo

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=20220107063306.23240-2-xuanzhuo@linux.alibaba.com \
    --to=xuanzhuo@linux.alibaba.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.