Re: [PATCH v3 10/25] virtio: add API to enable VQs early

2014-10-13 Thread Rusty Russell
Michael S. Tsirkin m...@redhat.com writes: virtio spec 0.9.X requires DRIVER_OK to be set before VQs are used, but some drivers use VQs before probe function returns. Since DRIVER_OK is set after probe, this violates the spec. Even though under virtio 1.0 transitional devices support this

Re: [PATCH v3 10/25] virtio: add API to enable VQs early

2014-10-13 Thread Michael S. Tsirkin
On Mon, Oct 13, 2014 at 05:22:39PM +1030, Rusty Russell wrote: Michael S. Tsirkin m...@redhat.com writes: virtio spec 0.9.X requires DRIVER_OK to be set before VQs are used, but some drivers use VQs before probe function returns. Since DRIVER_OK is set after probe, this violates the spec.

[PATCH v4 00/25] virtio: fix spec compliance issues

2014-10-13 Thread Michael S. Tsirkin
Changes from v4: rename virtio_enable_vqs_early() to virtio_device_ready() Note: Rusty requested we add a BUG_ON in the virtio_ring code. This can be done by a separate patch on top. Good for bisectability in case BUG_ON starts triggering :) Rusty, please review this, and

[PATCH v4 02/25] virtio: unify config_changed handling

2014-10-13 Thread Michael S. Tsirkin
Replace duplicated code in all transports with a single wrapper in virtio.c. The only functional change is in virtio_mmio.c: if a buggy device sends us an interrupt before driver is set, we previously returned IRQ_NONE, now we return IRQ_HANDLED. As this must not happen in practice, this does

[PATCH v4 01/25] virtio_pci: fix virtio spec compliance on restore

2014-10-13 Thread Michael S. Tsirkin
On restore, virtio pci does the following: + set features + init vqs etc - device can be used at this point! + set ACKNOWLEDGE,DRIVER and DRIVER_OK status bits This is in violation of the virtio spec, which requires the following order: - ACKNOWLEDGE - DRIVER - init vqs - DRIVER_OK This

[PATCH v4 03/25] virtio-pci: move freeze/restore to virtio core

2014-10-13 Thread Michael S. Tsirkin
This is in preparation to extending config changed event handling in core. Wrapping these in an API also seems to make for a cleaner code. Signed-off-by: Michael S. Tsirkin m...@redhat.com Reviewed-by: Cornelia Huck cornelia.h...@de.ibm.com --- include/linux/virtio.h | 6 +

[PATCH v4 05/25] virtio_blk: drop config_enable

2014-10-13 Thread Michael S. Tsirkin
Now that virtio core ensures config changes don't arrive during probing, drop config_enable flag in virtio blk. On removal, flush is now sufficient to guarantee that no change work is queued. This help simplify the driver, and will allow setting DRIVER_OK earlier without losing config change

[PATCH v4 24/25] virtio_scsi: drop scan callback

2014-10-13 Thread Michael S. Tsirkin
Enable VQs early like we do for restore. This makes it possible to drop the scan callback, moving scanning into the probe function, and making code simpler. Signed-off-by: Michael S. Tsirkin m...@redhat.com --- drivers/scsi/virtio_scsi.c | 23 +++ 1 file changed, 7

[PATCH v4 25/25] virtio-rng: refactor probe error handling

2014-10-13 Thread Michael S. Tsirkin
Code like vi-vq = NULL; kfree(vi) does not make sense. Clean it up, use goto error labels for cleanup. Signed-off-by: Michael S. Tsirkin m...@redhat.com --- drivers/char/hw_random/virtio-rng.c | 15 +-- 1 file changed, 9 insertions(+), 6 deletions(-) diff --git

[PATCH v4 22/25] virtio_scsi: fix race on device removal

2014-10-13 Thread Michael S. Tsirkin
We cancel event work on device removal, but an interrupt could trigger immediately after this, and queue it again. To fix, set a flag. Loosely based on patch by Paolo Bonzini Signed-off-by: Paolo Bonzini pbonz...@redhat.com Signed-off-by: Michael S. Tsirkin m...@redhat.com ---

[PATCH v4 21/25] virito_scsi: use freezable WQ for events

2014-10-13 Thread Michael S. Tsirkin
From: Paolo Bonzini pbonz...@redhat.com Michael S. Tsirkin noticed a race condition: we reset device on freeze, but system WQ is still running so it might try adding bufs to a VQ meanwhile. To fix, switch to handling events from the freezable WQ. Reported-by: Michael S. Tsirkin m...@redhat.com

[PATCH v4 23/25] virtio_balloon: enable VQs early on restore

2014-10-13 Thread Michael S. Tsirkin
virtio spec requires drivers to set DRIVER_OK before using VQs. This is set automatically after resume returns, virtio balloon violated this rule by adding bufs, which causes the VQ to be used directly within restore. To fix, call virtio_device_ready before using VQ. Signed-off-by: Michael S.

