search for: vhost_scsi_handle_vq

Displaying 20 results from an estimated 104 matches for "vhost_scsi_handle_vq".

2018 Sep 21
2
[PATCH] vhost/scsi: truncate T10 PI iov_iter to prot_bytes
...otection 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 ANY_LAYOUT support in vhost_scsi_handle_vq") > Signed-off-by: Greg Edwards <gedwards at ddn.com> Any thoughts on this patch? > --- > drivers/vhost/scsi.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c > index 76f8d649147b..cbe0ea26c...
2013 Mar 22
4
[PATCH V2 0/3] tcm_vhost pending requests flush
...hanges in v2: - Increase/Decrease inflight requests in vhost_scsi_{allocate,free}_cmd and tcm_vhost_{allocate,free}_evt Asias He (3): tcm_vhost: Wait for pending requests in vhost_scsi_flush() tcm_vhost: Wait for pending requests in vhost_scsi_clear_endpoint() tcm_vhost: Fix tv_cmd leak in vhost_scsi_handle_vq drivers/vhost/tcm_vhost.c | 131 ++++++++++++++++++++++++++++++++++++++-------- drivers/vhost/tcm_vhost.h | 4 ++ 2 files changed, 112 insertions(+), 23 deletions(-) -- 1.8.1.4
2013 Mar 22
4
[PATCH V2 0/3] tcm_vhost pending requests flush
...hanges in v2: - Increase/Decrease inflight requests in vhost_scsi_{allocate,free}_cmd and tcm_vhost_{allocate,free}_evt Asias He (3): tcm_vhost: Wait for pending requests in vhost_scsi_flush() tcm_vhost: Wait for pending requests in vhost_scsi_clear_endpoint() tcm_vhost: Fix tv_cmd leak in vhost_scsi_handle_vq drivers/vhost/tcm_vhost.c | 131 ++++++++++++++++++++++++++++++++++++++-------- drivers/vhost/tcm_vhost.h | 4 ++ 2 files changed, 112 insertions(+), 23 deletions(-) -- 1.8.1.4
2015 Feb 04
1
[PATCH v3 18/18] vhost: vhost_scsi_handle_vq() should just use copy_from_user()
...c | 36 ------------------------------------ 4 files changed, 2 insertions(+), 40 deletions(-) delete mode 100644 lib/iovec.c diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c index d695b16..dc78d87 100644 --- a/drivers/vhost/scsi.c +++ b/drivers/vhost/scsi.c @@ -1079,7 +1079,7 @@ vhost_scsi_handle_vq(struct vhost_scsi *vs, struct vhost_virtqueue *vq) req_size, vq->iov[0].iov_len); break; } - ret = memcpy_fromiovecend(req, &vq->iov[0], 0, req_size); + ret = copy_from_user(req, vq->iov[0].iov_base, req_size); if (unlikely(ret)) { vq_err(vq, "Faulted on...
2015 Feb 04
1
[PATCH v3 18/18] vhost: vhost_scsi_handle_vq() should just use copy_from_user()
...c | 36 ------------------------------------ 4 files changed, 2 insertions(+), 40 deletions(-) delete mode 100644 lib/iovec.c diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c index d695b16..dc78d87 100644 --- a/drivers/vhost/scsi.c +++ b/drivers/vhost/scsi.c @@ -1079,7 +1079,7 @@ vhost_scsi_handle_vq(struct vhost_scsi *vs, struct vhost_virtqueue *vq) req_size, vq->iov[0].iov_len); break; } - ret = memcpy_fromiovecend(req, &vq->iov[0], 0, req_size); + ret = copy_from_user(req, vq->iov[0].iov_base, req_size); if (unlikely(ret)) { vq_err(vq, "Faulted on...
2013 Apr 02
1
[PATCH] tcm_vhost: Use ACCESS_ONCE for vs->vs_tpg[target] access
In vhost_scsi_handle_vq: tv_tpg = vs->vs_tpg[target]; if (!tv_tpg) { .... return } tv_cmd = vhost_scsi_allocate_cmd(tv_tpg, &v_req, 1) vs->vs_tpg[target] might change after the NULL check and 2) the above line might access tv_tpg from vs->vs_tpg[target]....
2013 Apr 02
1
[PATCH] tcm_vhost: Use ACCESS_ONCE for vs->vs_tpg[target] access
In vhost_scsi_handle_vq: tv_tpg = vs->vs_tpg[target]; if (!tv_tpg) { .... return } tv_cmd = vhost_scsi_allocate_cmd(tv_tpg, &v_req, 1) vs->vs_tpg[target] might change after the NULL check and 2) the above line might access tv_tpg from vs->vs_tpg[target]....
2013 Mar 11
4
[PATCH] tcm_vhost: Wait for pending requests in vhost_scsi_flush()
...ost_cmd *vhost_scsi_allocate_cmd( tv_cmd->tvc_exp_data_len = exp_data_len; tv_cmd->tvc_data_direction = data_direction; tv_cmd->tvc_nexus = tv_nexus; + tv_cmd->tvc_vhost = vs; + tv_cmd->inflight = tcm_vhost_inc_inflight(vs); return tv_cmd; } @@ -847,7 +906,7 @@ static void vhost_scsi_handle_vq(struct vhost_scsi *vs, for (i = 0; i < data_num; i++) exp_data_len += vq->iov[data_first + i].iov_len; - tv_cmd = vhost_scsi_allocate_cmd(tv_tpg, &v_req, + tv_cmd = vhost_scsi_allocate_cmd(vs, tv_tpg, &v_req, exp_data_len, data_direction); if (IS_ERR(tv_cmd)) {...
2013 Mar 11
4
[PATCH] tcm_vhost: Wait for pending requests in vhost_scsi_flush()
...ost_cmd *vhost_scsi_allocate_cmd( tv_cmd->tvc_exp_data_len = exp_data_len; tv_cmd->tvc_data_direction = data_direction; tv_cmd->tvc_nexus = tv_nexus; + tv_cmd->tvc_vhost = vs; + tv_cmd->inflight = tcm_vhost_inc_inflight(vs); return tv_cmd; } @@ -847,7 +906,7 @@ static void vhost_scsi_handle_vq(struct vhost_scsi *vs, for (i = 0; i < data_num; i++) exp_data_len += vq->iov[data_first + i].iov_len; - tv_cmd = vhost_scsi_allocate_cmd(tv_tpg, &v_req, + tv_cmd = vhost_scsi_allocate_cmd(vs, tv_tpg, &v_req, exp_data_len, data_direction); if (IS_ERR(tv_cmd)) {...
2014 Jul 01
0
[PATCH RFC 2/2] vhost: support urgent descriptors
...iov[out].iov_base; ret = __copy_to_user(resp, &rsp, sizeof(rsp)); if (!ret) - vhost_add_used_and_signal(&vs->dev, vq, head, 0); + vhost_add_used_and_signal(&vs->dev, vq, urgent, head, 0); else pr_err("Faulted on virtio_scsi_cmd_resp\n"); } @@ -980,6 +985,7 @@ vhost_scsi_handle_vq(struct vhost_scsi *vs, struct vhost_virtqueue *vq) u8 *target, *lunp, task_attr; bool hdr_pi; void *req, *cdb; + bool urgent; mutex_lock(&vq->mutex); /* @@ -993,7 +999,7 @@ vhost_scsi_handle_vq(struct vhost_scsi *vs, struct vhost_virtqueue *vq) vhost_disable_notify(&vs->...
2013 Oct 25
2
[PATCH] vhost/scsi: Fix incorrect usage of get_user_pages_fast write parameter
...Nicholas Bellinger <nab at linux-iscsi.org> --- drivers/vhost/scsi.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c index ce5221f..e663921 100644 --- a/drivers/vhost/scsi.c +++ b/drivers/vhost/scsi.c @@ -1056,7 +1056,7 @@ vhost_scsi_handle_vq(struct vhost_scsi *vs, struct vhost_virtqueue *vq) if (data_direction != DMA_NONE) { ret = vhost_scsi_map_iov_to_sgl(cmd, &vq->iov[data_first], data_num, - data_direction == DMA_TO_DEVICE); + data_direction == DMA_FROM_DEVICE); if (unlikely(ret)) { vq_err(vq, &q...
2013 Oct 25
2
[PATCH] vhost/scsi: Fix incorrect usage of get_user_pages_fast write parameter
...Nicholas Bellinger <nab at linux-iscsi.org> --- drivers/vhost/scsi.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c index ce5221f..e663921 100644 --- a/drivers/vhost/scsi.c +++ b/drivers/vhost/scsi.c @@ -1056,7 +1056,7 @@ vhost_scsi_handle_vq(struct vhost_scsi *vs, struct vhost_virtqueue *vq) if (data_direction != DMA_NONE) { ret = vhost_scsi_map_iov_to_sgl(cmd, &vq->iov[data_first], data_num, - data_direction == DMA_TO_DEVICE); + data_direction == DMA_FROM_DEVICE); if (unlikely(ret)) { vq_err(vq, &q...
2013 Jan 31
1
[PATCH] tcm_vhost: Multi-target support
...struct vhost_work vs_completion_work; /* cmd completion work item */ struct llist_head vs_completion_list; /* cmd completion queue */ + char vs_vhost_wwpn[TRANSPORT_IQN_LEN]; + int vs_num_target; }; /* Local pointer to allocated TCM configfs fabric module */ @@ -564,13 +569,7 @@ static void vhost_scsi_handle_vq(struct vhost_scsi *vs) u32 exp_data_len, data_first, data_num, data_direction; unsigned out, in, i; int head, ret; - - /* Must use ioctl VHOST_SCSI_SET_ENDPOINT */ - tv_tpg = vs->vs_tpg; - if (unlikely(!tv_tpg)) { - pr_err("%s endpoint not set\n", __func__); - return; - } + u8...
2013 Jan 31
1
[PATCH] tcm_vhost: Multi-target support
...struct vhost_work vs_completion_work; /* cmd completion work item */ struct llist_head vs_completion_list; /* cmd completion queue */ + char vs_vhost_wwpn[TRANSPORT_IQN_LEN]; + int vs_num_target; }; /* Local pointer to allocated TCM configfs fabric module */ @@ -564,13 +569,7 @@ static void vhost_scsi_handle_vq(struct vhost_scsi *vs) u32 exp_data_len, data_first, data_num, data_direction; unsigned out, in, i; int head, ret; - - /* Must use ioctl VHOST_SCSI_SET_ENDPOINT */ - tv_tpg = vs->vs_tpg; - if (unlikely(!tv_tpg)) { - pr_err("%s endpoint not set\n", __func__); - return; - } + u8...
2013 May 03
5
[PATCH 0/5] vhost-scsi cleanup
Asias He (5): vhost-scsi: Remove unnecessary forward struct vhost_scsi declaration vhost-scsi: Rename struct vhost_scsi *s to *vs vhost-scsi: Make func indention more consistent vhost-scsi: Rename struct tcm_vhost_tpg *tv_tpg to *tpg vhost-scsi: Rename struct tcm_vhost_cmd *tv_cmd to *cmd drivers/vhost/scsi.c | 469 +++++++++++++++++++++++++++------------------------ 1 file changed,
2013 May 03
5
[PATCH 0/5] vhost-scsi cleanup
Asias He (5): vhost-scsi: Remove unnecessary forward struct vhost_scsi declaration vhost-scsi: Rename struct vhost_scsi *s to *vs vhost-scsi: Make func indention more consistent vhost-scsi: Rename struct tcm_vhost_tpg *tv_tpg to *tpg vhost-scsi: Rename struct tcm_vhost_cmd *tv_cmd to *cmd drivers/vhost/scsi.c | 469 +++++++++++++++++++++++++++------------------------ 1 file changed,
2017 Jan 12
1
[patch] vhost/scsi: silence uninitialized variable warning
...are declared as just "unsigned" without the "int". Signed-off-by: Dan Carpenter <dan.carpenter at oracle.com> diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c index 253310c..b98dac1 100644 --- a/drivers/vhost/scsi.c +++ b/drivers/vhost/scsi.c @@ -843,7 +843,7 @@ vhost_scsi_handle_vq(struct vhost_scsi *vs, struct vhost_virtqueue *vq) struct iov_iter out_iter, in_iter, prot_iter, data_iter; u64 tag; u32 exp_data_len, data_direction; - unsigned out, in; + unsigned int out = 0, in = 0; int head, ret, prot_bytes; size_t req_size, rsp_size = sizeof(struct virtio_scsi_cmd_r...
2020 Sep 22
1
[PATCH 4/8] vhost scsi: fix cmd completion race
On 2020-09-21 11:23, Mike Christie wrote: > We might not do the final se_cmd put from vhost_scsi_complete_cmd_work. > If the last put happens a little later then we could race where > vhost_scsi_complete_cmd_work does vhost_signal, the guest runs and sends > more IO, and vhost_scsi_handle_vq runs but does not find any free cmds. > > This patch has us delay completing the cmd until the last lio core ref > is dropped. We then know that once we signal to the guest that the cmd > is completed that if it queues a new command it will find a free cmd. It seems weird to me to see...
2017 Jan 12
1
[patch] vhost/scsi: silence uninitialized variable warning
...are declared as just "unsigned" without the "int". Signed-off-by: Dan Carpenter <dan.carpenter at oracle.com> diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c index 253310c..b98dac1 100644 --- a/drivers/vhost/scsi.c +++ b/drivers/vhost/scsi.c @@ -843,7 +843,7 @@ vhost_scsi_handle_vq(struct vhost_scsi *vs, struct vhost_virtqueue *vq) struct iov_iter out_iter, in_iter, prot_iter, data_iter; u64 tag; u32 exp_data_len, data_direction; - unsigned out, in; + unsigned int out = 0, in = 0; int head, ret, prot_bytes; size_t req_size, rsp_size = sizeof(struct virtio_scsi_cmd_r...
2014 Nov 24
0
[PATCH v3 40/41] vhost/scsi: partial virtio 1.0 support
...e_cmd->scsi_sense_length); memcpy(v_rsp.sense, cmd->tvc_sense_buf, - v_rsp.sense_len); + se_cmd->scsi_sense_length); ret = copy_to_user(cmd->tvc_resp, &v_rsp, sizeof(v_rsp)); if (likely(ret == 0)) { struct vhost_scsi_virtqueue *q; @@ -1095,14 +1097,14 @@ vhost_scsi_handle_vq(struct vhost_scsi *vs, struct vhost_virtqueue *vq) ", but wrong data_direction\n"); goto err_cmd; } - prot_bytes = v_req_pi.pi_bytesout; + prot_bytes = vhost32_to_cpu(vq, v_req_pi.pi_bytesout); } else if (v_req_pi.pi_bytesin) { if (data_direction != DMA_FR...