[PATCH 00/10] virtio: sparse fixes

2016-12-06 Thread Michael S. Tsirkin
sparse builds. Michael S. Tsirkin (10): virtio_console: drop unused config fields drm/virtio: fix endianness in primary_plane_update drm/virtio: fix lock context imbalance drm/virtio: annotate virtio_gpu_queue_ctrl_buffer_locked vhost: make interval tree static inline vhost: add missing

[PATCH 10/10] virtio: enable endian checks for sparse builds

2016-12-06 Thread Michael S. Tsirkin
__CHECK_ENDIAN__ isn't on by default presumably because it triggers too many sparse warnings for correct code. But virtio is now clean of these warnings, and we want to keep it this way - enable this for sparse builds. Signed-off-by: Michael S. Tsirkin --- It seems that there should be a b

Re: [PATCH 10/10] virtio: enable endian checks for sparse builds

2016-12-07 Thread Michael S. Tsirkin
On Wed, Dec 07, 2016 at 07:25:51AM +0100, Johannes Berg wrote: > On Tue, 2016-12-06 at 17:41 +0200, Michael S. Tsirkin wrote: > > > It seems that there should be a better way to do it, > > but this works too. > > In some cases there might be: > > > --- a/drive

[PATCH] linux/types.h: enable endian checks for all sparse builds

2016-12-07 Thread Michael S. Tsirkin
drop __CHECK_ENDIAN__. Follow-up patches can drop distinction between __bitwise and __bitwise__. Cc: Linus Torvalds Suggested-by: Christoph Hellwig Signed-off-by: Michael S. Tsirkin --- Linus, could you ack this for upstream? If yes I'll merge through my tree as a replacement for enabling thi

Re: [PATCH] linux/types.h: enable endian checks for all sparse builds

2016-12-07 Thread Michael S. Tsirkin
On Thu, Dec 08, 2016 at 05:21:47AM +, Bart Van Assche wrote: > On 12/07/16 18:29, Michael S. Tsirkin wrote: > > By now, linux is mostly endian-clean. Enabling endian-ness > > checks for everyone produces about 200 new sparse warnings for me - > > less than 10% over the

Re: [PATCH] linux/types.h: enable endian checks for all sparse builds

2016-12-08 Thread Michael S. Tsirkin
On Thu, Dec 08, 2016 at 06:38:11AM +, Bart Van Assche wrote: > On 12/07/16 21:54, Michael S. Tsirkin wrote: > > On Thu, Dec 08, 2016 at 05:21:47AM +, Bart Van Assche wrote: > >> Additionally, there are notable exceptions to the rule that most drivers > >> are

[PATCH] scsi/qla2xxx: label endian-ness for many fields

2016-12-09 Thread Michael S. Tsirkin
This adds endian-ness labels for lots of qla structs. Doing this cuts down number of sparse warnings from ~1700 to ~1400. Will help find and resolve some of real issues down the road. Signed-off-by: Michael S. Tsirkin --- Compile-tested only. diff --git a/drivers/scsi/qla2xxx/qla_def.h b

Re: [PATCH] linux/types.h: enable endian checks for all sparse builds

2016-12-09 Thread Michael S. Tsirkin
On Fri, Dec 09, 2016 at 03:18:02PM +, Bart Van Assche wrote: > On 12/08/16 22:40, Madhani, Himanshu wrote: > > We’ll take a look and send patches to resolve these warnings. > > Thanks! > > Bart. > Sounds good. I posted what I have so far so that you can start from that. -- MST -- To unsub

Re: [PATCH] scsi/qla2xxx: label endian-ness for many fields

2016-12-10 Thread Michael S. Tsirkin
On Fri, Dec 09, 2016 at 09:49:28PM -0800, Joe Perches wrote: > On Fri, 2016-12-09 at 22:45 +0200, Michael S. Tsirkin wrote: > > This adds endian-ness labels for lots of qla structs. > > Doing this cuts down number of sparse warnings from ~1700 to ~1400. > > Will help find and

[PATCH 5/8] linux: drop __bitwise__ everywhere

2016-12-14 Thread Michael S. Tsirkin
__bitwise__ used to mean "yes, please enable sparse checks unconditionally", but now that we dropped __CHECK_ENDIAN__ __bitwise is exactly the same. There aren't many users, replace it by __bitwise everywhere. Signed-off-by: Michael S. Tsirkin --- arch/arm/plat-samsung/include/

[PATCH 0/8] enable endian checks for all sparse builds

2016-12-14 Thread Michael S. Tsirkin
This is just a reposting of the patch that enables endian checks, with addition of trivial patches that drop __bitwise__ and __CHECK_ENDIAN__ everywhere. I plan to include this in my pull request unless I hear otherwise. Michael S. Tsirkin (8): linux/types.h: enable endian checks for all

Re: [PATCH 2/2] virtio_scsi: Implement fc_host

2017-01-17 Thread Michael S. Tsirkin
On Tue, Jan 17, 2017 at 10:05:00PM +0800, Fam Zheng wrote: > On Tue, 01/17 14:17, Paolo Bonzini wrote: > > > > > > On 16/01/2017 18:26, Fam Zheng wrote: > > >> Is the endianness correct for big-endian host here? > > > > > > I think so. The fc_host sysfs uses u64 to represent port_name and > > >

