Re: [PATCH 01/10] esp_scsi: spellcheck 'driver'

2014-11-21 Thread Paolo Bonzini
> --- a/drivers/scsi/esp_scsi.h > +++ b/drivers/scsi/esp_scsi.h > @@ -1,4 +1,4 @@ > -/* esp_scsi.h: Defines and structures for the ESP drier. > +/* esp_scsi.h: Defines and structures for the ESP driver. > * > * Copyright (C) 2007 David S. Miller (da...@davemloft.net) > */ >

Re: [PATCH V1] virtio_scsi: support multi hw queue of blk-mq

2014-11-17 Thread Paolo Bonzini
On 15/11/2014 04:47, Ming Lei wrote: > Since virtio_scsi has supported multi virtqueue already, > it is natural to map the virtque to hw-queue of blk-mq. > > Cc: Paolo Bonzini > Signed-off-by: Ming Lei > --- > V1: > - support non-mq too > > dri

Re: [PATCH 2/2] virtio_scsi: support multi hw queue of blk-mq

2014-11-11 Thread Paolo Bonzini
On 10/11/2014 17:05, Christoph Hellwig wrote: > > a) there is no multiath support for it, and we simply can't break existing > setups that use. > b) there is no support for I/O schedulers at all. This might be okay > for virtio-scsi, where in general you have a host scheduler, but for

Re: [PATCH 2/3] sd: Disable discard_zeroes_data for UNMAP

2014-11-10 Thread Paolo Bonzini
D_LBP_WS16); > else if (sdkp->lbpws10) > sd_config_discard(sdkp, SD_LBP_WS10); > + else if (sdkp->lbpu && sdkp->max_unmap_blocks) > + sd_config_discard(sdkp, SD_LBP_UNMAP)

Re: [PATCH 2/2] virtio_scsi: support multi hw queue of blk-mq

2014-11-10 Thread Paolo Bonzini
On 09/11/2014 17:57, Ming Lei wrote: > Since virtio_scsi has supported multi virtqueue already, > it is natural to map virtque to hw-queue of blk-mq. > > Cc: Paolo Bonzini > Signed-off-by: Ming Lei > --- > drivers/scsi/virtio_scsi.c | 154 > -

Re: [PATCH] vhost-scsi: Take configfs group dependency during VHOST_SCSI_SET_ENDPOINT

2014-10-09 Thread Paolo Bonzini
Il 09/10/2014 10:49, Paolo Bonzini ha scritto: > > It does not happen if you close QEMU with SIGTERM, ctrl-c, or with the > "quit" command, because no attempt is done to bring down the VM data > structures (or free memory, or close file descriptors) in case of a > fatal

Re: [PATCH] vhost-scsi: Take configfs group dependency during VHOST_SCSI_SET_ENDPOINT

2014-10-09 Thread Paolo Bonzini
Il 09/10/2014 06:14, Nicholas A. Bellinger ha scritto: > AFAICT from qemu code, the ioctl VHOST_SCSI_CLEAR_ENDPOINT is always > called during shutdown in order to release the endpoint and drop this > new configfs dependency. As far as I can see, the only path leading to the ioctl is vhost_scsi_set

Re: Debugging scsi abort handling ?

2014-08-29 Thread Paolo Bonzini
Il 29/08/2014 08:08, Hannes Reinecke ha scritto: >> > No. > FAILED for any eh_abort_cmd() means that the TMF hasn't been sent. > So the midlayer escalates to the next EH step. > The command will only ever be re-issued once EH completes. Then the answer to Hans's question is yes. It is legal to ca

Re: Debugging scsi abort handling ?

2014-08-28 Thread Paolo Bonzini
Il 28/08/2014 17:50, Elliott, Robert (Server Storage) ha scritto: > Is the block layer prevented from issuing a new command with the > same tag before the error handling is finished? Tags are chosen by the LLDs, so it's up to it to pick the right tags. Paolo -- To unsubscribe from this list: send

Re: Debugging scsi abort handling ?

2014-08-28 Thread Paolo Bonzini
Il 28/08/2014 16:17, Hannes Reinecke ha scritto: >> > As mentioned earlier, as soon as SCSI EH is invoked control > is assumed to be transferred back to the SCSI midlayer. > How the midlayer interprets any return value from the various eh_XX > callbacks is immaterial to the LLDD. > > So even if th

Re: Debugging scsi abort handling ?

2014-08-28 Thread Paolo Bonzini
Il 28/08/2014 14:26, Hans de Goede ha scritto: >> > Then, blk_complete_request will do nothing because its call to >> > blk_mark_rq_complete returns true. >> > >> > All this, of course, as long as ->scsi_done is called _before_ eh_abort >> > returns. > What about calling scsi_done after eh_abort i

Re: Debugging scsi abort handling ?

2014-08-28 Thread Paolo Bonzini
Il 28/08/2014 14:04, Hannes Reinecke ha scritto: >> >> Setting TASK ABORTED aside, the important part is that an abort can do >> one of two things: >> >> - complete the command, and then eh_abort should return after the driver >> has noticed the completion and called the ->scsi_done callback for th

Re: Debugging scsi abort handling ?

2014-08-25 Thread Paolo Bonzini
Il 25/08/2014 13:26, Hans de Goede ha scritto: > Thanks Bart and Paolo, your insights into this are greatly appreciated. > > So with uas there are separate usb transaction for cmd, data in, data out > and sense for each tag. At the time of abort, usually one of data in / data > out and a sense usb