[PATCH v4 14/25] 9p/trans_virtio: enable VQs early

2014-10-13 Thread Michael S. Tsirkin
virtio spec requires drivers to set DRIVER_OK before using VQs. This is set automatically after probe returns, but virtio 9p device adds self to channel list within probe, at which point VQ can be used in violation of the spec. To fix, call virtio_device_ready before using VQs. Signed-off-by:

[PATCH v4 20/25] virtio_net: enable VQs early on restore

2014-10-13 Thread Michael S. Tsirkin
virtio spec requires drivers to set DRIVER_OK before using VQs. This is set automatically after restore returns, virtio net violated this rule by using receive VQs within restore. To fix, call virtio_device_ready before using VQs. Signed-off-by: Michael S. Tsirkin m...@redhat.com Reviewed-by:

[PATCH v4 18/25] virtio_scsi: enable VQs early on restore

2014-10-13 Thread Michael S. Tsirkin
virtio spec requires drivers to set DRIVER_OK before using VQs. This is set automatically after restore returns, virtio scsi violated this rule on restore by kicking event vq within restore. To fix, call virtio_device_ready before using event queue. Signed-off-by: Michael S. Tsirkin

[PATCH v4 16/25] virtio_scsi: move kick event out from virtscsi_init

2014-10-13 Thread Michael S. Tsirkin
We currently kick event within virtscsi_init, before host is fully initialized. This can in theory confuse guest if device consumes the buffers immediately. To fix, move virtscsi_kick_event_all out to scan/restore. Signed-off-by: Michael S. Tsirkin m...@redhat.com ---

[PATCH v4 17/25] virtio_blk: enable VQs early on restore

2014-10-13 Thread Michael S. Tsirkin
virtio spec requires drivers to set DRIVER_OK before using VQs. This is set automatically after restore returns, virtio block violated this rule on restore by restarting queues, which might in theory cause the VQ to be used directly within restore. To fix, call virtio_device_ready before using

[PATCH v4 19/25] virtio_console: enable VQs early on restore

2014-10-13 Thread Michael S. Tsirkin
virtio spec requires drivers to set DRIVER_OK before using VQs. This is set automatically after resume returns, virtio console violated this rule by adding inbufs, which causes the VQ to be used directly within restore. To fix, call virtio_device_ready before using VQs. Signed-off-by: Michael S.

[PATCH v4 13/25] virtio_console: enable VQs early

2014-10-13 Thread Michael S. Tsirkin
virtio spec requires drivers to set DRIVER_OK before using VQs. This is set automatically after probe returns, virtio console violated this rule by adding inbufs, which causes the VQ to be used directly within probe. To fix, call virtio_device_ready before using VQs. Signed-off-by: Michael S.

[PATCH v4 12/25] virtio_blk: enable VQs early

2014-10-13 Thread Michael S. Tsirkin
virtio spec requires drivers to set DRIVER_OK before using VQs. This is set automatically after probe returns, virtio block violated this rule by calling add_disk, which causes the VQ to be used directly within probe. To fix, call virtio_device_ready before using VQs. Signed-off-by: Michael S.

[PATCH v4 09/25] virtio_net: minor cleanup

2014-10-13 Thread Michael S. Tsirkin
goto done; done: return; is ugly, it was put there to make diff review easier. replace by open-coded return. Signed-off-by: Michael S. Tsirkin m...@redhat.com Acked-by: Cornelia Huck cornelia.h...@de.ibm.com --- drivers/net/virtio_net.c | 6 ++ 1 file changed, 2

[PATCH v4 08/25] virtio-net: drop config_mutex

2014-10-13 Thread Michael S. Tsirkin
config_mutex served two purposes: prevent multiple concurrent config change handlers, and synchronize access to config_enable flag. Since commit dbf2576e37da0fcc7aacbfbb9fd5d3de7888a3c1 workqueue: make all workqueues non-reentrant all workqueues are non-reentrant, and config_enable is now

[PATCH v4 11/25] virtio_net: enable VQs early

2014-10-13 Thread Michael S. Tsirkin
virtio spec requires drivers to set DRIVER_OK before using VQs. This is set automatically after probe returns, virtio net violated this rule by using receive VQs within probe. To fix, call virtio_device_ready before using VQs. Signed-off-by: Michael S. Tsirkin m...@redhat.com Reviewed-by:

[PATCH v4 06/25] virtio-blk: drop config_mutex

2014-10-13 Thread Michael S. Tsirkin
config_mutex served two purposes: prevent multiple concurrent config change handlers, and synchronize access to config_enable flag. Since commit dbf2576e37da0fcc7aacbfbb9fd5d3de7888a3c1 workqueue: make all workqueues non-reentrant all workqueues are non-reentrant, and config_enable is now

Re: [PATCH 1/1] IB/iser: Remove hard coded values for cqe and send_wr

