Displaying 20 results from an estimated 98 matches for "vhost_scsi_complete_cmd_work".
2017 Nov 09
2
[PATCH] vhost/scsi: Use safe iteration in vhost_scsi_complete_cmd_work()
I am sorry for having made a mistake on it.
-----8<-----
>From ba9a0f76dffceffa4fa3aa2d9be49cdb0d9b7d4f Mon Sep 17 00:00:00 2001
From: Byungchul Park <byungchul.park at lge.com>
Date: Thu, 9 Nov 2017 09:00:21 +0900
Subject: [PATCH] vhost/scsi: Use safe iteration in vhost_scsi_complete_cmd_work()
The following patch changed the behavior which originally did safe
iteration. Make it safe as it was.
12bdcbd539c6327c09da0503c674733cb2d82cb5
vhost/scsi: Don't reinvent the wheel but use existing llist API
Signed-off-by: Byungchul Park <byungchul.park at lge.com>
---
drivers/...
2017 Nov 09
2
[PATCH] vhost/scsi: Use safe iteration in vhost_scsi_complete_cmd_work()
I am sorry for having made a mistake on it.
-----8<-----
>From ba9a0f76dffceffa4fa3aa2d9be49cdb0d9b7d4f Mon Sep 17 00:00:00 2001
From: Byungchul Park <byungchul.park at lge.com>
Date: Thu, 9 Nov 2017 09:00:21 +0900
Subject: [PATCH] vhost/scsi: Use safe iteration in vhost_scsi_complete_cmd_work()
The following patch changed the behavior which originally did safe
iteration. Make it safe as it was.
12bdcbd539c6327c09da0503c674733cb2d82cb5
vhost/scsi: Don't reinvent the wheel but use existing llist API
Signed-off-by: Byungchul Park <byungchul.park at lge.com>
---
drivers/...
2017 Nov 16
0
[PATCH] vhost/scsi: Use safe iteration in vhost_scsi_complete_cmd_work()
...ch in my tree.
> > -----8<-----
> > >From ba9a0f76dffceffa4fa3aa2d9be49cdb0d9b7d4f Mon Sep 17 00:00:00 2001
> > From: Byungchul Park <byungchul.park at lge.com>
> > Date: Thu, 9 Nov 2017 09:00:21 +0900
> > Subject: [PATCH] vhost/scsi: Use safe iteration in vhost_scsi_complete_cmd_work()
> >
> > The following patch changed the behavior which originally did safe
> > iteration. Make it safe as it was.
> >
> > 12bdcbd539c6327c09da0503c674733cb2d82cb5
> > vhost/scsi: Don't reinvent the wheel but use existing llist API
> >
> &g...
2017 Nov 15
1
[PATCH] vhost/scsi: Use safe iteration in vhost_scsi_complete_cmd_work()
...e original
behavior.
Thanks,
Byungchul
> -----8<-----
> >From ba9a0f76dffceffa4fa3aa2d9be49cdb0d9b7d4f Mon Sep 17 00:00:00 2001
> From: Byungchul Park <byungchul.park at lge.com>
> Date: Thu, 9 Nov 2017 09:00:21 +0900
> Subject: [PATCH] vhost/scsi: Use safe iteration in vhost_scsi_complete_cmd_work()
>
> The following patch changed the behavior which originally did safe
> iteration. Make it safe as it was.
>
> 12bdcbd539c6327c09da0503c674733cb2d82cb5
> vhost/scsi: Don't reinvent the wheel but use existing llist API
>
> Signed-off-by: Byungchul Park <byu...
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 c...
2013 Jan 06
3
[PATCH] tcm_vhost: Use llist for cmd completion list
...->tvc_completion_list);
- break;
- }
- spin_unlock_bh(&vs->vs_completion_lock);
- return tv_cmd;
-}
-
/* Fill in status and signal that we are done processing this command
*
* This is scheduled in the vhost work queue so we are called with the owner
@@ -377,12 +354,18 @@ static void vhost_scsi_complete_cmd_work(struct vhost_work *work)
{
struct vhost_scsi *vs = container_of(work, struct vhost_scsi,
vs_completion_work);
+ struct virtio_scsi_cmd_resp v_rsp;
struct tcm_vhost_cmd *tv_cmd;
+ struct llist_node *llnode;
+ struct se_cmd *se_cmd;
+ int ret;
- while ((tv_cmd = vhost_scsi_get_cmd_from_c...
2013 Jan 06
3
[PATCH] tcm_vhost: Use llist for cmd completion list
...->tvc_completion_list);
- break;
- }
- spin_unlock_bh(&vs->vs_completion_lock);
- return tv_cmd;
-}
-
/* Fill in status and signal that we are done processing this command
*
* This is scheduled in the vhost work queue so we are called with the owner
@@ -377,12 +354,18 @@ static void vhost_scsi_complete_cmd_work(struct vhost_work *work)
{
struct vhost_scsi *vs = container_of(work, struct vhost_scsi,
vs_completion_work);
+ struct virtio_scsi_cmd_resp v_rsp;
struct tcm_vhost_cmd *tv_cmd;
+ struct llist_node *llnode;
+ struct se_cmd *se_cmd;
+ int ret;
- while ((tv_cmd = vhost_scsi_get_cmd_from_c...
2013 Mar 11
4
[PATCH] tcm_vhost: Wait for pending requests in vhost_scsi_flush()
..._evt_work(struct vhost_work *work)
while (llnode) {
evt = llist_entry(llnode, struct tcm_vhost_evt, list);
llnode = llist_next(llnode);
- tcm_vhost_do_evt_work(vs, &evt->event);
+ tcm_vhost_do_evt_work(vs, evt);
tcm_vhost_free_evt(vs, evt);
}
}
@@ -568,6 +624,7 @@ static void vhost_scsi_complete_cmd_work(struct vhost_work *work)
}
static struct tcm_vhost_cmd *vhost_scsi_allocate_cmd(
+ struct vhost_scsi *vs,
struct tcm_vhost_tpg *tv_tpg,
struct virtio_scsi_cmd_req *v_req,
u32 exp_data_len,
@@ -592,6 +649,8 @@ static struct tcm_vhost_cmd *vhost_scsi_allocate_cmd(
tv_cmd->tvc_exp_data_...
2013 Mar 11
4
[PATCH] tcm_vhost: Wait for pending requests in vhost_scsi_flush()
..._evt_work(struct vhost_work *work)
while (llnode) {
evt = llist_entry(llnode, struct tcm_vhost_evt, list);
llnode = llist_next(llnode);
- tcm_vhost_do_evt_work(vs, &evt->event);
+ tcm_vhost_do_evt_work(vs, evt);
tcm_vhost_free_evt(vs, evt);
}
}
@@ -568,6 +624,7 @@ static void vhost_scsi_complete_cmd_work(struct vhost_work *work)
}
static struct tcm_vhost_cmd *vhost_scsi_allocate_cmd(
+ struct vhost_scsi *vs,
struct tcm_vhost_tpg *tv_tpg,
struct virtio_scsi_cmd_req *v_req,
u32 exp_data_len,
@@ -592,6 +649,8 @@ static struct tcm_vhost_cmd *vhost_scsi_allocate_cmd(
tv_cmd->tvc_exp_data_...
2013 Mar 22
0
[PATCH] tcm_vhost: Use vs for struct vhost_scsi
...tatic int vhost_scsi_open(struct inode *inode, struct file *f)
{
- struct vhost_scsi *s;
+ struct vhost_scsi *vs;
int r, i;
- s = kzalloc(sizeof(*s), GFP_KERNEL);
- if (!s)
+ vs = kzalloc(sizeof(*vs), GFP_KERNEL);
+ if (!vs)
return -ENOMEM;
- vhost_work_init(&s->vs_completion_work, vhost_scsi_complete_cmd_work);
- vhost_work_init(&s->vs_event_work, tcm_vhost_evt_work);
+ vhost_work_init(&vs->vs_completion_work, vhost_scsi_complete_cmd_work);
+ vhost_work_init(&vs->vs_event_work, tcm_vhost_evt_work);
- s->vs_events_nr = 0;
- s->vs_inflight[0] = 0;
- s->vs_inflight[1] = 0;
-...
2013 Mar 22
0
[PATCH] tcm_vhost: Use vs for struct vhost_scsi
...tatic int vhost_scsi_open(struct inode *inode, struct file *f)
{
- struct vhost_scsi *s;
+ struct vhost_scsi *vs;
int r, i;
- s = kzalloc(sizeof(*s), GFP_KERNEL);
- if (!s)
+ vs = kzalloc(sizeof(*vs), GFP_KERNEL);
+ if (!vs)
return -ENOMEM;
- vhost_work_init(&s->vs_completion_work, vhost_scsi_complete_cmd_work);
- vhost_work_init(&s->vs_event_work, tcm_vhost_evt_work);
+ vhost_work_init(&vs->vs_completion_work, vhost_scsi_complete_cmd_work);
+ vhost_work_init(&vs->vs_event_work, tcm_vhost_evt_work);
- s->vs_events_nr = 0;
- s->vs_inflight[0] = 0;
- s->vs_inflight[1] = 0;
-...
2016 Jun 06
1
[PATCH] vhost/scsi: fix reuse of &vq->iov[out] in response
...*tvc_prot_sgl;
struct page **tvc_upages;
/* Pointer to response header iovec */
- struct iovec *tvc_resp_iov;
+ struct iovec tvc_resp_iov;
/* 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...
2016 Jun 06
1
[PATCH] vhost/scsi: fix reuse of &vq->iov[out] in response
...*tvc_prot_sgl;
struct page **tvc_upages;
/* Pointer to response header iovec */
- struct iovec *tvc_resp_iov;
+ struct iovec tvc_resp_iov;
/* 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...
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,
2012 Jul 30
0
[PATCH] tcm_vhost: Post-merge review changes requested by MST
From: Nicholas Bellinger <nab at linux-iscsi.org>
This patch contains the post RFC-v5 (post-merge) changes, this includes:
- Add locking comment
- Move vhost_scsi_complete_cmd ahead of TFO callbacks in order to
drop forward declarations
- Drop extra '!= NULL' usage in vhost_scsi_complete_cmd_work()
- Change vhost_scsi_*_handle_kick() to use pr_debug
- Fix possible race in vhost_scsi_set_endpoint() for vs->vs_tpg checking
+ assignment.
- Convert tv_tpg->tpg_vhost_count + ->tv_tpg_port_count from atomic_t ->
int, and make sure reference is protected by ->tv_tpg_mutex.
- Dro...
2012 Jul 30
0
[PATCH] tcm_vhost: Post-merge review changes requested by MST
From: Nicholas Bellinger <nab at linux-iscsi.org>
This patch contains the post RFC-v5 (post-merge) changes, this includes:
- Add locking comment
- Move vhost_scsi_complete_cmd ahead of TFO callbacks in order to
drop forward declarations
- Drop extra '!= NULL' usage in vhost_scsi_complete_cmd_work()
- Change vhost_scsi_*_handle_kick() to use pr_debug
- Fix possible race in vhost_scsi_set_endpoint() for vs->vs_tpg checking
+ assignment.
- Convert tv_tpg->tpg_vhost_count + ->tv_tpg_port_count from atomic_t ->
int, and make sure reference is protected by ->tv_tpg_mutex.
- Dro...
2013 Sep 17
3
[PATCH] vhost/scsi: use vmalloc for order-10 allocation
...FP_NOWARN | __GFP_REPEAT);
+ if (!vs) {
+ vs = vzalloc(sizeof(*vs));
+ if (!vs)
+ goto err_vs;
+ }
vqs = kmalloc(VHOST_SCSI_MAX_VQ * sizeof(*vqs), GFP_KERNEL);
- if (!vqs) {
- kfree(vs);
- return -ENOMEM;
- }
+ if (!vqs)
+ goto err_vqs;
vhost_work_init(&vs->vs_completion_work, vhost_scsi_complete_cmd_work);
vhost_work_init(&vs->vs_event_work, tcm_vhost_evt_work);
@@ -1407,14 +1416,18 @@ static int vhost_scsi_open(struct inode *inode, struct file *f)
tcm_vhost_init_inflight(vs, NULL);
- if (r < 0) {
- kfree(vqs);
- kfree(vs);
- return r;
- }
+ if (r < 0)
+ goto err_init;...
2013 Sep 17
3
[PATCH] vhost/scsi: use vmalloc for order-10 allocation
...FP_NOWARN | __GFP_REPEAT);
+ if (!vs) {
+ vs = vzalloc(sizeof(*vs));
+ if (!vs)
+ goto err_vs;
+ }
vqs = kmalloc(VHOST_SCSI_MAX_VQ * sizeof(*vqs), GFP_KERNEL);
- if (!vqs) {
- kfree(vs);
- return -ENOMEM;
- }
+ if (!vqs)
+ goto err_vqs;
vhost_work_init(&vs->vs_completion_work, vhost_scsi_complete_cmd_work);
vhost_work_init(&vs->vs_event_work, tcm_vhost_evt_work);
@@ -1407,14 +1416,18 @@ static int vhost_scsi_open(struct inode *inode, struct file *f)
tcm_vhost_init_inflight(vs, NULL);
- if (r < 0) {
- kfree(vqs);
- kfree(vs);
- return r;
- }
+ if (r < 0)
+ goto err_init;...
2013 Apr 27
2
[PATCH v6 0/2] tcm_vhost flush
Changes in v6:
- Allow device specific fields per vq
- Track cmd per vq
- Do not track evt
- Switch to static array for inflight allocation, completely get rid of the
pain to handle inflight allocation failure.
Asias He (2):
vhost: Allow device specific fields per vq
tcm_vhost: Wait for pending requests in vhost_scsi_flush()
drivers/vhost/net.c | 60 +++++++++++--------