Re: Debugging scsi abort handling ?

2014-08-25 Thread Paolo Bonzini
Il 25/08/2014 12:28, Bart Van Assche ha scritto: > > From SPC-4: "7.5.8 Control mode page [ ... ] A task aborted status (TAS) > bit set to zero specifies that aborted commands shall be terminated by > the device server without any response to the application client. A TAS > bit set to one specifie

Re: Debugging scsi abort handling ?

2014-08-25 Thread Paolo Bonzini
Il 23/08/2014 16:52, Hans de Goede ha scritto: > Hi All, > > Now that the UAS driver is no longer marked as CONFIG_BROKEN, > I'm getting quite a few bug reports about issues with UAS drives. > > One if the issues is that there might be a number of bugs in the > abort handling path, as I don't thi

Re: [PATCH] virtio_scsi: check on resp->sense_len instead of 'sense_buffer'

2014-07-18 Thread Paolo Bonzini
Il 18/07/2014 16:57, Ming Lei ha scritto: > - if (sc->sense_buffer) { > + if (resp->sense_len) { In the (unlikely) case that sc->sense_buffer == NULL, you'd pass a NULL to memcpy. If you want, you can change this if to if (sc->sense_buffer && resp->sense_len) but frankly it seem

[PATCH 1/2] virtio-scsi: replace target spinlock with seqcount

2014-07-06 Thread Paolo Bonzini
virtscsi_target_alloc. - Paolo] Signed-off-by: Paolo Bonzini --- drivers/scsi/virtio_scsi.c | 42 +- 1 file changed, 29 insertions(+), 13 deletions(-) diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c index 308256b5e4cb..f67a872de14b 100644 --- a

[PATCH 2/2] virtio-scsi: Implement change_queue_depth for virtscsi targets

2014-07-06 Thread Paolo Bonzini
maximum when the BUSY condition has resolved. Signed-off-by: Venkatesh Srinivas Signed-off-by: Paolo Bonzini --- drivers/scsi/virtio_scsi.c | 33 + 1 file changed, 33 insertions(+) diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c index f67a872de14b

[PATCH 0/2] virtio-scsi queue for 3.17

2014-07-06 Thread Paolo Bonzini
Christoph asked me to rebase the two virtio-scsi patches from http://thread.gmane.org/gmane.linux.kernel/1717796 that do not apply anymore, patch 2 and 6. These are on top of his drivers-for-3.16 branch, more precisely commit 8faeb529b2da (virtio-scsi: fix various bad behavior on aborted requests)

Re: tgt infrastructure removal

2014-07-04 Thread Paolo Bonzini
there's much to review there. :) Reviewed-by: Paolo Bonzini Paolo -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH 5/5] scsi: remove various exports that were only used by scsi_tgt

2014-07-04 Thread Paolo Bonzini
_check scsi_add_host(struct Scsi_Host *host, struct device *dev) { Reviewed-by: Paolo Bonzini -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH 1/5] ibmvstgt: remove

2014-07-01 Thread Paolo Bonzini
Il 24/06/2014 16:28, Christoph Hellwig ha scritto: > Adding Paul and Nathan to cc here. I'm pretty sure the backend for ibmvscsi in > KVM was all done in qemu and there is no dependency on ibmvstgt. > FWIW the ibmvscsi backend is indeed entirely in userspace (hw/scsi/spapr_vscsi.c in the QEMU

Re: [PATCH v1 3/3] TARGET/sbc,loopback: Adjust command data length in case pi exists on the wire

2014-06-10 Thread Paolo Bonzini
Il 10/06/2014 10:04, Nicholas A. Bellinger ha scritto: That said, there is one other small qla2xxx change to enable per-session PI that is currently missing in Quinn's patch in scsi/for-next code. Sooo, I'll go ahead and include Sagi's patches with the vhost-scsi change below if there are no ob

Re: [PATCH-v2 0/6] vhost/scsi: Add T10 PI SGL passthrough support

2014-06-10 Thread Paolo Bonzini
Il 10/06/2014 09:07, Nicholas A. Bellinger ha scritto: > OK, finally went over this, looks good to me: > > Acked-by: Michael S. Tsirkin > > However, we really should stop making more changes > before fixing ANY_LAYOUT in this driver. > > virtio 1.0 should be out soon and that makes ANY_LAYOUT >

Re: [PATCH-v2 0/6] vhost/scsi: Add T10 PI SGL passthrough support

2014-06-09 Thread Paolo Bonzini
Il 08/06/2014 18:05, Michael S. Tsirkin ha scritto: OK, finally went over this, looks good to me: Acked-by: Michael S. Tsirkin However, we really should stop making more changes before fixing ANY_LAYOUT in this driver. virtio 1.0 should be out soon and that makes ANY_LAYOUT a required featur

Re: [PATCH] scsi: ibmvscsi: protect abort handler from done-scmd in flight

2014-06-05 Thread Paolo Bonzini
Il 05/06/2014 08:16, Liu Ping Fan ha scritto: Take the following scene in guest: seqA: scsi_done() -> gapX (before taking REQ_ATOM_COMPLETE) seqB: scmd_eh_abort_handler()-> ...-> ibmvscsi_eh_abort_handler()-> ...->scsi_put_command(scmd) If seqA is scheduled at gapX, and seqB reclaims scmd.

Re: [PATCH v3 5/6] virtio-scsi: fix various bad behavior on aborted requests

2014-06-04 Thread Paolo Bonzini
Il 04/06/2014 19:29, Venkatesh Srinivas ha scritto: Do you really want to poll the request VQs for completions if the TMF was rejected? I wasn't sure, but bugs in this path are hard enough that I preferred the safer patch. TMF ABORT may return FUNCTION REJECTED if the command to abort compl

[PATCH v3 0/6] virtio-scsi patches for 3.16 + midlayer fix

2014-06-04 Thread Paolo Bonzini
in patch 4 v2->v3: really fix all occurrences in patch 4 Ming Lei (2): virtio_scsi: remove ACCESS_ONCE() and smp_read_barrier_depends() virtio-scsi: replace target spinlock with seqcount Paolo Bonzini (2): virtio-scsi: avoid cancelling uninitialized work items virtio-scsi: fi

[PATCH v3 3/6] virtio-scsi: avoid cancelling uninitialized work items

2014-06-04 Thread Paolo Bonzini
Calling the workqueue interface on uninitialized work items isn't a good idea even if they're zeroed. It's not failing catastrophically only through happy accidents. Signed-off-by: Paolo Bonzini --- drivers/scsi/virtio_scsi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion

[PATCH v3 1/6] virtio_scsi: remove ACCESS_ONCE() and smp_read_barrier_depends()

2014-06-04 Thread Paolo Bonzini
req_vq is read from scsi->req_vqs[vq->index - VIRTIO_SCSI_VQ_BASE] instead of tgt->req_vq, so remove the unnecessary barrier. Also remove related comment about the barrier. Cc: Paolo Bonzini Signed-off-by: Ming Lei Signed-off-by: Paolo Bonzini --- dri

[PATCH v3 4/6] scsi_error: fix invalid setting of host byte

2014-06-04 Thread Paolo Bonzini
: Paolo Bonzini --- v1->v2: fix all occurrences [Bart] except one v2->v3: really fix all occurrences [Bart] drivers/scsi/scsi_error.c | 6 +++--- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c index f17aa7

[PATCH v3 2/6] virtio-scsi: replace target spinlock with seqcount

2014-06-04 Thread Paolo Bonzini
virtscsi_target_alloc. - Paolo] Signed-off-by: Paolo Bonzini --- drivers/scsi/virtio_scsi.c | 42 +- 1 file changed, 29 insertions(+), 13 deletions(-) diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c index fc054935eb1f..f0b4cdbfceb0 100644 --- a