Re: [PATCH v2 1/2] virtio_scsi: Add fc_host definitions

2017-01-26 Thread Michael S. Tsirkin
On Thu, Jan 26, 2017 at 11:41:08AM +0800, Fam Zheng wrote: > Signed-off-by: Fam Zheng > --- I pefer combining this with implementation, hard to reason about interface alone. > include/uapi/linux/virtio_scsi.h | 6 ++ > 1 file changed, 6 insertions(+) > > diff --git a/include/uapi/linux/vir

Re: [PATCH v2 2/2] virtio_scsi: Implement fc_host

2017-01-26 Thread Michael S. Tsirkin
On Thu, Jan 26, 2017 at 11:41:09AM +0800, Fam Zheng wrote: > This implements the VIRTIO_SCSI_F_FC_HOST feature by reading the config > fields and presenting them as sysfs fc_host attributes. The config > change handler is added here because primary_active will toggle during > migration. Looks like

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

2014-10-12 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 --- drivers/scsi/virtio_scsi.c | 23 +++ 1 file changed, 7 insertions(+), 16

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

2014-10-12 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_enable_vqs_early before using VQ. Signed-off-by: Michael S

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

2014-10-12 Thread Michael S. Tsirkin
: Michael S. Tsirkin --- drivers/char/virtio_console.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c index 6ebe8f6..2ae843f 100644 --- a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c @@ -2184,6 +2184,8 @@ static int

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

2014-10-12 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 --- drivers/char/hw_random/virtio-rng.c | 15 +-- 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/drivers/c

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

2014-10-12 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_enable_vqs_early before using VQs. Signed-off-by: Michael S. Tsirkin Reviewed-by: Cornelia Huck

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

2014-10-12 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 Signed-off-by: Michael S. Tsirkin --- drivers/scsi/virtio_scsi.c | 11 ++- 1

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

2014-10-12 Thread Michael S. Tsirkin
From: Paolo Bonzini 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 Signed-off-by: Paolo Bonzini

[PATCH v3 15/25] virtio_net: fix use after free on allocation failure

2014-10-12 Thread Michael S. Tsirkin
In the extremely unlikely event that driver initialization fails after RX buffers are added, virtio net frees RX buffers while VQs are still active, potentially causing device to use a freed buffer. To fix, reset device first - same as we do on device removal. Signed-off-by: Michael S. Tsirkin

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

2014-10-12 Thread Michael S. Tsirkin
using starting queues. Signed-off-by: Michael S. Tsirkin --- drivers/block/virtio_blk.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c index 46b04bf..1c95af5 100644 --- a/drivers/block/virtio_blk.c +++ b/drivers

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

2014-10-12 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_enable_vqs_early before using event queue. Signed-off-by: Michael S. Tsirkin

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

2014-10-12 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 --- drivers/scsi/virtio_scsi.c | 16

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

2014-10-12 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_enable_vqs_early before using VQs. Signed-off-by: Michael S

Re: [PATCH 4/8] vhost/scsi: Change vhost_scsi_map_to_sgl to accept iov ptr + len

2015-01-30 Thread Michael S. Tsirkin
ALIGN, so allow > the same parameters as well. > > Cc: Michael S. Tsirkin > Cc: Paolo Bonzini > Signed-off-by: Nicholas Bellinger > --- > drivers/vhost/scsi.c | 37 +++-- > 1 file changed, 15 insertions(+), 22 deletions(-) > > diff

Re: [PATCH-v3 1/9] vhost/scsi: Convert completion path to use copy_to_iser

2015-02-03 Thread Michael S. Tsirkin
nges existing code to save cmd->tvc_resp_iov instead of the > first single iovec base pointer from &vq->iov[out]. Typo in subject: should be copy_to_iter. > v3 changes: > - Convert memcpy_toiovecend -> copy_to_iser usage This belongs after --- > Cc: Michael S. Tsirkin

Re: [PATCH-v3 4/9] vhost/scsi: Add ANY_LAYOUT iov -> sgl mapping prerequisites

2015-02-03 Thread Michael S. Tsirkin
h your tree, you can drop these when applying, but it's best not to assume this, and put changelog after ---. > Cc: Michael S. Tsirkin > Cc: Paolo Bonzini > Signed-off-by: Nicholas Bellinger > --- > drivers/vhost/scsi.c | 93 > ++

Re: [PATCH-v3 0/9] vhost/scsi: Add ANY_LAYOUT + VERSION_1 support

2015-02-03 Thread Michael S. Tsirkin
On Tue, Feb 03, 2015 at 06:29:54AM +, Nicholas A. Bellinger wrote: > From: Nicholas Bellinger > > Hi MST, Paolo, Al & Co, > > Here is -v3 for adding vhost/scsi ANY_LAYOUT + VERSION_1 host feature > bit support. > > It adds a new vhost_virtqueue ->handle_kick() callback to determine the > st

Re: [PATCH-v3 7/9] vhost/scsi: Drop legacy pre virtio v1.0 !ANY_LAYOUT logic

2015-02-03 Thread Michael S. Tsirkin
head and drop the pre virtio 1.0 logic in vhost_scsi_handle_vq() > and associated helpers. Will probably be easier to review if you smash this with patch 5, this way we see both old and new code side by side. Also, let's rename _vqal to _vq in this patch? > Cc: Michael S. Tsirkin >

