public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Yishai Hadas <yishaih@nvidia.com>
To: <alex.williamson@redhat.com>, <mst@redhat.com>,
	<jasowang@redhat.com>, <jgg@nvidia.com>
Cc: <kvm@vger.kernel.org>,
	<virtualization@lists.linux-foundation.org>, <parav@nvidia.com>,
	<feliu@nvidia.com>, <kevin.tian@intel.com>,
	<joao.m.martins@oracle.com>, <leonro@nvidia.com>,
	<yishaih@nvidia.com>, <maorg@nvidia.com>
Subject: [PATCH vfio 2/7] virtio: Extend the admin command to include the result size
Date: Sun, 27 Oct 2024 12:07:46 +0200	[thread overview]
Message-ID: <20241027100751.219214-3-yishaih@nvidia.com> (raw)
In-Reply-To: <20241027100751.219214-1-yishaih@nvidia.com>

Extend the admin command by incorporating a result size field.

This allows higher layers to determine the actual result size from the
backend when this information is not included in the result_sg.

The additional information introduced here will be used in subsequent
patches of this series.

Signed-off-by: Yishai Hadas <yishaih@nvidia.com>
---
 drivers/virtio/virtio_pci_modern.c | 4 +++-
 include/linux/virtio.h             | 1 +
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/virtio/virtio_pci_modern.c b/drivers/virtio/virtio_pci_modern.c
index 9193c30d640a..487d04610ecb 100644
--- a/drivers/virtio/virtio_pci_modern.c
+++ b/drivers/virtio/virtio_pci_modern.c
@@ -64,8 +64,10 @@ void vp_modern_avq_done(struct virtqueue *vq)
 	spin_lock_irqsave(&admin_vq->lock, flags);
 	do {
 		virtqueue_disable_cb(vq);
-		while ((cmd = virtqueue_get_buf(vq, &len)))
+		while ((cmd = virtqueue_get_buf(vq, &len))) {
+			cmd->result_sg_size = len;
 			complete(&cmd->completion);
+		}
 	} while (!virtqueue_enable_cb(vq));
 	spin_unlock_irqrestore(&admin_vq->lock, flags);
 }
diff --git a/include/linux/virtio.h b/include/linux/virtio.h
index 306137a15d07..b5f7a611715a 100644
--- a/include/linux/virtio.h
+++ b/include/linux/virtio.h
@@ -111,6 +111,7 @@ struct virtio_admin_cmd {
 	struct scatterlist *data_sg;
 	struct scatterlist *result_sg;
 	struct completion completion;
+	u32 result_sg_size;
 	int ret;
 };
 
-- 
2.27.0


  parent reply	other threads:[~2024-10-27 10:08 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-27 10:07 [PATCH vfio 0/7] Enhances the vfio-virtio driver to support live migration Yishai Hadas
2024-10-27 10:07 ` [PATCH vfio 1/7] virtio_pci: Introduce device parts access commands Yishai Hadas
2024-10-27 10:07 ` Yishai Hadas [this message]
2024-10-27 10:07 ` [PATCH vfio 3/7] virtio: Manage device and driver capabilities via the admin commands Yishai Hadas
2024-10-27 10:07 ` [PATCH vfio 4/7] virtio-pci: Introduce APIs to execute device parts " Yishai Hadas
2024-10-27 10:07 ` [PATCH vfio 5/7] vfio/virtio: Add support for the basic live migration functionality Yishai Hadas
2024-10-27 10:07 ` [PATCH vfio 6/7] vfio/virtio: Add PRE_COPY support for live migration Yishai Hadas
2024-10-27 10:07 ` [PATCH vfio 7/7] vfio/virtio: Enable live migration once VIRTIO_PCI was configured Yishai Hadas
2024-10-28 16:13 ` [PATCH vfio 0/7] Enhances the vfio-virtio driver to support live migration Alex Williamson
2024-10-28 16:23   ` Jason Gunthorpe
2024-10-28 16:54     ` Alex Williamson
2024-10-28 17:46       ` Parav Pandit
2024-10-29 20:28         ` Alex Williamson
2024-10-31 15:04           ` Parav Pandit
2024-11-01 16:25             ` Alex Williamson
2024-11-03 14:38               ` Parav Pandit
2024-10-29 11:59     ` Yishai Hadas
2024-10-28 18:17 ` Alex Williamson
2024-10-29  8:43   ` Yishai Hadas

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=20241027100751.219214-3-yishaih@nvidia.com \
    --to=yishaih@nvidia.com \
    --cc=alex.williamson@redhat.com \
    --cc=feliu@nvidia.com \
    --cc=jasowang@redhat.com \
    --cc=jgg@nvidia.com \
    --cc=joao.m.martins@oracle.com \
    --cc=kevin.tian@intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=leonro@nvidia.com \
    --cc=maorg@nvidia.com \
    --cc=mst@redhat.com \
    --cc=parav@nvidia.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