2014-10-13 Thread Sagi Grimberg
On 10/9/2014 8:14 AM, Jayamohan.K wrote: SNIP Hi Minh and Jayamohan, So I agree that we would want to take device capabilities into account here, but we need to be able to adjust scsi_cmds_max (can_queue) in case the max wqe supported is lower than scsi_cmds_max *

Re: [PATCH 8/8] IB/srp: Add multichannel support

2014-10-13 Thread Sagi Grimberg
On 10/7/2014 3:51 PM, Bart Van Assche wrote: On 09/23/14 18:32, Sagi Grimberg wrote: Since you don't seem to negotiate/declare multichannel with the target, did you test this code with some target implementations other than SCST that happen to be out there? (replying to an e-mail of two weeks

Re: [PATCH 8/8] IB/srp: Add multichannel support

2014-10-13 Thread Bart Van Assche
On 10/13/14 10:17, Sagi Grimberg wrote: On 10/7/2014 3:51 PM, Bart Van Assche wrote: On 09/23/14 18:32, Sagi Grimberg wrote: Since you don't seem to negotiate/declare multichannel with the target, did you test this code with some target implementations other than SCST that happen to be out

[PATCH 2/2] ipr: set coherent DMA mask

2014-10-13 Thread Anton Blanchard
Use dma_set_mask_and_coherent() to set both the DMA and coherent DMA mask. Signed-off-by: Anton Blanchard an...@samba.org --- drivers/scsi/ipr.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c index 3aa28bd..15f4575 100644

Re: Concurrent SG_SCSI_RESET ioctls

2014-10-13 Thread Bart Van Assche
On 10/11/14 18:11, Christoph Hellwig wrote: Hi Robert, can you take a look at the patches at: http://git.infradead.org/users/hch/scsi.git/shortlog/refs/heads/scsi-ioctl and confirm if they fix your issue? Hello Christoph, At least to me patches 1/4..3/4 look like nice cleanup patches.

Re: [PATCH v2 02/12] blk-mq: Add blk_mq_unique_tag()

2014-10-13 Thread Bart Van Assche
On 10/11/14 13:08, Christoph Hellwig wrote: +static inline u32 blk_mq_build_unique_tag(int hwq, int tag) +{ + return (hwq BLK_MQ_UNIQUE_TAG_BITS) | (tag BLK_MQ_UNIQUE_TAG_MASK); +} Is there any value in having this as a separate helper? Hello Christoph, With the approach for block

Re: [PATCH v2 01/12] blk-mq: Use all available hardware queues

2014-10-13 Thread Bart Van Assche
On 10/11/14 13:11, Christoph Hellwig wrote: On Wed, Oct 08, 2014 at 03:21:56PM +0200, Bart Van Assche wrote: On 10/07/14 16:37, Jens Axboe wrote: Lets do this separate, as explained last time, it needs to be evaluated on its own and doesn't really belong in this series of patches. Hello

Re: [PATCH v2 02/12] blk-mq: Add blk_mq_unique_tag()

2014-10-13 Thread Christoph Hellwig
On Mon, Oct 13, 2014 at 11:21:54AM +0200, Bart Van Assche wrote: With the approach for block layer tag management proposed in this patch series SCSI LLDs no longer need to call this function. This means that the blk_mq_build_unique_tag() function can be eliminated by inlining it into

Re: Concurrent SG_SCSI_RESET ioctls

2014-10-13 Thread Christoph Hellwig
On Mon, Oct 13, 2014 at 11:15:19AM +0200, Bart Van Assche wrote: At least to me patches 1/4..3/4 look like nice cleanup patches. Regarding patch 4/4: I'm not sure yet what's the best way for addressing potentially concurrent SG_SCSI_RESET ioctl calls. As far as I know many SCSI LLDs have been

guten Tag

2014-10-13 Thread Mr chin sang
guten Tag Ich bin über dieses Medium, um Sie über die Transaktion für den Transfer von $ 2150 (Einundzwanzig Millionen fünfhunderttausend US-Dollar) in meiner Bank in China, um Sie als Empfänger zu informieren. Sie wird zu 100% sicher, dass der Finanzvorstand des verstorbenen

SG_SCSI_RESET ioctl reset escalation

2014-10-13 Thread Elliott, Robert (Server Storage)
Currently, if you request a reset through ioctl and it fails, the kernel escalates like it does for scsi_abort_eh_cmnd: bus device reset - target reset - bus reset - host reset This is from scsi_error.c

Re: [PATCH 1/1] IB/iser: Remove hard coded values for cqe and send_wr

2014-10-13 Thread Jayamohan Kallickal
On Tue, Oct 7, 2014 at 10:58 PM, Sagi Grimberg sa...@dev.mellanox.co.il wrote: On 10/8/2014 3:41 AM, Jay Kallickal wrote: From: Jayamohan Kallickal jayamoh...@gmail.com This patch allows the underlying hardware to choose values other than hard coded max values for cqe and send_wr while