Skip to content

Commit 704806c

Browse files
yishaihawilliam
authored andcommitted
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]>
1 parent 7c1ae15 commit 704806c

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

drivers/virtio/virtio_pci_modern.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,10 @@ void vp_modern_avq_done(struct virtqueue *vq)
6464
spin_lock_irqsave(&admin_vq->lock, flags);
6565
do {
6666
virtqueue_disable_cb(vq);
67-
while ((cmd = virtqueue_get_buf(vq, &len)))
67+
while ((cmd = virtqueue_get_buf(vq, &len))) {
68+
cmd->result_sg_size = len;
6869
complete(&cmd->completion);
70+
}
6971
} while (!virtqueue_enable_cb(vq));
7072
spin_unlock_irqrestore(&admin_vq->lock, flags);
7173
}

include/linux/virtio.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ struct virtio_admin_cmd {
111111
struct scatterlist *data_sg;
112112
struct scatterlist *result_sg;
113113
struct completion completion;
114+
u32 result_sg_size;
114115
int ret;
115116
};
116117

0 commit comments

Comments
 (0)