[PATCH v3 5/6] virtio-scsi: fix various bad behavior on aborted requests

2014-06-04 Thread Paolo Bonzini
Gs or oopses. Cc: sta...@vger.kernel.org Signed-off-by: Paolo Bonzini --- drivers/scsi/virtio_scsi.c | 22 ++ 1 file changed, 22 insertions(+) diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c index d66c4ee2c774..fda9fb35 100644 --- a/drivers

[PATCH v3 6/6] virtio-scsi: Implement change_queue_depth for virtscsi targets

2014-06-04 Thread Paolo Bonzini
maximum when the BUSY condition has resolved. Signed-off-by: Venkatesh Srinivas Signed-off-by: Paolo Bonzini --- drivers/scsi/virtio_scsi.c | 33 + 1 file changed, 33 insertions(+) diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c index fda9fb35

Re: [PATCH v2 0/6] virtio-scsi patches for 3.16 + midlayer fix

2014-06-04 Thread Paolo Bonzini
Il 04/06/2014 13:21, Bart Van Assche ha scritto: Thanks for the quick respin. However, since you are mentioning that in v2 all occurrences of "scmd->result |= DID_TIME_OUT << 16" have been addressed, this made me wonder whether you had noticed the following code in scsi_decide_disposition() ?

[PATCH v2 2/6] virtio-scsi: replace target spinlock with seqcount

2014-06-04 Thread Paolo Bonzini
virtscsi_target_alloc. - Paolo] Signed-off-by: Paolo Bonzini --- drivers/scsi/virtio_scsi.c | 42 +- 1 file changed, 29 insertions(+), 13 deletions(-) diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c index fc054935eb1f..f0b4cdbfceb0 100644 --- a

[PATCH v2 1/6] virtio_scsi: remove ACCESS_ONCE() and smp_read_barrier_depends()

2014-06-04 Thread Paolo Bonzini
req_vq is read from scsi->req_vqs[vq->index - VIRTIO_SCSI_VQ_BASE] instead of tgt->req_vq, so remove the unnecessary barrier. Also remove related comment about the barrier. Cc: Paolo Bonzini Signed-off-by: Ming Lei Signed-off-by: Paolo Bonzini --- dri

[PATCH v2 6/6] virtio-scsi: Implement change_queue_depth for virtscsi targets

2014-06-04 Thread Paolo Bonzini
maximum when the BUSY condition has resolved. Signed-off-by: Venkatesh Srinivas Signed-off-by: Paolo Bonzini --- drivers/scsi/virtio_scsi.c | 33 + 1 file changed, 33 insertions(+) diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c index fda9fb35

[PATCH v2 5/6] virtio-scsi: fix various bad behavior on aborted requests

2014-06-04 Thread Paolo Bonzini
Gs or oopses. Cc: sta...@vger.kernel.org Signed-off-by: Paolo Bonzini --- drivers/scsi/virtio_scsi.c | 22 ++ 1 file changed, 22 insertions(+) diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c index d66c4ee2c774..fda9fb35 100644 --- a/drivers

