search for: iovec

Displaying 20 results from an estimated 847 matches for "iovec".

2015 Feb 04
2
[PATCH v3 17/18] vhost: don't bother copying iovecs in handle_rx(), kill memcpy_toiovecend()
...c: Michael S. Tsirkin <mst at redhat.com> Cc: kvm at vger.kernel.org Cc: virtualization at lists.linux-foundation.org Signed-off-by: Al Viro <viro at zeniv.linux.org.uk> --- drivers/vhost/net.c | 82 +++++++++++++++-------------------------------------- include/linux/uio.h | 3 -- lib/iovec.c | 26 ----------------- 3 files changed, 23 insertions(+), 88 deletions(-) diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index d86cc9b..e022cc4 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c @@ -84,10 +84,6 @@ struct vhost_net_ubuf_ref { struct vhost_net_virtqueue...
2015 Feb 04
2
[PATCH v3 17/18] vhost: don't bother copying iovecs in handle_rx(), kill memcpy_toiovecend()
...c: Michael S. Tsirkin <mst at redhat.com> Cc: kvm at vger.kernel.org Cc: virtualization at lists.linux-foundation.org Signed-off-by: Al Viro <viro at zeniv.linux.org.uk> --- drivers/vhost/net.c | 82 +++++++++++++++-------------------------------------- include/linux/uio.h | 3 -- lib/iovec.c | 26 ----------------- 3 files changed, 23 insertions(+), 88 deletions(-) diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index d86cc9b..e022cc4 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c @@ -84,10 +84,6 @@ struct vhost_net_ubuf_ref { struct vhost_net_virtqueue...
2023 Mar 21
1
[PATCH v3 4/8] vringh: support VA with iotlb
...--git a/drivers/vhost/vringh.c b/drivers/vhost/vringh.c index 0ba3ef809e48..72c88519329a 100644 --- a/drivers/vhost/vringh.c +++ b/drivers/vhost/vringh.c @@ -1094,10 +1094,18 @@ EXPORT_SYMBOL(vringh_need_notify_kern); #if IS_REACHABLE(CONFIG_VHOST_IOTLB) +struct iotlb_vec { + union { + struct iovec *iovec; + struct bio_vec *bvec; + } iov; + size_t count; + bool is_iovec; +}; + static int iotlb_translate(const struct vringh *vrh, u64 addr, u64 len, u64 *translated, - struct bio_vec iov[], - int iov_size, u32 perm) + struct iotlb_vec *ivec, u32 perm) { struct vhost_io...
2015 Feb 04
1
[PATCH v3 15/18] vhost: switch vhost get_indirect() to iov_iter, kill memcpy_fromiovec()
...l Viro <viro at zeniv.linux.org.uk> Cc: Michael S. Tsirkin <mst at redhat.com> Cc: kvm at vger.kernel.org Cc: virtualization at lists.linux-foundation.org Signed-off-by: Al Viro <viro at zeniv.linux.org.uk> --- drivers/vhost/vhost.c | 6 ++++-- include/linux/uio.h | 1 - lib/iovec.c | 25 ------------------------- 3 files changed, 4 insertions(+), 28 deletions(-) diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index cb807d0..2ee2826 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c @@ -1125,6 +1125,7 @@ static int get_indirect(struct vhost_...
2015 Feb 04
1
[PATCH v3 15/18] vhost: switch vhost get_indirect() to iov_iter, kill memcpy_fromiovec()
...l Viro <viro at zeniv.linux.org.uk> Cc: Michael S. Tsirkin <mst at redhat.com> Cc: kvm at vger.kernel.org Cc: virtualization at lists.linux-foundation.org Signed-off-by: Al Viro <viro at zeniv.linux.org.uk> --- drivers/vhost/vhost.c | 6 ++++-- include/linux/uio.h | 1 - lib/iovec.c | 25 ------------------------- 3 files changed, 4 insertions(+), 28 deletions(-) diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index cb807d0..2ee2826 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c @@ -1125,6 +1125,7 @@ static int get_indirect(struct vhost_...
2015 Feb 04
1
[PATCH v3 18/18] vhost: vhost_scsi_handle_vq() should just use copy_from_user()
From: Al Viro <viro at zeniv.linux.org.uk> it has just verified that it asks no more than the length of the first segment of iovec. And with that the last user of stuff in lib/iovec.c is gone. RIP. Cc: Michael S. Tsirkin <mst at redhat.com> Cc: Nicholas A. Bellinger <nab at linux-iscsi.org> Cc: kvm at vger.kernel.org Cc: virtualization at lists.linux-foundation.org Signed-off-by: Al Viro <viro at zeniv.linux.o...
2015 Feb 04
1
[PATCH v3 18/18] vhost: vhost_scsi_handle_vq() should just use copy_from_user()
From: Al Viro <viro at zeniv.linux.org.uk> it has just verified that it asks no more than the length of the first segment of iovec. And with that the last user of stuff in lib/iovec.c is gone. RIP. Cc: Michael S. Tsirkin <mst at redhat.com> Cc: Nicholas A. Bellinger <nab at linux-iscsi.org> Cc: kvm at vger.kernel.org Cc: virtualization at lists.linux-foundation.org Signed-off-by: Al Viro <viro at zeniv.linux.o...
2023 Mar 23
1
[PATCH v3 4/8] vringh: support VA with iotlb
...x 0ba3ef809e48..72c88519329a 100644 > --- a/drivers/vhost/vringh.c > +++ b/drivers/vhost/vringh.c > @@ -1094,10 +1094,18 @@ EXPORT_SYMBOL(vringh_need_notify_kern); > > #if IS_REACHABLE(CONFIG_VHOST_IOTLB) > > +struct iotlb_vec { > + union { > + struct iovec *iovec; > + struct bio_vec *bvec; > + } iov; > + size_t count; > + bool is_iovec; I wonder if this is needed (if vringh is passed to every iotlb_vec helper). > +}; > + > static int iotlb_translate(const struct vringh *vrh, >...
2016 Jun 06
1
[PATCH] vhost/scsi: fix reuse of &vq->iov[out] in response
The address of the iovec &vq->iov[out] is not guaranteed to contain the scsi command's response iovec throughout the lifetime of the command. Rather, it is more likely to contain an iovec from an immediately following command after looping back around to vhost_get_vq_desc(). Pass along the iovec entirely inste...
2016 Jun 06
1
[PATCH] vhost/scsi: fix reuse of &vq->iov[out] in response
The address of the iovec &vq->iov[out] is not guaranteed to contain the scsi command's response iovec throughout the lifetime of the command. Rather, it is more likely to contain an iovec from an immediately following command after looping back around to vhost_get_vq_desc(). Pass along the iovec entirely inste...
2010 Sep 14
1
[PATCH] vhost: max s/g to match qemu
Qemu supports up to UIO_MAXIOV s/g so we have to match that because guest drivers may rely on this. Allocate indirect and log arrays dynamically to avoid using too much contigious memory and make the length of hdr array to match the header length since each iovec entry has a least one byte. Test with copying large files w/ and w/o migration in both linux and windows guests. Signed-off-by: Jason Wang <jasowang at redhat.com> --- drivers/vhost/net.c | 2 +- drivers/vhost/vhost.c | 49 ++++++++++++++++++++++++++++++++++++++++++++++++- drivers/v...
2010 Sep 14
1
[PATCH] vhost: max s/g to match qemu
Qemu supports up to UIO_MAXIOV s/g so we have to match that because guest drivers may rely on this. Allocate indirect and log arrays dynamically to avoid using too much contigious memory and make the length of hdr array to match the header length since each iovec entry has a least one byte. Test with copying large files w/ and w/o migration in both linux and windows guests. Signed-off-by: Jason Wang <jasowang at redhat.com> --- drivers/vhost/net.c | 2 +- drivers/vhost/vhost.c | 49 ++++++++++++++++++++++++++++++++++++++++++++++++- drivers/v...
2023 Feb 16
0
[RFC PATCH v1 07/12] vsock/virtio: MGS_ZEROCOPY flag support
...ransport, transport); > } > I'd use bool if we don't need to return an error value in the following new functions. >+static int virtio_transport_can_zcopy(struct iov_iter *iov_iter, >+ size_t free_space) >+{ >+ size_t pages; >+ int i; >+ >+ if (!iter_is_iovec(iov_iter)) >+ return -1; >+ >+ if (iov_iter->iov_offset) >+ return -1; >+ >+ /* We can't send whole iov. */ >+ if (free_space < iov_iter->count) >+ return -1; >+ >+ for (pages = 0, i = 0; i < iov_iter->nr_segs; i++) { >+ const struct iovec *io...
2013 Jun 21
5
[PATCH 3/4] xen-blkback: check the number of iovecs before allocating a bios
With the introduction of indirect segments we can receive requests with a number of segments bigger than the maximum number of allowed iovecs in a bios, so make sure that blkback doesn't try to allocate a bios with more iovecs than BIO_MAX_PAGES Signed-off-by: Roger Pau Monné <roger.pau@citrix.com> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> --- drivers/block/xen-blkback/blkback.c | 3 ++- 1 files changed, 2...
2019 Apr 11
1
[RFC 2/3] hw/virtio-rdma: VirtIO rdma device
...ry. + * + */ + +#include <infiniband/verbs.h> + +#include "qemu/osdep.h" + +#include "virtio-rdma-ib.h" +#include "../rdma_utils.h" +#include "../rdma_rm.h" +#include "../rdma_backend.h" + +int virtio_rdma_query_device(VirtIORdma *rdev, struct iovec *in, + struct iovec *out) +{ + struct ibv_device_attr attr = {}; + int offs; + size_t s; + + addrconf_addr_eui48((unsigned char *)&attr.sys_image_guid, + (const char *)&rdev->netdev->mac); + + attr.max_mr_size = 4096; +...
2023 Mar 21
5
[PATCH v3 0/8] vdpa_sim: add support for user VA
This series adds support for the use of user virtual addresses in the vDPA simulator devices. The main reason for this change is to lift the pinning of all guest memory. Especially with virtio devices implemented in software. The next step would be to generalize the code in vdpa-sim to allow the implementation of in-kernel software devices. Similar to vhost, but using vDPA so we can reuse the
2013 Aug 16
3
[PATCH] vhost: Drop linux/socket.h
On Thu, Aug 15, 2013 at 02:07:40PM -0700, David Miller wrote: > From: Asias He <asias at redhat.com> > Date: Thu, 15 Aug 2013 11:20:16 +0800 > > > memcpy_fromiovec is moved to lib/iovec.c. No need to include > > linux/socket.h for it. > > > > Signed-off-by: Asias He <asias at redhat.com> > > You can't do this. > > Because this file doesn't include the header file that > provides the declaration, which is linux...
2013 Aug 16
3
[PATCH] vhost: Drop linux/socket.h
On Thu, Aug 15, 2013 at 02:07:40PM -0700, David Miller wrote: > From: Asias He <asias at redhat.com> > Date: Thu, 15 Aug 2013 11:20:16 +0800 > > > memcpy_fromiovec is moved to lib/iovec.c. No need to include > > linux/socket.h for it. > > > > Signed-off-by: Asias He <asias at redhat.com> > > You can't do this. > > Because this file doesn't include the header file that > provides the declaration, which is linux...
2010 Mar 03
1
[RFC][ PATCH 1/3] vhost-net: support multiple buffer heads in receiver
...+++ net-next-p1/drivers/vhost/net.c 2010-03-01 11:44:22.000000000 -0800 @@ -97,7 +97,8 @@ static void handle_tx(struct vhost_net *net) { struct vhost_virtqueue *vq = &net->dev.vqs[VHOST_NET_VQ_TX]; - unsigned head, out, in, s; + unsigned out, in, s; + struct iovec head; struct msghdr msg = { .msg_name = NULL, .msg_namelen = 0, @@ -126,12 +127,10 @@ hdr_size = vq->hdr_size; for (;;) { - head = vhost_get_vq_desc(&net->dev, vq, vq->iov, -...
2010 Mar 03
1
[RFC][ PATCH 1/3] vhost-net: support multiple buffer heads in receiver
...+++ net-next-p1/drivers/vhost/net.c 2010-03-01 11:44:22.000000000 -0800 @@ -97,7 +97,8 @@ static void handle_tx(struct vhost_net *net) { struct vhost_virtqueue *vq = &net->dev.vqs[VHOST_NET_VQ_TX]; - unsigned head, out, in, s; + unsigned out, in, s; + struct iovec head; struct msghdr msg = { .msg_name = NULL, .msg_namelen = 0, @@ -126,12 +127,10 @@ hdr_size = vq->hdr_size; for (;;) { - head = vhost_get_vq_desc(&net->dev, vq, vq->iov, -...