Re: [PATCH-v3 8/9] vhost/scsi: Drop left-over scsi_tcq.h include

2015-02-03 Thread Michael S. Tsirkin
. > > Cc: Michael S. Tsirkin > Cc: Paolo Bonzini > Signed-off-by: Nicholas Bellinger Acked-by: Michael S. Tsirkin > --- > drivers/vhost/scsi.c | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c > index 9af93d0..2

Re: [PATCH-v3 6/9] vhost/scsi: Set VIRTIO_F_ANY_LAYOUT + VIRTIO_F_VERSION_1 feature bits

2015-02-03 Thread Michael S. Tsirkin
On Tue, Feb 03, 2015 at 06:30:00AM +, Nicholas A. Bellinger wrote: > From: Nicholas Bellinger > > Signal support of VIRTIO_F_ANY_LAYOUT + VIRTIO_F_VERSION_1 feature bits > required for virtio-scsi 1.0 spec layout requirements. > > Cc: Michael S. Tsirkin > Cc: Paolo Bon

Re: [PATCH-v3 9/9] vhost/scsi: Global tcm_vhost -> vhost_scsi rename

2015-02-03 Thread Michael S. Tsirkin
d do a global rename to make the usage consistent. > > Cc: Michael S. Tsirkin > Cc: Paolo Bonzini > Signed-off-by: Nicholas Bellinger Yes, I've been wondering about that. Acked-by: Michael S. Tsirkin > --- > drivers/vhost/scsi.c | 662 > +

Re: [PATCH-v3 5/9] vhost/scsi: Add ANY_LAYOUT vhost_virtqueue callback

2015-02-03 Thread Michael S. Tsirkin
Convert prot_bytes offset to use iov_iter_advance > - Drop max_niov usage in vhost_scsi_handle_vqal > - Drop vhost_skip_iovec_bytes in favour of iov_iter > > Cc: Michael S. Tsirkin > Cc: Paolo Bonzini > Signed-off-by: Nicholas Bellinger > --- > drivers/vhost/scsi.c | 260 > +

Re: [PATCH-v3 5/9] vhost/scsi: Add ANY_LAYOUT vhost_virtqueue callback

2015-02-03 Thread Michael S. Tsirkin
> + * copy_from_iter() is modifying the iovecs as copies over > + * req_size bytes into req, so the returned out_iter.iov[0] > + * will contain the correct start + offset of the outgoing > + * WRITE payload, if DMA_TO_DEVICE is set. > +

Re: [PATCH-v3 5/9] vhost/scsi: Add ANY_LAYOUT vhost_virtqueue callback

2015-02-03 Thread Michael S. Tsirkin
On Tue, Feb 03, 2015 at 11:56:16PM +, Al Viro wrote: > On Tue, Feb 03, 2015 at 06:29:59AM +, Nicholas A. Bellinger wrote: > > +* Copy over the virtio-scsi request header, which when > > +* ANY_LAYOUT is enabled may span multiple iovecs, or a > > +* single

Re: [PATCH-v3 6/9] vhost/scsi: Set VIRTIO_F_ANY_LAYOUT + VIRTIO_F_VERSION_1 feature bits

2015-02-04 Thread Michael S. Tsirkin
On Wed, Feb 04, 2015 at 01:13:58AM -0800, Nicholas A. Bellinger wrote: > On Tue, 2015-02-03 at 11:40 +0200, Michael S. Tsirkin wrote: > > On Tue, Feb 03, 2015 at 06:30:00AM +, Nicholas A. Bellinger wrote: > > > From: Nicholas Bellinger > > > > > > S

Re: [PATCH-v3 5/9] vhost/scsi: Add ANY_LAYOUT vhost_virtqueue callback