[PATCH v2 3/6] virtio-scsi: avoid cancelling uninitialized work items

2014-06-04 Thread Paolo Bonzini
Calling the workqueue interface on uninitialized work items isn't a good idea even if they're zeroed. It's not failing catastrophically only through happy accidents. Signed-off-by: Paolo Bonzini --- drivers/scsi/virtio_scsi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion

[PATCH v2 4/6] scsi_error: fix invalid setting of host byte

2014-06-04 Thread Paolo Bonzini
: Paolo Bonzini --- v1->v2: fix all occurrences [Bart] drivers/scsi/scsi_error.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c index f17aa7aa7879..8e7a0f8d4f52 100644 --- a/drivers/scsi/scsi_error.c +++ b/driv

[PATCH v2 0/6] virtio-scsi patches for 3.16 + midlayer fix

2014-06-04 Thread Paolo Bonzini
in patch 4 Ming Lei (2): virtio_scsi: remove ACCESS_ONCE() and smp_read_barrier_depends() virtio-scsi: replace target spinlock with seqcount Paolo Bonzini (2): virtio-scsi: avoid cancelling uninitialized work items virtio-scsi: fix various bad behavior on aborted requests Ulrich Oberg

[PATCH 1/6] virtio_scsi: remove ACCESS_ONCE() and smp_read_barrier_depends()

2014-06-03 Thread Paolo Bonzini
req_vq is read from scsi->req_vqs[vq->index - VIRTIO_SCSI_VQ_BASE] instead of tgt->req_vq, so remove the unnecessary barrier. Also remove related comment about the barrier. Cc: Paolo Bonzini Signed-off-by: Ming Lei Signed-off-by: Paolo Bonzini --- dri

[PATCH resend 0/6] virtio-scsi patches for 3.16 + a midlayer one-liner

2014-06-03 Thread Paolo Bonzini
Paolo Ming Lei (2): virtio_scsi: remove ACCESS_ONCE() and smp_read_barrier_depends() virtio-scsi: replace target spinlock with seqcount Paolo Bonzini (2): virtio-scsi: avoid cancelling uninitialized work items virtio-scsi: fix various bad behavior on aborted requests Ulrich Obergfe

[PATCH 6/6] virtio-scsi: Implement change_queue_depth for virtscsi targets

2014-06-03 Thread Paolo Bonzini
maximum when the BUSY condition has resolved. Signed-off-by: Venkatesh Srinivas Signed-off-by: Paolo Bonzini --- drivers/scsi/virtio_scsi.c | 33 + 1 file changed, 33 insertions(+) diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c index fda9fb35

[PATCH 3/6] virtio-scsi: avoid cancelling uninitialized work items

2014-06-03 Thread Paolo Bonzini
Calling the workqueue interface on uninitialized work items isn't a good idea even if they're zeroed. It's not failing catastrophically only through happy accidents, and a debug kernel rightfully complains. Cc: sta...@vger.kernel.org Signed-off-by: Paolo Bonzini --- drivers/scs

[PATCH 4/6] scsi_error: fix invalid setting of host byte

2014-06-03 Thread Paolo Bonzini
result field and initiate an unwanted command retry. Fix this by using set_host_byte instead, following the model of commit 2082ebc45af9c9c648383b8cde0dc1948eadbf31. Cc: sta...@vger.kernel.org Signed-off-by: Ulrich Obergfell Signed-off-by: Paolo Bonzini --- drivers/scsi/scsi_error.c | 2 +- 1 file

[PATCH 5/6] virtio-scsi: fix various bad behavior on aborted requests

2014-06-03 Thread Paolo Bonzini
Gs or oopses. Cc: sta...@vger.kernel.org Cc: Ulrich Obergfell Signed-off-by: Paolo Bonzini --- drivers/scsi/virtio_scsi.c | 22 ++ 1 file changed, 22 insertions(+) diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c index d66c4ee2c774..fda9fb35 100644

[PATCH 2/6] virtio-scsi: replace target spinlock with seqcount

2014-06-03 Thread Paolo Bonzini
virtscsi_target_alloc. - Paolo] Signed-off-by: Paolo Bonzini --- drivers/scsi/virtio_scsi.c | 42 +- 1 file changed, 29 insertions(+), 13 deletions(-) diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c index fc054935eb1f..f0b4cdbfceb0 100644 --- a

Re: [PATCH 5/6] [SCSI] Look up and store NAA if VPD page 0x83 is present

2014-06-03 Thread Paolo Bonzini
Il 03/06/2014 03:00, Martin K. Petersen ha scritto: "Paolo" == Paolo Bonzini writes: + sdev_printk(KERN_ERR, sdev, + "%s: VPD page 0x83 NAA descriptor not found\n", __func__); + + return; Paolo> I suspect this error will be relatively common. You're right. But

Re: [PATCH 5/6] [SCSI] Look up and store NAA if VPD page 0x83 is present

2014-06-02 Thread Paolo Bonzini
Il 29/05/2014 05:52, Martin K. Petersen ha scritto: > + sdev_printk(KERN_ERR, sdev, > + "%s: VPD page 0x83 NAA descriptor not found\n", __func__); > + > + return; I suspect this error will be relatively common. libata for example has if (ata_id_has_wwn(args->id))

Re: [RFC 0/9] fix for the race issue between scsi timer and in-flight scmd

2014-05-30 Thread Paolo Bonzini
Il 30/05/2014 10:15, Liu Ping Fan ha scritto: When running io stress test on large latency scsi-disk, e.g guest with virtscsi on a nfs image. It can trigger the BUG_ON(test_bit(REQ_ATOM_COMPLETE, &req->atomic_flags)); in blk_start_request(). Since there is a race between latency "finishing" scmd

Re: [target:for-next 20/20] drivers/scsi/virtio_scsi.c:531:48: error: dereferencing pointer to incomplete type

2014-05-28 Thread Paolo Bonzini
Il 28/05/2014 00:21, Nicholas A. Bellinger ha scritto: On Mon, 2014-05-26 at 13:30 -0400, Martin K. Petersen wrote: "Nic" == Nicholas A Bellinger writes: What about #ifdef'ing VIRTIO_SCSI_F_T10_PI support out if !CONFIG_BLK_DEV_INTEGRITY? Nic> I figured it was slightly cleaner to enable BL

Re: [PATCH] virtio-scsi: replace target spinlock with seqcount

2014-05-28 Thread Paolo Bonzini
Il 28/05/2014 03:48, Ming Lei ha scritto: On Wed, May 28, 2014 at 12:57 AM, Paolo Bonzini wrote: Il 27/05/2014 18:50, Venkatesh Srinivas ha scritto: Hi, I think this patch has a small race involving just two commands: 1. The first command to a target is in virtscsi_pick_vq(), after

Re: [PATCH] virtio-scsi: replace target spinlock with seqcount

2014-05-27 Thread Paolo Bonzini
Il 27/05/2014 18:50, Venkatesh Srinivas ha scritto: Hi, I think this patch has a small race involving just two commands: 1. The first command to a target is in virtscsi_pick_vq(), after atomic_inc_return(&tgt->tgt_lock)) but before write_seqcount_begin() 2. A second command to the same targe

Re: [PATCH 2/3] block: Introduce blk_rq_completed()

2014-05-27 Thread Paolo Bonzini
Il 27/05/2014 13:26, James Bottomley ha scritto: You could use a different mechanism than a softirq to tell the abort were successful, for example by overriding scsi_done. But with respect to the block layer, the mechanics of avoiding the race and double-free would probably be the same. I thin

Re: [PATCH 2/3] block: Introduce blk_rq_completed()

2014-05-27 Thread Paolo Bonzini
Il 27/05/2014 12:59, James Bottomley ha scritto: On Tue, 2014-05-27 at 12:47 +0200, Paolo Bonzini wrote: Il 27/05/2014 12:21, James Bottomley ha scritto: I could also see us one day extending the TMF capability to abort any running command, which would make even an assertion of block timed out

Re: [PATCH 2/3] block: Introduce blk_rq_completed()

2014-05-27 Thread Paolo Bonzini
Il 27/05/2014 12:21, James Bottomley ha scritto: I could also see us one day extending the TMF capability to abort any running command, which would make even an assertion of block timed out or completed invalid. Actually the assertion would remain valid, and that's exactly what Bart wants to d

Re: [PATCH 1/3] Remove two cancel_delayed_work() calls from the error handler

2014-05-27 Thread Paolo Bonzini
Il 27/05/2014 10:56, James Bottomley ha scritto: The whole reason BUG_ON doesn't leave a log trace is to try to prevent corruption propagating to the data storage devices. What you propose would be inviting that corruption in the name of getting a log entry. Even this is not entirely correct.

Re: [PATCH 1/3] Remove two cancel_delayed_work() calls from the error handler

2014-05-26 Thread Paolo Bonzini
(). Signed-off-by: Bart Van Assche Cc: Hannes Reinecke Cc: Paolo Bonzini Cc: Christoph Hellwig Cc: Jens Axboe Cc: Joe Lawrence --- drivers/scsi/scsi.c | 2 +- drivers/scsi/scsi_error.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/scsi.c b/drivers

Re: [PATCH] virtio-scsi: replace target spinlock with seqcount

2014-05-23 Thread Paolo Bonzini
Il 23/05/2014 15:28, Ming Lei ha scritto: The spinlock of tgt_lock is only for serializing read and write req_vq, one lockless seqcount is enough for the purpose. On one 16core VM with vhost-scsi backend, the patch can improve IOPS with 3% on random read test. Nice. :) The patch looks good, t

Re: [PATCH RFC] Remove the cancel_delayed_work() call from scsi_put_command()

2014-05-23 Thread Paolo Bonzini
Il 23/05/2014 12:37, Bart Van Assche ha scritto: On 05/23/14 11:24, Paolo Bonzini wrote: Il 23/05/2014 08:09, Hannes Reinecke ha scritto: And when freeing a command we absolutely need to make sure that the workqueue is empty. So calling cancel_delayed_work() was the obvious thing to do. You

Re: [PATCH RFC] Remove the cancel_delayed_work() call from scsi_put_command()

2014-05-23 Thread Paolo Bonzini
Il 23/05/2014 08:09, Hannes Reinecke ha scritto: And when freeing a command we absolutely need to make sure that the workqueue is empty. So calling cancel_delayed_work() was the obvious thing to do. You would need cancel_delayed_work_sync, but if it really happened that the work item is runni

Re: dangling pointers and/or reentrancy in scmd_eh_abort_handler?

2014-05-23 Thread Paolo Bonzini
Il 23/05/2014 03:28, Elliott, Robert (Server Storage) ha scritto: Depending on the transport, there may be a race condition between the command status and the ABORT TASK response; the ABORT TASK response might get back first. I think that means scsi_eh_abort_handler's call to scsi_finish_command

