[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH 2/4] use virtqueue_unmap_sg in virtqueue_fill
Use virtqueue_unmap_sg to unmap in_sg and out_sg in virtqueue_fill. No functional changes. Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx> CC: jasowang@xxxxxxxxxx CC: wency@xxxxxxxxxxxxxx CC: mst@xxxxxxxxxx CC: pbonzini@xxxxxxxxxx --- hw/virtio/virtio.c | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 2621ae6..4af31d0 100644 --- a/hw/virtio/virtio.c +++ b/hw/virtio/virtio.c @@ -238,26 +238,10 @@ int virtio_queue_empty(VirtQueue *vq) void virtqueue_fill(VirtQueue *vq, const VirtQueueElement *elem, unsigned int len, unsigned int idx) { - unsigned int offset; - int i; - trace_virtqueue_fill(vq, elem, len, idx); - offset = 0; - for (i = 0; i < elem->in_num; i++) { - size_t size = MIN(len - offset, elem->in_sg[i].iov_len); - - cpu_physical_memory_unmap(elem->in_sg[i].iov_base, - elem->in_sg[i].iov_len, - 1, size); - - offset += size; - } - - for (i = 0; i < elem->out_num; i++) - cpu_physical_memory_unmap(elem->out_sg[i].iov_base, - elem->out_sg[i].iov_len, - 0, elem->out_sg[i].iov_len); + virtqueue_unmap_sg(elem->in_sg, elem->in_num, 1, len); + virtqueue_unmap_sg(elem->out_sg, elem->out_num, 0, UINT_MAX); idx = (idx + vring_used_idx(vq)) % vq->vring.num; -- 1.7.10.4 _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |