search for: iov_iter

Displaying 20 results from an estimated 368 matches for "iov_iter".

2015 Feb 04
1
[PATCH v3 15/18] vhost: switch vhost get_indirect() to iov_iter, kill memcpy_fromiovec()
.../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_virtqueue *vq, struct vring_desc desc; unsigned int i = 0, count, found = 0; u32 len = vhost32_to_cpu(vq, indirect->len); + struct iov_iter from; int ret; /* Sanity check */ @@ -1142,6 +1143,7 @@ static int get_indirect(struct vhost_virtqueue *vq, vq_err(vq, "Translation failure %d in indirect.\n", ret); return ret; } + iov_iter_init(&from, READ, vq->indirect, ret, len); /* We will use the result as a...
2015 Feb 04
1
[PATCH v3 15/18] vhost: switch vhost get_indirect() to iov_iter, kill memcpy_fromiovec()
.../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_virtqueue *vq, struct vring_desc desc; unsigned int i = 0, count, found = 0; u32 len = vhost32_to_cpu(vq, indirect->len); + struct iov_iter from; int ret; /* Sanity check */ @@ -1142,6 +1143,7 @@ static int get_indirect(struct vhost_virtqueue *vq, vq_err(vq, "Translation failure %d in indirect.\n", ret); return ret; } + iov_iter_init(&from, READ, vq->indirect, ret, len); /* We will use the result as a...
2019 Apr 04
1
[PATCH RFC 2/4] vhost/vsock: split packets to send using multiple buffers
...++++------ 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c index bb5fc0e9fbc2..9951b7e661f6 100644 --- a/drivers/vhost/vsock.c +++ b/drivers/vhost/vsock.c @@ -94,7 +94,7 @@ vhost_transport_do_send_pkt(struct vhost_vsock *vsock, struct iov_iter iov_iter; unsigned out, in; size_t nbytes; - size_t len; + size_t iov_len, payload_len; int head; spin_lock_bh(&vsock->send_pkt_list_lock); @@ -139,8 +139,18 @@ vhost_transport_do_send_pkt(struct vhost_vsock *vsock, break; } - len = iov_length(&vq->iov[out],...
2023 May 24
4
[PATCH 0/3] vhost-scsi: Fix IO hangs when using windows
The following patches were made over Linus's tree and fix an issue where windows guests will send iovecs with offset/lengths that result in IOs that are not aligned to 512. The LIO layer will then send them to Linux's block layer but it requires 512 byte alignment, so depending on the block driver being used we will get IO errors or hung IO. The following patches have vhost-scsi detect
2018 Nov 05
2
[PATCH 2/5] VSOCK: support fill data to mergeable rx buffer in host
...y(mergeable)) + vsock_hlen = sizeof(struct virtio_vsock_pkt); + else + vsock_hlen = sizeof(struct virtio_vsock_hdr); + /* Avoid further vmexits, we're already processing the virtqueue */ vhost_disable_notify(&vsock->dev, vq); for (;;) { struct virtio_vsock_pkt *pkt; struct iov_iter iov_iter; - unsigned out, in; + unsigned out = 0, in = 0; size_t nbytes; size_t len; - int head; + s16 headcount; spin_lock_bh(&vsock->send_pkt_list_lock); if (list_empty(&vsock->send_pkt_list)) { @@ -116,16 +191,9 @@ static struct vhost_vsock *vhost_vsock_get(u32 gue...
2018 Nov 05
2
[PATCH 2/5] VSOCK: support fill data to mergeable rx buffer in host
...y(mergeable)) + vsock_hlen = sizeof(struct virtio_vsock_pkt); + else + vsock_hlen = sizeof(struct virtio_vsock_hdr); + /* Avoid further vmexits, we're already processing the virtqueue */ vhost_disable_notify(&vsock->dev, vq); for (;;) { struct virtio_vsock_pkt *pkt; struct iov_iter iov_iter; - unsigned out, in; + unsigned out = 0, in = 0; size_t nbytes; size_t len; - int head; + s16 headcount; spin_lock_bh(&vsock->send_pkt_list_lock); if (list_empty(&vsock->send_pkt_list)) { @@ -116,16 +191,9 @@ static struct vhost_vsock *vhost_vsock_get(u32 gue...
2023 Feb 16
0
[RFC PATCH v1 07/12] vsock/virtio: MGS_ZEROCOPY flag support
...c >@@ -37,6 +37,169 @@ virtio_transport_get_ops(struct vsock_sock *vsk) > return container_of(t, struct virtio_transport, 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) &g...
2018 Sep 21
2
[PATCH] vhost/scsi: truncate T10 PI iov_iter to prot_bytes
On Wed, Aug 22, 2018 at 01:21:53PM -0600, Greg Edwards wrote: > Commands with protection information included were not truncating the > protection iov_iter to the number of protection bytes in the command. > This resulted in vhost_scsi mis-calculating the size of the protection > SGL in vhost_scsi_calc_sgls(), and including both the protection and > data SG entries in the protection SGL. > > Fixes: 09b13fa8c1a1 ("vhost/scsi: Add AN...
2023 Jul 09
4
[PATCH v2 0/2] vhost-scsi: Fix IO hangs when using windows
The following patches were made over Linus's tree and fix an issue where windows guests will send iovecs with offset/lengths that result in IOs that are not aligned to 512. The LIO layer will then send them to Linux's FS/block layer but it requires 512 byte alignment, so depending on the FS/block driver being used we will get IO errors or hung IO. The following patches have vhost-scsi
2019 Aug 01
2
[PATCH v4 1/5] vsock/virtio: limit the memory used per-socket
...static void > > vhost_transport_do_send_pkt(struct vhost_vsock *vsock, > > struct vhost_virtqueue *vq) > > { ... head = vhost_get_vq_desc(vq, vq->iov, ARRAY_SIZE(vq->iov), &out, &in, NULL, NULL); ... len = iov_length(&vq->iov[out], in); iov_iter_init(&iov_iter, READ, &vq->iov[out], in, len); nbytes = copy_to_iter(&pkt->hdr, sizeof(pkt->hdr), &iov_iter); if (nbytes != sizeof(pkt->hdr)) { virtio_transport_free_pkt(pkt); vq_err(vq, "Faulted on copying pkt hdr\n"); break; } > > ......
2019 Aug 01
2
[PATCH v4 1/5] vsock/virtio: limit the memory used per-socket
...static void > > vhost_transport_do_send_pkt(struct vhost_vsock *vsock, > > struct vhost_virtqueue *vq) > > { ... head = vhost_get_vq_desc(vq, vq->iov, ARRAY_SIZE(vq->iov), &out, &in, NULL, NULL); ... len = iov_length(&vq->iov[out], in); iov_iter_init(&iov_iter, READ, &vq->iov[out], in, len); nbytes = copy_to_iter(&pkt->hdr, sizeof(pkt->hdr), &iov_iter); if (nbytes != sizeof(pkt->hdr)) { virtio_transport_free_pkt(pkt); vq_err(vq, "Faulted on copying pkt hdr\n"); break; } > > ......
2018 Dec 13
2
[PATCH] vhost: correct the related warning message
On 13.12.2018 4:10, wangyan wrote: > Fixes: 'commit d588cf8f618d ("target: Fix se_tpg_tfo->tf_subsys regression + remove tf_subsystem")' > 'commit cbbd26b8b1a6 ("[iov_iter] new primitives - copy_from_iter_full() and friends")' Fixes: d588cf8f618d ("target: Fix se_tpg_tfo->tf_subsys regression + remove tf_subsystem") Fixes: cbbd26b8b1a6 ("[iov_iter] new primitives - copy_from_iter_full() and friends") But no line wrapping allowe...
2018 Dec 13
2
[PATCH] vhost: correct the related warning message
On 13.12.2018 4:10, wangyan wrote: > Fixes: 'commit d588cf8f618d ("target: Fix se_tpg_tfo->tf_subsys regression + remove tf_subsystem")' > 'commit cbbd26b8b1a6 ("[iov_iter] new primitives - copy_from_iter_full() and friends")' Fixes: d588cf8f618d ("target: Fix se_tpg_tfo->tf_subsys regression + remove tf_subsystem") Fixes: cbbd26b8b1a6 ("[iov_iter] new primitives - copy_from_iter_full() and friends") But no line wrapping allowe...
2019 Jul 17
0
[PATCH v4 4/5] vhost/vsock: split packets to send using multiple buffers
...++++-- 2 files changed, 60 insertions(+), 21 deletions(-) diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c index 6c8390a2af52..9f57736fe15e 100644 --- a/drivers/vhost/vsock.c +++ b/drivers/vhost/vsock.c @@ -102,7 +102,7 @@ vhost_transport_do_send_pkt(struct vhost_vsock *vsock, struct iov_iter iov_iter; unsigned out, in; size_t nbytes; - size_t len; + size_t iov_len, payload_len; int head; spin_lock_bh(&vsock->send_pkt_list_lock); @@ -147,8 +147,24 @@ vhost_transport_do_send_pkt(struct vhost_vsock *vsock, break; } - len = iov_length(&vq->iov[out],...
2023 Feb 16
0
[RFC PATCH v1 04/12] vhost/vsock: non-linear skb handling support
...9c885cc..60b9cafa3e31 100644 >--- a/drivers/vhost/vsock.c >+++ b/drivers/vhost/vsock.c >@@ -86,6 +86,44 @@ static struct vhost_vsock *vhost_vsock_get(u32 guest_cid) > return NULL; > } > >+static int vhost_transport_copy_nonlinear_skb(struct sk_buff *skb, >+ struct iov_iter *iov_iter, >+ size_t len) >+{ >+ size_t rest_len = len; >+ >+ while (rest_len && virtio_vsock_skb_has_frags(skb)) { >+ struct bio_vec *curr_vec; >+ size_t curr_vec_end; >+ size_t to_copy; >+ int curr_frag; >+ int curr_offs; >+ >+ curr_frag...
2023 Sep 04
0
[PATCH net-next v7 4/4] vsock/virtio: MSG_ZEROCOPY flag support
...t; ????????????????????????????????????????????? ^ >> I'd call it `pkt_len`, `max_to_send` is confusing IMHO. I didn't >> initially if it was the number of buffers or bytes. >> >>> +{ >>> +??? const struct virtio_transport *t_ops; >>> +??? struct iov_iter *iov_iter; >>> + >>> +??? if (!info->msg) >>> +??????? return false; >>> + >>> +??? iov_iter = &info->msg->msg_iter; >>> + >>> +??? if (iov_iter->iov_offset) >>> +??????? return false; >>> + >>&gt...
2019 Sep 01
3
[PATCH v4 1/5] vsock/virtio: limit the memory used per-socket
...host_virtqueue *vq) > > > > { > > ... > > > > head = vhost_get_vq_desc(vq, vq->iov, ARRAY_SIZE(vq->iov), > > &out, &in, NULL, NULL); > > > > ... > > > > len = iov_length(&vq->iov[out], in); > > iov_iter_init(&iov_iter, READ, &vq->iov[out], in, len); > > > > nbytes = copy_to_iter(&pkt->hdr, sizeof(pkt->hdr), &iov_iter); > > if (nbytes != sizeof(pkt->hdr)) { > > virtio_transport_free_pkt(pkt); > > vq_err(vq, "Faulted on copyin...
2019 Sep 01
3
[PATCH v4 1/5] vsock/virtio: limit the memory used per-socket
...host_virtqueue *vq) > > > > { > > ... > > > > head = vhost_get_vq_desc(vq, vq->iov, ARRAY_SIZE(vq->iov), > > &out, &in, NULL, NULL); > > > > ... > > > > len = iov_length(&vq->iov[out], in); > > iov_iter_init(&iov_iter, READ, &vq->iov[out], in, len); > > > > nbytes = copy_to_iter(&pkt->hdr, sizeof(pkt->hdr), &iov_iter); > > if (nbytes != sizeof(pkt->hdr)) { > > virtio_transport_free_pkt(pkt); > > vq_err(vq, "Faulted on copyin...
2016 Jun 06
1
[PATCH] vhost/scsi: fix reuse of &vq->iov[out] in response
.../* Pointer to vhost_scsi for our device */ struct vhost_scsi *tvc_vhost; /* Pointer to vhost_virtqueue for the cmd */ @@ -557,7 +557,7 @@ static void vhost_scsi_complete_cmd_work(struct vhost_work *work) memcpy(v_rsp.sense, cmd->tvc_sense_buf, se_cmd->scsi_sense_length); - iov_iter_init(&iov_iter, READ, cmd->tvc_resp_iov, + iov_iter_init(&iov_iter, READ, &cmd->tvc_resp_iov, cmd->tvc_in_iovs, sizeof(v_rsp)); ret = copy_to_iter(&v_rsp, sizeof(v_rsp), &iov_iter); if (likely(ret == sizeof(v_rsp))) { @@ -1054,7 +1054,7 @@ vhost_scsi_ha...
2016 Jun 06
1
[PATCH] vhost/scsi: fix reuse of &vq->iov[out] in response
.../* Pointer to vhost_scsi for our device */ struct vhost_scsi *tvc_vhost; /* Pointer to vhost_virtqueue for the cmd */ @@ -557,7 +557,7 @@ static void vhost_scsi_complete_cmd_work(struct vhost_work *work) memcpy(v_rsp.sense, cmd->tvc_sense_buf, se_cmd->scsi_sense_length); - iov_iter_init(&iov_iter, READ, cmd->tvc_resp_iov, + iov_iter_init(&iov_iter, READ, &cmd->tvc_resp_iov, cmd->tvc_in_iovs, sizeof(v_rsp)); ret = copy_to_iter(&v_rsp, sizeof(v_rsp), &iov_iter); if (likely(ret == sizeof(v_rsp))) { @@ -1054,7 +1054,7 @@ vhost_scsi_ha...