Re: [target:for-next 20/20] drivers/scsi/virtio_scsi.c:531:48: error: dereferencing pointer to incomplete type

2014-05-23 Thread Paolo Bonzini
Il 22/05/2014 22:46, Nicholas A. Bellinger ha scritto: Hi Fengguang, On Thu, 2014-05-22 at 11:13 +0800, kbuild test robot wrote: tree: git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending.git for-next head: 4baaa7d589e24bfe87dfd6c7a1229108be404a28 commit: 4baaa7d589e24bfe87dfd6

Re: [PATCH RFC] Remove the cancel_delayed_work() call from scsi_put_command()

2014-05-22 Thread Paolo Bonzini
Il 21/05/2014 15:30, Bart Van Assche ha scritto: +static bool scmd_being_handled_in_other_context(struct scsi_cmnd *scmd) +{ + struct Scsi_Host *shost = scmd->device->host; + struct scsi_cmnd *c; + unsigned long flags; + bool ret = false; + + if (!blk_rq_completed(sc

Re: [PATCH-v2 6/6] virtio-scsi: Enable DIF/DIX modes in SCSI host LLD

2014-05-22 Thread Paolo Bonzini
ull request, Acked-by: Paolo Bonzini for getting this in via the target tree. Paolo v4 changes: - Convert virtio_scsi_init_hdr_pi to use pi_bytesout + pi_bytesin (mst + paolo + nab) - Use blk_integrity->tuple_size to calculate pi bytes (nab) v3 changes: - Use VIRTIO_SCSI_F_T10_PI to det

Re: [PATCH-v2 0/6] vhost/scsi: Add T10 PI SGL passthrough support

2014-05-22 Thread Paolo Bonzini
Il 22/05/2014 04:26, Nicholas A. Bellinger ha scritto: From: Nicholas Bellinger Hi MST, MKP, Paolo & Co, Here is the v2 patch series for adding T1O protection information (PI) SGL passthrough support between virtio-scsi LLD + vhost-scsi fabric endpoints. Following MST's recommendation, it inc

Re: dangling pointers and/or reentrancy in scmd_eh_abort_handler?

2014-05-21 Thread Paolo Bonzini
Il 21/05/2014 16:16, Mark Wu ha scritto: Is it possible that when scsi_done is invoked, the scsi command or the request has been freed and then reallocated for a new I/O request? Because of this the bit flag REQ_ATOM_COMPLETE becomes unreliable. Thanks! It is up to the driver to ensure that t

Re: dangling pointers and/or reentrancy in scmd_eh_abort_handler?

2014-05-20 Thread Paolo Bonzini
Il 20/05/2014 10:10, Bart Van Assche ha scritto: REQ_ATOM_COMPLETE is already set before scsi_eh_scmd_add() is called since that function is only invoked after the block layer has marked a request as "complete". The only callers of scsi_eh_scmd_add() are scsi_softirq_done(), scsi_times_out() and

Re: [PATCH] virtio_scsi: don't call virtqueue_add_sgs(... GFP_NOIO) holding spinlock.

2014-05-20 Thread Paolo Bonzini
rtio_scsi_cmd *cmd) cmd->comp = ∁ if (virtscsi_kick_cmd(&vscsi->ctrl_vq, cmd, - sizeof cmd->req.tmf, sizeof cmd->resp.tmf, - GFP_NOIO) < 0) + sizeof cmd->req.tmf, sizeof cmd->resp.tmf) < 0)

Re: [PATCH 6/6] virtio-scsi: Enable DIF/DIX modes in SCSI host LLD

2014-05-20 Thread Paolo Bonzini
Il 19/05/2014 21:07, Nicholas A. Bellinger ha scritto: Hi MST, So I've finally got some cycles to get back to this code, and wanted to verify the outstanding items you had previously raised: - Convert vhost-scsi to be independent of IOV layout using memcpy_fromiovecend. (Does this effect exis

Re: dangling pointers and/or reentrancy in scmd_eh_abort_handler?

2014-05-19 Thread Paolo Bonzini
Il 19/05/2014 17:08, Bart Van Assche ha scritto: On 05/19/14 16:08, Paolo Bonzini wrote: 2) reentrancy: the softirq handler and scmd_eh_abort_handler can run concurrently, and call scsi_finish_command without any lock protecting the calls. You can then get memory corruption. I'm not

dangling pointers and/or reentrancy in scmd_eh_abort_handler?

2014-05-19 Thread Paolo Bonzini
Hi all, I'm trying to understand asynchronous abort in the current upstream code, and the code seems to have some dubious locking. Here are some examples of the issue: 1) dangling pointers: scsi_put_command calls cancel_delayed_work(), but that doesn't mean that the scmd_eh_abort_handler cou

Re: virtio-scsi: two questions related with picking up queue

2014-05-08 Thread Paolo Bonzini
Il 08/05/2014 14:55, Ming Lei ha scritto: On Thu, May 8, 2014 at 8:17 PM, Paolo Bonzini wrote: Il 08/05/2014 12:44, Ming Lei ha scritto: On Wed, 07 May 2014 18:43:45 +0200 Paolo Bonzini wrote: Per-CPU spinlocks have bad scalability problems, especially if you're overcommitting. Wr

Re: virtio-scsi: two questions related with picking up queue