2015-02-04 Thread Michael S. Tsirkin
On Wed, Feb 04, 2015 at 01:40:25AM -0800, Nicholas A. Bellinger wrote: > > > + /* > > > + * Any associated T10_PI bytes for the outgoing / incoming > > > + * payloads are included in calculation of exp_data_len here. > > > + */ > > > + if (out_size > req_s

Re: [PATCH-v3 5/9] vhost/scsi: Add ANY_LAYOUT vhost_virtqueue callback

2015-02-04 Thread Michael S. Tsirkin
On Wed, Feb 04, 2015 at 02:11:20AM -0800, Nicholas A. Bellinger wrote: > On Tue, 2015-02-03 at 23:56 +, Al Viro wrote: > > On Tue, Feb 03, 2015 at 06:29:59AM +, Nicholas A. Bellinger wrote: > > > + * Copy over the virtio-scsi request header, which when > > > + * ANY_LAYOUT

Re: [PATCH-v3 5/9] vhost/scsi: Add ANY_LAYOUT vhost_virtqueue callback

2015-02-04 Thread Michael S. Tsirkin
On Wed, Feb 04, 2015 at 02:41:07AM -0800, Nicholas A. Bellinger wrote: > On Wed, 2015-02-04 at 10:42 +0100, Michael S. Tsirkin wrote: > > On Wed, Feb 04, 2015 at 01:40:25AM -0800, Nicholas A. Bellinger wrote: > > > > > + /* > > > > > +

Re: [PATCH-v3 5/9] vhost/scsi: Add ANY_LAYOUT vhost_virtqueue callback

2015-02-04 Thread Michael S. Tsirkin
On Wed, Feb 04, 2015 at 02:41:07AM -0800, Nicholas A. Bellinger wrote: > On Wed, 2015-02-04 at 10:42 +0100, Michael S. Tsirkin wrote: > > On Wed, Feb 04, 2015 at 01:40:25AM -0800, Nicholas A. Bellinger wrote: > > > > > + /* > > > > > +

Re: [PATCH-v3 5/9] vhost/scsi: Add ANY_LAYOUT vhost_virtqueue callback

2015-02-04 Thread Michael S. Tsirkin
On Wed, Feb 04, 2015 at 02:55:12AM -0800, Nicholas A. Bellinger wrote: > On Wed, 2015-02-04 at 02:41 -0800, Nicholas A. Bellinger wrote: > > On Wed, 2015-02-04 at 10:42 +0100, Michael S. Tsirkin wrote: > > > On Wed, Feb 04, 2015 at 01:40:25AM -0800, Nicholas

[PATCH 60/86] scsi/arcmsr: use uapi/linux/pci_ids.h directly

2015-03-29 Thread Michael S. Tsirkin
Header moved from linux/pci_ids.h to uapi/linux/pci_ids.h, use the new header directly so we can drop the wrapper in include/linux/pci_ids.h. Signed-off-by: Michael S. Tsirkin --- drivers/scsi/arcmsr/arcmsr_hba.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi

[PATCH 61/86] scsi/qla1280: use uapi/linux/pci_ids.h directly

2015-03-29 Thread Michael S. Tsirkin
Header moved from linux/pci_ids.h to uapi/linux/pci_ids.h, use the new header directly so we can drop the wrapper in include/linux/pci_ids.h. Signed-off-by: Michael S. Tsirkin --- drivers/scsi/qla1280.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/qla1280.c b

Re: [PATCH 61/86] scsi/qla1280: use uapi/linux/pci_ids.h directly

2015-03-29 Thread Michael S. Tsirkin
On Sun, Mar 29, 2015 at 05:03:36PM +0300, James Bottomley wrote: > On Sun, 2015-03-29 at 15:42 +0200, Michael S. Tsirkin wrote: > > Header moved from linux/pci_ids.h to uapi/linux/pci_ids.h, > > use the new header directly so we can drop > > the wrapper in include/linux/pci_i

Re: [PATCH v2 1/5] virtio: add functions for piecewise addition of buffers

2012-12-18 Thread Michael S. Tsirkin
Some comments without arguing about whether the performance benefit is worth it. On Tue, Dec 18, 2012 at 01:32:48PM +0100, Paolo Bonzini wrote: > diff --git a/include/linux/virtio.h b/include/linux/virtio.h > index cf8adb1..39d56c4 100644 > --- a/include/linux/virtio.h > +++ b/include/linux/virtio

Re: [PATCH v2 2/5] virtio-scsi: use functions for piecewise composition of buffers

2012-12-18 Thread Michael S. Tsirkin
On Tue, Dec 18, 2012 at 01:32:49PM +0100, Paolo Bonzini wrote: > Using the new virtio_scsi_add_sg function lets us simplify the queueing > path. In particular, all data protected by the tgt_lock is just gone > (multiqueue will find a new use for the lock). vq access still needs some protection: v

Re: [PATCH v2 0/5] Multiqueue virtio-scsi, and API for piecewise buffer submission

2012-12-18 Thread Michael S. Tsirkin
On Tue, Dec 18, 2012 at 01:32:47PM +0100, Paolo Bonzini wrote: > Hi all, > > this series adds multiqueue support to the virtio-scsi driver, based > on Jason Wang's work on virtio-net. It uses a simple queue steering > algorithm that expects one queue per CPU. LUNs in the same target always > use

Re: [PATCH v2 5/5] virtio-scsi: introduce multiqueue support

2012-12-18 Thread Michael S. Tsirkin
On Tue, Dec 18, 2012 at 01:32:52PM +0100, Paolo Bonzini wrote: > This patch adds queue steering to virtio-scsi. When a target is sent > multiple requests, we always drive them to the same queue so that FIFO > processing order is kept. However, if a target was idle, we can choose > a queue arbitra

Re: [PATCH v2 1/5] virtio: add functions for piecewise addition of buffers

2012-12-18 Thread Michael S. Tsirkin
On Tue, Dec 18, 2012 at 02:43:51PM +0100, Paolo Bonzini wrote: > Il 18/12/2012 14:36, Michael S. Tsirkin ha scritto: > > Some comments without arguing about whether the performance > > benefit is worth it. > > > > On Tue, Dec 18, 2012 at 01:32:48PM +0100, Paolo Bonzi

Re: [PATCH v2 5/5] virtio-scsi: introduce multiqueue support

2012-12-18 Thread Michael S. Tsirkin
On Tue, Dec 18, 2012 at 03:08:08PM +0100, Paolo Bonzini wrote: > Il 18/12/2012 14:57, Michael S. Tsirkin ha scritto: > >> -static int virtscsi_queuecommand(struct Scsi_Host *sh, struct scsi_cmnd > >> *sc) > >> +static int virtscsi_queuecom

Re: [PATCH v2 1/5] virtio: add functions for piecewise addition of buffers

2012-12-18 Thread Michael S. Tsirkin
On Tue, Dec 18, 2012 at 03:32:15PM +0100, Paolo Bonzini wrote: > Il 18/12/2012 14:59, Michael S. Tsirkin ha scritto: > >>> Can't we track state internally to the virtqueue? Exposing it > >>> seems to buy us nothing since you can't call add_buf between >

Re: [PATCH v2 5/5] virtio-scsi: introduce multiqueue support

2012-12-18 Thread Michael S. Tsirkin
On Tue, Dec 18, 2012 at 04:51:28PM +0100, Paolo Bonzini wrote: > Il 18/12/2012 16:03, Michael S. Tsirkin ha scritto: > > On Tue, Dec 18, 2012 at 03:08:08PM +0100, Paolo Bonzini wrote: > >> Il 18/12/2012 14:57, Michael S. Tsirkin ha scritto: > >>>> -static int virts

Re: [PATCH v2 0/5] Multiqueue virtio-scsi, and API for piecewise buffer submission

2012-12-19 Thread Michael S. Tsirkin
On Wed, Dec 19, 2012 at 09:52:59AM +0100, Paolo Bonzini wrote: > Il 18/12/2012 23:18, Rolf Eike Beer ha scritto: > > Paolo Bonzini wrote: > >> Hi all, > >> > >> this series adds multiqueue support to the virtio-scsi driver, based > >> on Jason Wang's work on virtio-net. It uses a simple queue stee

Re: [PATCH v2 1/5] virtio: add functions for piecewise addition of buffers

2012-12-19 Thread Michael S. Tsirkin
On Wed, Dec 19, 2012 at 01:04:08PM +0100, Paolo Bonzini wrote: > Il 19/12/2012 11:47, Stefan Hajnoczi ha scritto: > > On Tue, Dec 18, 2012 at 01:32:48PM +0100, Paolo Bonzini wrote: > >> +/** > >> + * virtqueue_start_buf - start building buffer for the other end > >> + * @vq: the struct virtqueue we

Re: [PATCH v2 1/5] virtio: add functions for piecewise addition of buffers

2012-12-19 Thread Michael S. Tsirkin
On Wed, Dec 19, 2012 at 06:51:30PM +0200, Michael S. Tsirkin wrote: > On Wed, Dec 19, 2012 at 01:04:08PM +0100, Paolo Bonzini wrote: > > Il 19/12/2012 11:47, Stefan Hajnoczi ha scritto: > > > On Tue, Dec 18, 2012 at 01:32:48PM +0100, Paolo Bonzini wrote: > > >> +/**

DEFINE_IDA causing memory leaks? (was Re: [PATCH 1/2] virtio: fix memory leak of virtio ida cache layers)

2015-09-16 Thread Michael S. Tsirkin
ng ida_destroy() in the virtio core module > exit. > > Cc: "Michael S. Tsirkin" > Signed-off-by: Suman Anna Interesting. Will the same apply to e.g. sd_index_ida in drivers/scsi/sd.c or iscsi_sess_ida in drivers/scsi/scsi_transport_iscsi.c? If no, why not? One doesn

Re: DEFINE_IDA causing memory leaks? (was Re: [PATCH 1/2] virtio: fix memory leak of virtio ida cache layers)

2015-09-17 Thread Michael S. Tsirkin
On Thu, Sep 17, 2015 at 07:15:44AM -0700, James Bottomley wrote: > On Thu, 2015-09-17 at 08:33 +0300, Michael S. Tsirkin wrote: > > On Wed, Sep 16, 2015 at 07:29:17PM -0500, Suman Anna wrote: > > > The virtio core uses a static ida named virtio_index_ida for > > > assign

Re: [PATCH] vhost/scsi: Fix incorrect usage of get_user_pages_fast write parameter

2013-10-28 Thread Michael S. Tsirkin
irtio-scsi DMA_TO_DEVICE -> WRITE payload case. > > This bug would manifest itself as random process segmentation faults on > KVM host after repeated vhost starts + stops and/or with lots of vhost > endpoints + LUNs. > > Cc: Stefan Hajnoczi > Cc: Michael S. Tsirkin

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

2014-02-24 Thread Michael S. Tsirkin
On Mon, Feb 24, 2014 at 05:32:24AM +, Nicholas A. Bellinger wrote: > From: Nicholas Bellinger > > Hi MST, MKP, Paolo & Co, > > The following is an initial RFC series for allowing vhost/scsi to > accept T10 protection information (PI) as seperate SGLs along side > existing data payload SGLs f

[PATCH trivial] include linux/mutex.h from scsi_transport_iscsi.h

2007-07-25 Thread Michael S. Tsirkin
scsi/scsi_transport_iscsi.h uses struct mutex, so while linux/mutex.h seems to be pulled in indirectly by one of the headers it includes, the right thing is to include linux/mutex.h directly. Signed-off-by: Michael S. Tsirkin <[EMAIL PROTECTED]> --- diff --git a/includ

Re: [PATCH trivial] include linux/mutex.h from scsi_transport_iscsi.h

2007-07-25 Thread Michael S. Tsirkin
> Quoting Mike Christie <[EMAIL PROTECTED]>: > Subject: Re: [PATCH trivial] include linux/mutex.h from scsi_transport_iscsi.h > > Michael S. Tsirkin wrote: > >scsi/scsi_transport_iscsi.h uses struct mutex, so while > >linux/mutex.h seems to be pulled in indirect

[PATCH trivial v2] add includes to scsi_transport_iscsi.h

2007-07-26 Thread Michael S. Tsirkin
scsi/scsi_transport_iscsi.h uses struct mutex and struct list_head, so while linux/mutex.h and linux/list.h seem to be pulled in indirectly by one of the headers it includes, the right thing is to include linux/mutex.h and linus/list.h directly. Signed-off-by: Michael S. Tsirkin <[EMAIL PROTEC

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

2014-04-07 Thread Michael S. Tsirkin
> > v2 changes: > - Make protection buffer come before data buffer (Paolo) > - Enable virtio_scsi_cmd_req_pi usage (Paolo) > > Cc: Paolo Bonzini > Cc: Michael S. Tsirkin > Cc: Martin K. Petersen > Cc: Christoph Hellwig > Cc: Hannes Reinecke > Cc: Sagi Grim

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

2014-04-07 Thread Michael S. Tsirkin
On Mon, Apr 07, 2014 at 01:56:59AM -0700, Nicholas A. Bellinger wrote: > On Mon, 2014-04-07 at 11:45 +0300, Michael S. Tsirkin wrote: > > On Sun, Apr 06, 2014 at 09:32:09PM +, Nicholas A. Bellinger wrote: > > > From: Nicholas Bellinger > > > > > > This pat

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

2014-04-07 Thread Michael S. Tsirkin
eature_bit for determining virtio-scsi header type (Paolo) > > v2 changes: > - Use virtio_scsi_cmd_req_pi instead of existing ->prio (Paolo) > - Make protection buffer come before data buffer (Paolo) > - Update vhost_scsi_get_tag() parameter usage > > Cc: Michael S. Ts

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

2014-04-07 Thread Michael S. Tsirkin
are expected to > preceed the data buffers. > > Also add new VIRTIO_SCSI_F_T10_PI feature bit to be used to signal > host support. > > Cc: Paolo Bonzini > Cc: Michael S. Tsirkin > Cc: Martin K. Petersen > Cc: Christoph Hellwig > Cc: Hannes Reinecke > Cc: Sagi

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

2014-04-09 Thread Michael S. Tsirkin
On Tue, Apr 08, 2014 at 04:31:26PM -0400, Paolo Bonzini wrote: > 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

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

2014-05-07 Thread Michael S. Tsirkin
On Mon, Apr 07, 2014 at 01:56:59AM -0700, Nicholas A. Bellinger wrote: > On Mon, 2014-04-07 at 11:45 +0300, Michael S. Tsirkin wrote: > > On Sun, Apr 06, 2014 at 09:32:09PM +, Nicholas A. Bellinger wrote: > > > From: Nicholas Bellinger > > > > > > This pat

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

2014-05-19 Thread Michael S. Tsirkin
On Mon, May 19, 2014 at 12:07:03PM -0700, Nicholas A. Bellinger wrote: > On Wed, 2014-05-07 at 12:13 +0300, Michael S. Tsirkin wrote: > > On Mon, Apr 07, 2014 at 01:56:59AM -0700, Nicholas A. Bellinger wrote: > > > On Mon, 2014-04-07 at 11:45 +0300, Michael S. Tsirkin wrote: >

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

2014-05-19 Thread Michael S. Tsirkin
On Mon, May 19, 2014 at 01:54:50PM -0700, Nicholas A. Bellinger wrote: > On Mon, 2014-05-19 at 22:15 +0300, Michael S. Tsirkin wrote: > > On Mon, May 19, 2014 at 12:07:03PM -0700, Nicholas A. Bellinger wrote: > > > On Wed, 2014-05-07 at 12:13 +0300, Michael S. Tsirkin wrote: >

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

2014-05-21 Thread Michael S. Tsirkin
rop versioning info from commit log, move it out to notes (after ---) >- Use pi_bytesout + pi_bytesin instead of niovs (mst + paolo) Right, so maybe update the commit log above to match? It gave me pause. > Cc: Paolo Bonzini > Cc: Michael S. Tsirkin > Cc: Martin K. Petersen >

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

2014-06-02 Thread Michael S. Tsirkin
fromiovecend() (mst) > - Convert vhost_scsi_handle_vq to use pi_bytesout + pi_bytesin (nab) > - 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) > > Please revi

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

2014-06-08 Thread Michael S. Tsirkin
fromiovecend() (mst) > - Convert vhost_scsi_handle_vq to use pi_bytesout + pi_bytesin (nab) > - 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) > > Please review for v3.

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

2014-06-09 Thread Michael S. Tsirkin
gt; > v2 changes: > - Use virtio_scsi_cmd_req_pi instead of existing ->prio (Paolo) > - Make protection buffer come before data buffer (Paolo) > - Update vhost_scsi_get_tag() parameter usage > > Cc: Michael S. Tsirkin > Cc: Paolo Bonzini > Cc: Martin K. Petersen &

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

2014-06-09 Thread Michael S. Tsirkin
are expected to > preceed the data buffers. > > Also add new VIRTIO_SCSI_F_T10_PI feature bit to be used to signal > host support. > > v4 changes: >- Use pi_bytesout + pi_bytesin instead of niovs (mst + paolo) > > Cc: Paolo Bonzini > Cc: Michael S. Tsirkin >

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

2014-06-09 Thread Michael S. Tsirkin
On Thu, May 22, 2014 at 02:26:16AM +, Nicholas A. Bellinger wrote: > 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. > > Follow

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

2014-06-10 Thread Michael S. Tsirkin
On Tue, Jun 10, 2014 at 12:05:12AM -0700, Nicholas A. Bellinger wrote: > On Mon, 2014-06-09 at 16:30 +0300, Michael S. Tsirkin wrote: > > On Thu, May 22, 2014 at 02:26:16AM +, Nicholas A. Bellinger wrote: > > > From: Nicholas Bellinger > > > > > > Hi MST

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

2014-06-10 Thread Michael S. Tsirkin
On Tue, Jun 10, 2014 at 09:52:17PM +1000, Stephen Rothwell wrote: > Hi Michael, > > On Tue, 10 Jun 2014 12:42:54 +0300 "Michael S. Tsirkin" > wrote: > > > > So I see two options: > > - I go ahead with my changes and you with yours and let Linus resolv

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

2014-06-10 Thread Michael S. Tsirkin
On Tue, Jun 10, 2014 at 10:39:17AM -0700, Nicholas A. Bellinger wrote: > On Tue, 2014-06-10 at 16:02 +0300, Michael S. Tsirkin wrote: > > On Tue, Jun 10, 2014 at 09:52:17PM +1000, Stephen Rothwell wrote: > > > Hi Michael, > > > > > > On Tue, 10 Jun 201

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

2014-06-10 Thread Michael S. Tsirkin
On Tue, Jun 10, 2014 at 10:39:17AM -0700, Nicholas A. Bellinger wrote: > On Tue, 2014-06-10 at 16:02 +0300, Michael S. Tsirkin wrote: > > On Tue, Jun 10, 2014 at 09:52:17PM +1000, Stephen Rothwell wrote: > > > Hi Michael, > > > > > > On Tue, 10 Jun 201

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

2014-06-11 Thread Michael S. Tsirkin
On Tue, Jun 10, 2014 at 02:20:28PM -0700, Nicholas A. Bellinger wrote: > On Tue, 2014-06-10 at 13:56 -0700, Linus Torvalds wrote: > > On Tue, Jun 10, 2014 at 1:25 PM, Nicholas A. Bellinger > > wrote: > > > > > > That would work, or I can simply include a pointer to Stephen's patch in > > > the tar

[PULL] vhost: infrastructure changes for 3.16

2014-06-11 Thread Michael S. Tsirkin
vmalloc (same as for vhost-scsi) this makes it possible to create the device on systems where memory is very fragmented, with slightly lower performance. Signed-off-by: Michael S. Tsirkin Michael S. Tsirkin (4): vhost-net

Re: [PULL] vhost: infrastructure changes for 3.16

2014-06-12 Thread Michael S. Tsirkin
On Thu, Jun 12, 2014 at 10:42:34AM +0200, Romain Francoise wrote: > "Michael S. Tsirkin" writes: > > > Memory allocation for vhost-net now supports fallback on vmalloc (same > > as for vhost-scsi) this makes it possible to create the device on > > systems whe

Re: [PATCH] virtio_scsi: remove duplicate check if queue is broken

2024-01-16 Thread Michael S. Tsirkin
On Tue, Jan 16, 2024 at 12:58:36PM +0800, Li RongQing wrote: > virtqueue_enable_cb() will call virtqueue_poll() which will check if > queue is broken at beginning, so remove the virtqueue_is_broken() call > > Signed-off-by: Li RongQing Acked-by: Michael S. Tsirkin > ---

Re: [PATCH 1/2] virtio: Reduce BUG if total_sg > virtqueue size to WARN.

2017-08-10 Thread Michael S. Tsirkin
On Thu, Aug 10, 2017 at 05:40:34PM +0100, Richard W.M. Jones wrote: > If using indirect descriptors, you can make the total_sg as large as > you want. That would be a spec violation though, even if it happens to work on current QEMU. The spec says: A driver MUST NOT create a descriptor ch

Re: [PATCH 1/2] virtio: Reduce BUG if total_sg > virtqueue size to WARN.

2017-08-10 Thread Michael S. Tsirkin
On Thu, Aug 10, 2017 at 10:30:38PM +0100, Richard W.M. Jones wrote: > On Fri, Aug 11, 2017 at 12:21:16AM +0300, Michael S. Tsirkin wrote: > > On Thu, Aug 10, 2017 at 05:40:34PM +0100, Richard W.M. Jones wrote: > > > If using indirect descriptors, you can make the total_sg as

Re: [PATCH 1/2] virtio: Reduce BUG if total_sg > virtqueue size to WARN.

2017-08-10 Thread Michael S. Tsirkin
On Thu, Aug 10, 2017 at 10:35:11PM +0100, Richard W.M. Jones wrote: > On Fri, Aug 11, 2017 at 12:31:44AM +0300, Michael S. Tsirkin wrote: > > Then we probably should fail probe if vq size is too small. > > What does this mean? > > Rich. We must prevent driver from submittin

Re: [PATCH 1/2] virtio: Reduce BUG if total_sg > virtqueue size to WARN.

2017-08-11 Thread Michael S. Tsirkin
On Fri, Aug 11, 2017 at 04:09:26PM +0200, Paolo Bonzini wrote: > On 10/08/2017 23:41, Michael S. Tsirkin wrote: > >>> Then we probably should fail probe if vq size is too small. > >> What does this mean? > > > > We must prevent driver from submitting s/g lis

Re: [RFC-v2 0/4] tcm_vhost+cmwq fabric driver code for-3.6

2012-07-17 Thread Michael S. Tsirkin
On Wed, Jul 11, 2012 at 09:15:00PM +, Nicholas A. Bellinger wrote: > From: Nicholas Bellinger > > Hi folks, > > The following is a RFC-v2 series of tcm_vhost target fabric driver code > currently in-flight for-3.6 mainline code. > > After last week's developments along with the help of some

Re: [PATCH RESEND 0/5] Add vhost-blk support

2012-07-17 Thread Michael S. Tsirkin
On Fri, Jul 13, 2012 at 04:55:06PM +0800, Asias He wrote: > > Hi folks, > > [I am resending to fix the broken thread in the previous one.] > > This patchset adds vhost-blk support. vhost-blk is a in kernel virito-blk > device accelerator. Compared to userspace virtio-blk implementation, vhost-bl

Re: [RFC-v2 0/4] tcm_vhost+cmwq fabric driver code for-3.6

2012-07-17 Thread Michael S. Tsirkin
On Tue, Jul 17, 2012 at 01:55:42PM -0500, Anthony Liguori wrote: > On 07/17/2012 10:05 AM, Michael S. Tsirkin wrote: > >On Wed, Jul 11, 2012 at 09:15:00PM +, Nicholas A. Bellinger wrote: > >>From: Nicholas Bellinger > >> > >>Hi folks, > >> >

Re: [RFC-v2 0/4] tcm_vhost+cmwq fabric driver code for-3.6

2012-07-17 Thread Michael S. Tsirkin
On Tue, Jul 17, 2012 at 02:17:22PM -0700, Nicholas A. Bellinger wrote: > On Tue, 2012-07-17 at 18:05 +0300, Michael S. Tsirkin wrote: > > On Wed, Jul 11, 2012 at 09:15:00PM +, Nicholas A. Bellinger wrote: > > > From: Nicholas Bellinger > > > > > > Hi fo

Re: [RFC-v2 0/4] tcm_vhost+cmwq fabric driver code for-3.6

2012-07-17 Thread Michael S. Tsirkin
On Tue, Jul 17, 2012 at 02:17:22PM -0700, Nicholas A. Bellinger wrote: > Wrt to staging, I'd like to avoid mucking with staging because: > > *) The code has been posted for review > *) The code has been converted to use the latest target-core primitives > *) The code does not require cleanups betw

Re: [RFC-v2 0/4] tcm_vhost+cmwq fabric driver code for-3.6

2012-07-17 Thread Michael S. Tsirkin
On Tue, Jul 17, 2012 at 03:02:08PM -0700, Nicholas A. Bellinger wrote: > On Wed, 2012-07-18 at 00:34 +0300, Michael S. Tsirkin wrote: > > On Tue, Jul 17, 2012 at 02:17:22PM -0700, Nicholas A. Bellinger wrote: > > > On Tue, 2012-07-17 at 18:05 +0300, Michael S. Tsirkin wrote: >

Re: [RFC-v2 0/4] tcm_vhost+cmwq fabric driver code for-3.6

2012-07-17 Thread Michael S. Tsirkin
On Tue, Jul 17, 2012 at 03:37:20PM -0700, Nicholas A. Bellinger wrote: > On Wed, 2012-07-18 at 01:18 +0300, Michael S. Tsirkin wrote: > > On Tue, Jul 17, 2012 at 03:02:08PM -0700, Nicholas A. Bellinger wrote: > > > On Wed, 2012-07-18 at 00:34 +0300, Michael S. Tsirkin wrote: >

Re: [RFC-v3 0/4] tcm_vhost+cmwq fabric driver code for-3.6

2012-07-18 Thread Michael S. Tsirkin
On Wed, Jul 18, 2012 at 12:59:28AM +, Nicholas A. Bellinger wrote: > From: Nicholas Bellinger > > Hi folks, > > The following is the RFC-v3 series of tcm_vhost target fabric driver code > currently in-flight for-3.6 mainline code. > > With the merge window opening soon, the tcm_vhost code h

Re: [RFC-v3 3/4] vhost: Add vhost_scsi specific defines

2012-07-18 Thread Michael S. Tsirkin
> that is used by tcm_vhost code when locating target ports during qemu setup. > > Signed-off-by: Stefan Hajnoczi > Cc: Zhi Yong Wu > Cc: Michael S. Tsirkin > Cc: Paolo Bonzini , > Signed-off-by: Nicholas A. Bellinger > --- > include/linux/vhost.h |9 + >

Re: [RFC-v2 0/4] tcm_vhost+cmwq fabric driver code for-3.6

2012-07-18 Thread Michael S. Tsirkin
On Wed, Jul 18, 2012 at 08:42:21AM -0500, Anthony Liguori wrote: > On 07/17/2012 04:50 PM, Nicholas A. Bellinger wrote: > >On Tue, 2012-07-17 at 13:55 -0500, Anthony Liguori wrote: > >>On 07/17/2012 10:05 AM, Michael S. Tsirkin wrote: > >>>On Wed, Jul 11, 2012 a

  1   2   >