diff options
| author | Yishai Hadas <[email protected]> | 2024-11-13 11:51:55 +0000 |
|---|---|---|
| committer | Alex Williamson <[email protected]> | 2024-11-13 22:25:41 +0000 |
| commit | 704806ca400e5daa86c110f14bfdda9d28203bb7 (patch) | |
| tree | bff0fc30c0c9dab1e8bb17d1037a7ea00e9140ad | |
| parent | virtio_pci: Introduce device parts access commands (diff) | |
| download | kernel-704806ca400e5daa86c110f14bfdda9d28203bb7.tar.gz kernel-704806ca400e5daa86c110f14bfdda9d28203bb7.zip | |
virtio: Extend the admin command to include the result size
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.
Acked-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Yishai Hadas <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alex Williamson <[email protected]>
| -rw-r--r-- | drivers/virtio/virtio_pci_modern.c | 4 | ||||
| -rw-r--r-- | include/linux/virtio.h | 1 |
2 files changed, 4 insertions, 1 deletions
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; }; |