2014-05-08 Thread Paolo Bonzini
Il 08/05/2014 12:44, Ming Lei ha scritto: On Wed, 07 May 2014 18:43:45 +0200 Paolo Bonzini wrote: Per-CPU spinlocks have bad scalability problems, especially if you're overcommitting. Writing req_vq is not at all rare. OK, thought about it further, and I believe seqcount may be a

Re: [PATCH v2] virtio_scsi: remove ACCESS_ONCE() and smp_read_barrier_depends()

2014-05-08 Thread Paolo Bonzini
n't needed now because req_vq is read from scsi->req_vqs[vq->index - VIRTIO_SCSI_VQ_BASE] instead of tgt->req_vq, so remove the unnecessary barrier. Also remove related comment about the barrier. Cc: Paolo Bonzini Signed-off-by: Ming Lei --- v2: - take Paolo's

Re: [PATCH v1] virtio_scsi: remove ACCESS_ONCE() and smp_read_barrier_depends()

2014-05-08 Thread Paolo Bonzini
n't needed now because req_vq is read from scsi->req_vqs[vq->index - VIRTIO_SCSI_VQ_BASE] instead of tgt->req_vq, so remove the unnecessary barrier. Also remove related comment about the barrier. Cc: Paolo Bonzini Signed-off-by: Ming Lei --- v1: - fix comment on decrements of

Re: virtio-scsi: two questions related with picking up queue

2014-05-07 Thread Paolo Bonzini
Il 07/05/2014 18:24, Ming Lei ha scritto: On Tue, 06 May 2014 15:17:15 +0200 Paolo Bonzini wrote: Il 06/05/2014 11:26, Ming Lei ha scritto: Hi Paolo and All, One question is about ACCESS_ONCE() in virtscsi_pick_vq(), looks it needn't since both reading and writing tgt->req_vq h

Re: [PATCH] virtio_scsi: remove ACCESS_ONCE() and smp_read_barrier_depends()

2014-05-07 Thread Paolo Bonzini
Il 07/05/2014 18:03, Ming Lei ha scritto: * * - likewise, decrements of reqs only occur when reqs != 0. If the decremented * value is zero, the first CPU that enters virtscsi_queuecommand_multi will * modify req_vq and the others will spin on tgt_lock. The fact should be obvious too,

Re: [PATCH] virtio_scsi: remove ACCESS_ONCE() and smp_read_barrier_depends()

2014-05-07 Thread Paolo Bonzini
Il 07/05/2014 16:34, Ming Lei ha scritto: > * > - * An interesting effect of this policy is that only writes to req_vq need to > - * take the tgt_lock. Read can be done outside the lock because: > - * > - * - writes of req_vq only occur when atomic_inc_return(&tgt->reqs) returns > 1. > - * In

Re: [PATCH 2/2] virtio_scsi: remove smp_read_barrier_depends

2014-05-07 Thread Paolo Bonzini
about the barrier. Cc: Paolo Bonzini Signed-off-by: Ming Lei --- drivers/scsi/virtio_scsi.c | 52 +++- 1 file changed, 3 insertions(+), 49 deletions(-) diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c index aead20f..0c77ed6 100644 -

Re: virtio-scsi: two questions related with picking up queue

2014-05-07 Thread Paolo Bonzini
Il 07/05/2014 03:07, Ming Lei ha scritto: Hi Paolo, On Tue, May 6, 2014 at 9:17 PM, Paolo Bonzini wrote: Il 06/05/2014 11:26, Ming Lei ha scritto: Hi Paolo and All, One question is about ACCESS_ONCE() in virtscsi_pick_vq(), looks it needn't since both reading and writing tgt->req_

Re: virtio-scsi: two questions related with picking up queue

2014-05-06 Thread Paolo Bonzini
Il 06/05/2014 11:26, Ming Lei ha scritto: Hi Paolo and All, One question is about ACCESS_ONCE() in virtscsi_pick_vq(), looks it needn't since both reading and writing tgt->req_vq holds tgt->tgt_lock. You're right. It should be possible to avoid the lock in virtscsi_pick_vq like this:

Re: [GIT PULL] SCSI fixes for 3.15-rc3

2014-04-28 Thread Paolo Bonzini
Il 25/04/2014 16:59, James Bottomley ha scritto: This is a set of seven fixes, three (hpsa) and free'd command references correcting bugs in the last round of updates and the remaining four correcting problems within the SCSI error handler that was causing a deadlock within USB. The patch is ava

Re: [PATCH 1/6] virtio-scsi.h: Add virtio_scsi_cmd_req_pi + VIRTIO_SCSI_F_T10_PI bits

2014-04-12 Thread Paolo Bonzini
Il 09/04/2014 09:22, Michael S. Tsirkin ha scritto: > The interface uses bytes instead of iovecs as the unit, and > vhost-scsi can add the (temporary...) requirement that do_pi_nbytes > and di_pi_nbytes comprise an integer number of iovecs. > > Paolo That would be a reasonable intermediate step,

Re: [PATCH] virtio-scsi: Skip setting affinity on uninitialized vq

2014-04-11 Thread Paolo Bonzini
Il 11/04/2014 03:23, Fam Zheng ha scritto: virtscsi_init calls virtscsi_remove_vqs on err, even before initializing the vqs. The latter calls virtscsi_set_affinity, so let's check the pointer there before setting affinity on it. This fixes a panic when setting device's num_queues=2 on RHEL 6.5:

Re: [PATCH] virtio-scsi: Skip setting affinity on uninitialized vq

2014-04-11 Thread Paolo Bonzini
scsi->affinity_hint_set = false; } You put the if inside the loop, but it's really all or nothing since the failure point is find_vqs. Not a problem though; the queues are few and this is not a hot path anyway. Acked-by: Paolo Bonzini Paolo -- To unsubscribe from this list: send t

Re: [PATCH 5/6] vhost/scsi: Enable T10 PI IOV -> SGL memory mapping

2014-04-08 Thread Paolo Bonzini
Il 07/04/2014 05:16, Michael S. Tsirkin ha scritto: Hmm still relying on a specific IOV layout I see :( It's really a violation of the spec even though it works fine with Linux guests. I know this isn't the only place this is broken but can't we finally fix it? Since you are touching this code an

Re: [PATCH 6/6] virtio-scsi: Enable DIF/DIX modes in SCSI host LLD

2014-04-08 Thread Paolo Bonzini
Il 07/04/2014 05:13, Nicholas A. Bellinger ha scritto: > I guess we'll still be able to fix it after the merge window - > (or worst case, revert the change) is this what you are suggesting? > Yes, but I would think that it is actually fixable. ;) Otherwise, a v3.16 merge is an option as well.

Re: [PATCH 1/6] virtio-scsi.h: Add virtio_scsi_cmd_req_pi + VIRTIO_SCSI_F_T10_PI bits

2014-04-08 Thread Paolo Bonzini
Il 07/04/2014 05:55, Michael S. Tsirkin ha scritto: > + u16 do_pi_niov; /* DataOUT PI Number of iovecs */ > + u16 di_pi_niov; /* DataIN PI Number of iovecs */ So this looks like a somewhat problematic interface to me in that it talks in terms of iovecs not bytes. So this perpet

Re: [PATCH 16/39] virtio_scsi: use cmd_size

2014-03-25 Thread Paolo Bonzini
Il 25/03/2014 16:31, Christoph Hellwig ha scritto: Paolo, do you have a virtio_scsi tree to picks this up in? We now have all the infrastructure for it in James' tree. I don't, I usually just give my Acked-by and James picks it up. Paolo -- To unsubscribe from this list: send the line "unsu

Re: [RFCv2 5/7] vhost/scsi: Enable T10 PI IOV -> SGL memory mapping

2014-03-17 Thread Paolo Bonzini
Il 17/03/2014 06:32, Nicholas A. Bellinger ha scritto: > + if (vq->iov[0].iov_len == sizeof(v_req_pi)) { > + req = (unsigned char *)&v_req_pi; > + target = &v_req_pi.lun[1]; > + req_size = sizeof(v_req_pi); > +

Re: [PATCH] virtio-scsi: Change sense buffer size to 252

2014-03-06 Thread Paolo Bonzini
Il 06/03/2014 12:22, Hannes Reinecke ha scritto: On 03/06/2014 11:09 AM, Paolo Bonzini wrote: Il 06/03/2014 09:47, Fam Zheng ha scritto: According to SPC-4, section 4.5.2.1, 252 is the limit of sense data. So increase the value. Signed-off-by: Fam Zheng --- include/linux/virtio_scsi.h | 2

Re: [PATCH] virtio-scsi: Change sense buffer size to 252

2014-03-06 Thread Paolo Bonzini
Il 06/03/2014 09:47, Fam Zheng ha scritto: According to SPC-4, section 4.5.2.1, 252 is the limit of sense data. So increase the value. Signed-off-by: Fam Zheng --- include/linux/virtio_scsi.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/virtio_scsi.h b/incl

Re: [PATCH] vhost/scsi: Check LUN structure byte 0 is set to 1, per spec

2014-02-24 Thread Paolo Bonzini
get = v_req.lun[1]; > tpg = ACCESS_ONCE(vs_tpg[target]); > -- > 1.8.5.3 > Reviewed-by: Paolo Bonzini -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [RFC 0/6] vhost/scsi: Add T10 PI SGL passthrough support

2014-02-24 Thread Paolo Bonzini
Il 24/02/2014 06:32, Nicholas A. Bellinger ha scritto: AFAICT up until this point the ->prio field has been unused, but I'm certainly open to better ways of signaling (to vhost) that some number of metadata iovs are to be expected.. Any thoughts..? Hi nab, the virtio-scsi side of the patch is

Re: [PATCH 07/17] virtio_scsi: use cmd_size

2014-02-07 Thread Paolo Bonzini
ort_handler = virtscsi_abort, .eh_device_reset_handler = virtscsi_device_reset, -- 1.7.10.4 -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH 06/17] scsi: add support for per-host cmd pools

2014-02-07 Thread Paolo Bonzini
Il 05/02/2014 13:39, Christoph Hellwig ha scritto: + pool = scsi_find_host_cmd_pool(shost); Should you have a WARN_ON somewhere if shost->hostt->cmd_size && shost->unchecked_isa_dma? Apart from this, Reviewed-by: Paolo Bonzini Paolo + if (!pool) { +

Re: [PATCH 04/17] scsi: avoid useless free_list lock roundtrips

2014-02-07 Thread Paolo Bonzini
} - spin_unlock_irqrestore(&shost->free_list_lock, flags); - if (likely(cmd != NULL)) + if (cmd) scsi_pool_free_command(shost->cmd_pool, cmd); put_device(dev); Reviewed-by: Paolo Bonzini -- To unsubscribe from this list: send the line

<    1   2   3   4   5   >