Re: [PATCH] tools/virtio: add sg_unmark_end to scatterlist.h

2013-02-27 Thread Rusty Russell
Wanlong Gao gaowanl...@cn.fujitsu.com writes: Add sg_unmark_end to scatterlist.h to fix compile. Signed-off-by: Wanlong Gao gaowanl...@cn.fujitsu.com Thanks, I have the same patch in my series, which is in flux, but can be found in my pending-rebases branch:

Re: Wrappers for vringh (was Re: [PATCHv2 vringh 1/3] remoteproc: Add support for vringh (Host vrings))

2013-02-27 Thread Rusty Russell
Sjur Brændeland sjurb...@gmail.com writes: On Fri, Feb 22, 2013 at 1:42 AM, Rusty Russell ru...@rustcorp.com.au wrote: Ohad Ben-Cohen o...@wizery.com writes: On Thu, Feb 21, 2013 at 8:37 AM, Rusty Russell ru...@rustcorp.com.au wrote: What do you think about creating some virtio-level

Re: [PATCH 08/16] virtio_ring: virtqueue_add_outbuf / virtqueue_add_inbuf.

2013-02-27 Thread Rusty Russell
Michael S. Tsirkin m...@redhat.com writes: On Fri, Feb 22, 2013 at 10:32:46AM +1030, Rusty Russell wrote: Michael S. Tsirkin m...@redhat.com writes: On Tue, Feb 19, 2013 at 06:26:26PM +1030, Rusty Russell wrote: These are specialized versions of virtqueue_add_buf(), which cover over 50

Re: [PATCH] tools/virtio: add sg_unmark_end to scatterlist.h

2013-02-27 Thread Rusty Russell
Wanlong Gao gaowanl...@cn.fujitsu.com writes: On 02/28/2013 10:57 AM, Rusty Russell wrote: Wanlong Gao gaowanl...@cn.fujitsu.com writes: Add sg_unmark_end to scatterlist.h to fix compile. Signed-off-by: Wanlong Gao gaowanl...@cn.fujitsu.com Thanks, I have the same patch in my series

Re: [PATCH] virtio-blk: emit udev event when device is resized

2013-02-26 Thread Rusty Russell
+=/sbin/pvresize /dev/%k Signed-off-by: Milos Vyletel milos.vyle...@sde.cz Tested-by: Asias He as...@redhat.com Signed-off-by: Rusty Russell ru...@rustcorp.com.au (minor simplification) diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c index 8ad21a2..922bcb9 100644 --- a/drivers

Re: [PATCH 02/16] virtio_ring: virtqueue_add_sgs, to add multiple sgs.

2013-02-26 Thread Rusty Russell
Paolo Bonzini pbonz...@redhat.com writes: Il 24/02/2013 23:12, Michael S. Tsirkin ha scritto: On Tue, Feb 19, 2013 at 06:26:20PM +1030, Rusty Russell wrote: virtio_scsi can really use this, to avoid the current hack of copying the whole sg array. Some other things get slightly neater, too

Re: [PATCHv2 vringh 1/3] remoteproc: Add support for vringh (Host vrings)

2013-02-25 Thread Rusty Russell
Ohad Ben-Cohen o...@wizery.com writes: On Thu, Feb 21, 2013 at 8:37 AM, Rusty Russell ru...@rustcorp.com.au wrote: Hmm... I clearly jumped the gun, assuming consensus was already reached. I have put these patches *back* into pending-rebases, and they will not be merged this merge window

Re: [PATCH] virtio-blk: emit udev event when device is resized

2013-02-25 Thread Rusty Russell
Milos Vyletel milos.vyle...@sde.cz writes: When virtio-blk device is resized from host (using block_resize from QEMU) emit KOBJ_CHANGE uevent to notify guest about such change. This allows user to have custom udev rules which would take whatever action if such event occurs. As a proof of

Re: [PATCH 08/16] virtio_ring: virtqueue_add_outbuf / virtqueue_add_inbuf.

2013-02-25 Thread Rusty Russell
Michael S. Tsirkin m...@redhat.com writes: On Tue, Feb 19, 2013 at 06:26:26PM +1030, Rusty Russell wrote: These are specialized versions of virtqueue_add_buf(), which cover over 50% of cases and are far clearer. In particular, the scatterlists passed to these functions don't have

Re: [PATCH 02/16] virtio_ring: virtqueue_add_sgs, to add multiple sgs.

2013-02-25 Thread Rusty Russell
Michael S. Tsirkin m...@redhat.com writes: On Tue, Feb 19, 2013 at 06:26:20PM +1030, Rusty Russell wrote: virtio_scsi can really use this, to avoid the current hack of copying the whole sg array. Some other things get slightly neater, too. Signed-off-by: Rusty Russell ru...@rustcorp.com.au

Re: [PATCH 00/16] virtio ring rework.

2013-02-20 Thread Rusty Russell
Paolo Bonzini pbonz...@redhat.com writes: Il 19/02/2013 08:56, Rusty Russell ha scritto: OK, this is (ab)uses some of Paolo's patches. The first 7 are candidates for this merge window (maybe), the rest I'm not so sure about. Cool, thanks. Thanks, Rusty. Paolo Bonzini (3

Re: [PATCHv2 vringh 1/3] remoteproc: Add support for vringh (Host vrings)

2013-02-20 Thread Rusty Russell
Ohad Ben-Cohen o...@wizery.com writes: Hi Sjur, On Tue, Feb 12, 2013 at 1:49 PM, sjur.brandel...@stericsson.com wrote: From: Sjur Brændeland sjur.brandel...@stericsson.com Add functions for creating, deleting and kicking host-side virtio rings. The host ring is not integrated with

Re: [PATCH 17/16 V2] virtio-scsi: use virtqueue_add_sgs for command buffers

2013-02-20 Thread Rusty Russell
Asias He as...@redhat.com writes: On 02/20/2013 05:47 PM, Wanlong Gao wrote: Using the new virtqueue_add_sgs 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). Signed-off-by: Paolo

Re: [PATCH 04/16] virtio-blk: use virtqueue_start_buf on bio path

2013-02-20 Thread Rusty Russell
Asias He as...@redhat.com writes: On 02/19/2013 03:56 PM, Rusty Russell wrote: (This is a respin of Paolo Bonzini's patch, but it calls virtqueue_add_sgs() instead of his multi-part API). ... (This subject needs to be changed to reflect using of virtqueue_add_sgs) Thanks, done. -static

Re: [PATCH 10/16] virtio_net: use virtqueue_add_sgs[] for command buffers.

2013-02-20 Thread Rusty Russell
Wanlong Gao gaowanl...@cn.fujitsu.com writes: On 02/19/2013 03:56 PM, Rusty Russell wrote: It's a bit cleaner to hand multiple sgs, rather than one big one. Signed-off-by: Rusty Russell ru...@rustcorp.com.au ... +BUG_ON(!virtio_has_feature(vi-vdev, VIRTIO_NET_F_CTRL_VQ

Re: [PATCH] virtio_console: Let unconnected rproc device receive data.

2013-02-19 Thread Rusty Russell
Michael S. Tsirkin m...@redhat.com writes: On Tue, Feb 12, 2013 at 11:01:10AM +0100, Sjur Brændeland wrote: On Tue, Feb 12, 2013 at 10:42 AM, Michael S. Tsirkin m...@redhat.com wrote: ... How about setting port-guest_connected = true in the init routines instead? Keeps this code path

[PATCH 0/5] vringh

2013-02-19 Thread Rusty Russell
This introduces vringh, which are generic accessors for virtio rings (host side). There's a host-side implementation in vhost, but it assumes that the rings are in userspace, and is tied to the vhost implementation. I have patches to adapt it to use vringh, but I'm pushing this in the next merge

Re: [PATCH vringh 2/2] caif_virtio: Introduce caif over virtio

2013-02-19 Thread Rusty Russell
Sjur Brændeland sjurb...@gmail.com writes: Sjur Brændeland sjurb...@gmail.com writes: How about supporting struct vringh_kiov and struct kvec as well? I currently get the following complaints with my V2 patch-set: drivers/net/caif/caif_virtio.c:486:2: warning: passing argument 1 of

Re: [PATCH 0/9] virtio: new API for addition of buffers, scatterlist changes

2013-02-19 Thread Rusty Russell
Paolo Bonzini pbonz...@redhat.com writes: virtio_ring: virtqueue_add_sgs, to add multiple sgs. virtio_scsi and virtio_blk can really use these, to avoid their current hack of copying the whole sg array. Signed-off-by: Ruty Russell ru...@rustcorp.com.au It's much better than the other

Re: [PATCHv2 vringh 3/3] caif_virtio: Introduce caif over virtio

2013-02-19 Thread Rusty Russell
sjur.brandel...@stericsson.com writes: From: Vikram ARV vikram@stericsson.com Add the the Virtio shared memory driver for STE Modems. caif_virtio is implemented utilizing the virtio framework for data transport and is managed with the remoteproc frameworks. The Virtio queue is used for

[PATCH 3/5] tools/virtio: fix compile.

2013-02-19 Thread Rusty Russell
Didn't test that it actually works, mind you! Signed-off-by: Rusty Russell ru...@rustcorp.com.au --- tools/virtio/linux/virtio.h |9 - tools/virtio/virtio_test.c |6 +++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/tools/virtio/linux/virtio.h b/tools/virtio

[PATCH 00/16] virtio ring rework.

2013-02-19 Thread Rusty Russell
path Rusty Russell (13): virtio_ring: virtqueue_add_sgs, to add multiple sgs. virtio-blk: use virtqueue_start_buf on bio path virtio_blk: remove nents member. virtio_ring: don't count elements twice for add_buf path. virtio_ring: virtqueue_add_outbuf / virtqueue_add_inbuf. virtio_net: use

[PATCH 1/5] virtio_ring: expose virtio barriers for use in vringh.

2013-02-19 Thread Rusty Russell
The host side of ring needs this logic too. Signed-off-by: Rusty Russell ru...@rustcorp.com.au --- drivers/virtio/virtio_ring.c | 33 +--- include/linux/virtio_ring.h | 57 ++ 2 files changed, 63 insertions(+), 27 deletions

[PATCH 01/16] scatterlist: introduce sg_unmark_end

2013-02-19 Thread Rusty Russell
-by: Rusty Russell ru...@rustcorp.com.au --- block/blk-integrity.c |2 +- block/blk-merge.c |2 +- include/linux/scatterlist.h | 16 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/block/blk-integrity.c b/block/blk-integrity.c index da2a818..0f5004f

[PATCH 02/16] virtio_ring: virtqueue_add_sgs, to add multiple sgs.

2013-02-19 Thread Rusty Russell
virtio_scsi can really use this, to avoid the current hack of copying the whole sg array. Some other things get slightly neater, too. Signed-off-by: Rusty Russell ru...@rustcorp.com.au --- drivers/virtio/virtio_ring.c | 144 ++ include/linux/virtio.h

[PATCH 5/5] tools/virtio: add vring_test.

2013-02-19 Thread Rusty Russell
, pinged 3172148 Time: R=17.659 U=6.640 S=6.640 ./vringh_test --eventidx --parallel: Using CPUS 0 and 3 Guest: notified 156357, pinged 156251 Host: notified 156251, pinged 78179 Time: R=4.518 U=3.536 S=3.536 Signed-off-by: Rusty Russell ru...@rustcorp.com.au

[PATCH 4/5] tools/virtio: separate headers more.

2013-02-19 Thread Rusty Russell
This makes them a bit more like the kernel headers, so we can include more real kernel headers in our tests. Signed-off-by: Rusty Russell ru...@rustcorp.com.au --- tools/virtio/asm/barrier.h | 14 +++ tools/virtio/linux/bug.h| 10 ++ tools/virtio/linux/err.h

[PATCH 03/16] virtio-blk: reorganize virtblk_add_req

2013-02-19 Thread Rusty Russell
. Signed-off-by: Paolo Bonzini pbonz...@redhat.com Reviewed-by: Asias He as...@redhat.com Signed-off-by: Rusty Russell ru...@rustcorp.com.au --- drivers/block/virtio_blk.c | 55 1 file changed, 20 insertions(+), 35 deletions(-) diff --git a/drivers/block

[PATCH 05/16] virtio-blk: use virtqueue_add_sgs on req path

2013-02-19 Thread Rusty Russell
the req path doesn't use vbr-sg, however, we need to add a couple of arguments to __virtblk_add_req. We also need to teach __virtblk_add_req how to build SCSI command requests. Signed-off-by: Paolo Bonzini pbonz...@redhat.com Signed-off-by: Rusty Russell ru...@rustcorp.com.au --- drivers/block

[PATCH 06/16] virtio_blk: remove nents member.

2013-02-19 Thread Rusty Russell
It's simply a flag as to whether we have data now, so make it an explicit function parameter rather than a member of struct virtblk_req. Signed-off-by: Rusty Russell ru...@rustcorp.com.au --- drivers/block/virtio_blk.c | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions

[PATCH 07/16] virtio_ring: don't count elements twice for add_buf path.

2013-02-19 Thread Rusty Russell
Extract the post-counting code into virtqueue_add(), make both callers use it. Signed-off-by: Rusty Russell ru...@rustcorp.com.au --- drivers/virtio/virtio_ring.c | 147 +++--- 1 file changed, 80 insertions(+), 67 deletions(-) diff --git a/drivers/virtio

[PATCH 09/16] virtio_net: use simplified virtqueue accessors.

2013-02-19 Thread Rusty Russell
We never add buffers with input and output parts, so use the new accessors. Signed-off-by: Rusty Russell ru...@rustcorp.com.au --- drivers/net/virtio_net.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index

[PATCH 11/16] virtio_rng: use simplified virtqueue accessors.

2013-02-19 Thread Rusty Russell
We never add buffers with input and output parts, so use the new accessors. Signed-off-by: Rusty Russell ru...@rustcorp.com.au --- drivers/char/hw_random/virtio-rng.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/char/hw_random/virtio-rng.c b/drivers/char

[PATCH 10/16] virtio_net: use virtqueue_add_sgs[] for command buffers.

2013-02-19 Thread Rusty Russell
It's a bit cleaner to hand multiple sgs, rather than one big one. Signed-off-by: Rusty Russell ru...@rustcorp.com.au --- drivers/net/virtio_net.c | 50 ++ 1 file changed, 24 insertions(+), 26 deletions(-) diff --git a/drivers/net/virtio_net.c b

[PATCH 13/16] caif_virtio: use simplified virtqueue accessors.

2013-02-19 Thread Rusty Russell
We never add buffers with input and output parts, so use the new accessors. Signed-off-by: Rusty Russell ru...@rustcorp.com.au --- drivers/net/caif/caif_virtio.c |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/caif/caif_virtio.c b/drivers/net/caif

[PATCH 08/16] virtio_ring: virtqueue_add_outbuf / virtqueue_add_inbuf.

2013-02-19 Thread Rusty Russell
which conditionally ignored end markers in the iterator, but it was ugly and I suspect this is just as fast. Maybe we should just fix all the drivers? Signed-off-by: Rusty Russell ru...@rustcorp.com.au --- drivers/virtio/virtio_ring.c | 58 ++ include/linux

[PATCH 14/16] virtio_rpmsg_bus: use simplified virtqueue accessors.

2013-02-19 Thread Rusty Russell
We never add buffers with input and output parts, so use the new accessors. Signed-off-by: Rusty Russell ru...@rustcorp.com.au --- drivers/rpmsg/virtio_rpmsg_bus.c |8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/rpmsg/virtio_rpmsg_bus.c b/drivers/rpmsg

[PATCH 15/16] virtio_balloon: use simplified virtqueue accessors.

2013-02-19 Thread Rusty Russell
We never add buffers with input and output parts, so use the new accessors. Signed-off-by: Rusty Russell ru...@rustcorp.com.au --- drivers/virtio/virtio_balloon.c |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio

[PATCH 12/16] virtio_console: use simplified virtqueue accessors.

2013-02-19 Thread Rusty Russell
We never add buffers with input and output parts, so use the new accessors. Signed-off-by: Rusty Russell ru...@rustcorp.com.au --- drivers/char/virtio_console.c |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/char/virtio_console.c b/drivers/char

[PATCH 16/16] 9p/trans_virtio.c: use virtio_add_sgs[]

2013-02-19 Thread Rusty Russell
virtio_add_buf() is going away, replaced with virtio_add_sgs() which takes multiple terminated scatterlists. Signed-off-by: Rusty Russell ru...@rustcorp.com.au --- net/9p/trans_virtio.c | 48 +++- 1 file changed, 39 insertions(+), 9 deletions

Re: [PATCH 0/5] vringh

2013-02-19 Thread Rusty Russell
Michael S. Tsirkin m...@redhat.com writes: On Tue, Feb 19, 2013 at 08:59:27AM +1030, Rusty Russell wrote: This introduces vringh, which are generic accessors for virtio rings (host side). There's a host-side implementation in vhost, but it assumes that the rings are in userspace

Re: [PATCH vringh 2/2] caif_virtio: Introduce caif over virtio

2013-02-15 Thread Rusty Russell
Sjur Brændeland sjurb...@gmail.com writes: How about supporting struct vringh_kiov and struct kvec as well? I currently get the following complaints with my V2 patch-set: drivers/net/caif/caif_virtio.c:486:2: warning: passing argument 1 of ‘vringh_iov_init’ from incompatible pointer type

Re: [PATCH] virtio-spec: Define virtio-mmio registers as LE

2013-02-14 Thread Rusty Russell
Pawel Moll pawel.m...@arm.com writes: To solve the never-ending confusions between hosts and guests of different endianess, define all virtio-mmio registers as LE. This change should be safe at this stage, because no known working mixed-endian system exists so there is virtually no risk of

Re: [RFC PATCH 0/8] virtio: new API for addition of buffers, scatterlist changes

2013-02-13 Thread Rusty Russell
Jens Axboe ax...@kernel.dk writes: On Fri, Feb 08 2013, Rusty Russell wrote: Paolo Bonzini pbonz...@redhat.com writes: The virtqueue_add_buf function has two limitations: 1) it requires the caller to provide all the buffers in a single call; 2) it does not support chained scatterlists

RE: [PATCH vringh 2/2] caif_virtio: Introduce caif over virtio

2013-02-13 Thread Rusty Russell
Sjur BRENDELAND sjur.brandel...@stericsson.com writes: Hi Rusty, From: Rusty Russell [mailto:ru...@rustcorp.com.au] sjur.brandel...@stericsson.com writes: +struct cfv_napi_context { + struct vringh_kiov riov; + unsigned short head; +}; Usually we use an int, and -1. I imagine

Re: [PATCH 1/6] virtio_host: host-side implementation of virtio rings.

2013-02-13 Thread Rusty Russell
Sjur Brændeland sjurb...@gmail.com writes: Hi Rusty, On Mon, Feb 4, 2013 at 10:44 PM, Rusty Russell ru...@rustcorp.com.au wrote: Sjur Brændeland sjurb...@gmail.com writes: ... I guess my vringh related stuff should go into your tree together with your vringh patches... Would you be willing

Re: [PATCH] virtio_console: Initialize guest_connected=true for rproc_serial

2013-02-13 Thread Rusty Russell
sjur.brandel...@stericsson.com writes: From: Sjur Brændeland sjur.brandel...@stericsson.com When rproc_serial is initialized, guest_connected should be set to true. We can then revert the extra checks introduced in commit: virtio_console: Let unconnected rproc device receive data.

Re: [RFC PATCH] virt_mmio: fix signature checking for BE guests

2013-02-13 Thread Rusty Russell
Michael S. Tsirkin m...@redhat.com writes: On Wed, Feb 13, 2013 at 03:28:52PM +, Marc Zyngier wrote: On 13/02/13 15:08, Pawel Moll wrote: On Wed, 2013-02-13 at 14:25 +, Marc Zyngier wrote: Using readl() to read the magic value and then memcmp() to check it fails on BE, as bytes

Re: [PATCH 0/9] virtio: new API for addition of buffers, scatterlist changes

2013-02-13 Thread Rusty Russell
Paolo Bonzini pbonz...@redhat.com writes: This series adds a different set of APIs for adding a buffer to a virtqueue. The new API lets you pass the buffers piecewise, wrapping multiple calls to virtqueue_add_sg between virtqueue_start_buf and virtqueue_end_buf. Letting drivers call

Re: linux-next: Tree for Feb 13 (virtio_console)

2013-02-13 Thread Rusty Russell
Randy Dunlap rdun...@infradead.org writes: On 02/13/13 00:35, Stephen Rothwell wrote: Hi all, Changes since 20130212: on i386: drivers/built-in.o: In function `in_intr': virtio_console.c:(.text+0x2dd31): undefined reference to `hvc_poll' virtio_console.c:(.text+0x2dd41): undefined

Re: [PATCH] virtio: Add module driver macro for virtio drivers.

2013-02-12 Thread Rusty Russell
sjur.brandel...@stericsson.com writes: From: Sjur Brændeland sjur.brandel...@stericsson.com Add helper macro for drivers that don't do anything special in module init/exit. Signed-off-by: Sjur Brændeland sjur.brandel...@stericsson.com Applied! Thanks, Rusty.

Re: [PATCH] virtio_console: Use virtio device index to generate port name

2013-02-11 Thread Rusty Russell
Amit Shah amit.s...@redhat.com writes: On (Thu) 17 Jan 2013 [13:23:17], sjur.brandel...@stericsson.com wrote: From: Sjur Brændeland sjur.brandel...@stericsson.com Use virtio device index for creating unique device port names. Current index allocation in virtio is based on a monotonically

Re: [PATCH vringh 2/2] caif_virtio: Introduce caif over virtio

2013-02-10 Thread Rusty Russell
sjur.brandel...@stericsson.com writes: From: Vikram ARV vikram@stericsson.com Add the the Virtio shared memory driver for STE Modems. caif_virtio is implemented utilizing the virtio framework for data transport and is managed with the remoteproc frameworks. The Virtio queue is used for

Re: [RFC PATCH 0/8] virtio: new API for addition of buffers, scatterlist changes

2013-02-07 Thread Rusty Russell
Paolo Bonzini pbonz...@redhat.com writes: The virtqueue_add_buf function has two limitations: 1) it requires the caller to provide all the buffers in a single call; 2) it does not support chained scatterlists: the buffers must be provided as an array of struct scatterlist. Because of these

[PULL] virtio fix

2013-02-06 Thread Rusty Russell
The following changes since commit 9a9284153d965a57edc7162a8e57c14c97f3a935: Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux (2013-01-20 20:55:49 -0800) are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux.git

Re: [PATCH] virtio_console: Don't access uninitialized data.

2013-02-06 Thread Rusty Russell
Greg KH gre...@linuxfoundation.org writes: On Wed, Feb 06, 2013 at 10:38:36AM +1030, Rusty Russell wrote: Amit Shah amit.s...@redhat.com writes: On (Mon) 04 Feb 2013 [10:09:05], Rusty Russell wrote: Amit Shah amit.s...@redhat.com writes: On (Thu) 17 Jan 2013 [13:21:32], sjur.brandel

Re: [PATCH 8/8] drivers:net:misc: Remove unnecessary alloc/OOM messages

2013-02-06 Thread Rusty Russell
Joe Perches j...@perches.com writes: alloc failures already get standardized OOM messages and a dump_stack. Signed-off-by: Joe Perches j...@perches.com Why not, less code is always good. Acked-by: Rusty Russell ru...@rustcorp.com.au (virtio_net) Cheers, Rusty

Re: [PATCH] virtio_console: Don't access uninitialized data.

2013-02-05 Thread Rusty Russell
Amit Shah amit.s...@redhat.com writes: On (Mon) 04 Feb 2013 [10:09:05], Rusty Russell wrote: Amit Shah amit.s...@redhat.com writes: On (Thu) 17 Jan 2013 [13:21:32], sjur.brandel...@stericsson.com wrote: From: Sjur Brændeland sjur.brandel...@stericsson.com Don't access uninitialized work

Re: [PATCH][trivial] virtio-mmio: fix wrong comment about register offset

2013-02-03 Thread Rusty Russell
Pawel Moll pawel.m...@arm.com writes: On Sat, 2013-01-26 at 08:54 +, Ryota Ozaki wrote: The register offset of InterruptACK is 0x064, not 0x060. Fix it. Signed-off-by: Ryota Ozaki ozaki.ry...@gmail.com CC: Pawel Moll pawel.m...@arm.com CC: Rusty Russell ru...@rustcorp.com.au CC: Jiri

Re: [PATCH 1/6] virtio_host: host-side implementation of virtio rings.

2013-01-22 Thread Rusty Russell
Asias He as...@redhat.com writes: On 01/17/2013 06:29 PM, Rusty Russell wrote: Getting use of virtio rings correct is tricky, and a recent patch saw an implementation of in-kernel rings (as separate from userspace). This patch attempts to abstract the business of dealing with the virtio

Re: [PATCH V6 1/3] virtio-net: fix the set affinity bug when CPU IDs are not consecutive

2013-01-21 Thread Rusty Russell
Wanlong Gao gaowanl...@cn.fujitsu.com writes: As Michael mentioned, set affinity and select queue will not work very well when CPU IDs are not consecutive, this can happen with hot unplug. Fix this bug by traversal the online CPUs, and create a per cpu variable to find the mapping from CPU to

Re: [PATCH 1/6] virtio_host: host-side implementation of virtio rings.

2013-01-21 Thread Rusty Russell
Michael S. Tsirkin m...@redhat.com writes: On Mon, Jan 21, 2013 at 10:22:03PM +1030, Rusty Russell wrote: Rusty Russell ru...@rustcorp.com.au writes: Michael S. Tsirkin m...@redhat.com writes: +iov-iov[iov-i].iov_base = (__force __user void *)addr; +iov-iov

Re: [RFC] virtio_console: Add DRIVER and INTERFACE to uevent.

2013-01-21 Thread Rusty Russell
sjur.brandel...@stericsson.com writes: From: Sjur Brændeland sjur.brandel...@stericsson.com Add information so rproc-serial can be easily recogniced from user space. Add the following information to uevent: DRIVER=virtio_console|virtio_rproc_serial INTERFACE=grand-parent/parent/name

Re: [PATCH] virtio_console: Let unconnected rproc device receive data.

2013-01-21 Thread Rusty Russell
sjur.brandel...@stericsson.com writes: From: Sjur Brændeland sjur.brandel...@stericsson.com Allow rproc serial ports to receive data before the port is connected. Rproc serial ports usually talk to very simple remote devices with no control queue managing open/close events. So we must let

Re: [PATCH 1/6] virtio_host: host-side implementation of virtio rings.

2013-01-21 Thread Rusty Russell
Rusty Russell ru...@rustcorp.com.au writes: Michael S. Tsirkin m...@redhat.com writes: On Mon, Jan 21, 2013 at 10:22:03PM +1030, Rusty Russell wrote: Rusty Russell ru...@rustcorp.com.au writes: Michael S. Tsirkin m...@redhat.com writes: + iov-iov[iov-i].iov_base = (__force

Re: [PATCH 1/6] virtio_host: host-side implementation of virtio rings.

2013-01-21 Thread Rusty Russell
Rusty Russell ru...@rustcorp.com.au writes: I'll create some patches and see if it's too ugly to live... Hmm, with rough userspace testing I managed to get the speed penalty pretty low. Here are the two patches, inline: vringh: handle case where data goes across multiple ranges. QEMU seems

Re: [PATCH 1/6] virtio_host: host-side implementation of virtio rings.

2013-01-20 Thread Rusty Russell
Sjur Brændeland sjur.brandel...@stericsson.com writes: On Thu, Jan 17, 2013 at 12:23 PM, Michael S. Tsirkin m...@redhat.com wrote: in otgher words, we might need to split a single desc to multiple iov entries. Splitting descriptors doesn't work for me. As described earlier, I receive one

Re: [PATCH 1/6] virtio_host: host-side implementation of virtio rings.

2013-01-20 Thread Rusty Russell
Michael S. Tsirkin m...@redhat.com writes: On Thu, Jan 17, 2013 at 08:59:38PM +1030, Rusty Russell wrote: +/* Returns vring-num if empty, -ve on error. */ +static inline int __vringh_get_head(const struct vringh *vrh, +int (*getu16)(u16 *val, const u16 *p), I

Re: [PATCH v3] virtio-spec: set mac address by a new vq command

2013-01-20 Thread Rusty Russell
ak...@redhat.com writes: From: Amos Kong ak...@redhat.com Virtio-net driver currently programs MAC address byte by byte, this means that we have an intermediate step where mac is wrong. This patch introduced a new control command to set MAC address in one time, and added a new feature flag

Re: [RFCv2 00/12] Introduce host-side virtio queue and CAIF Virtio.

2013-01-18 Thread Rusty Russell
Rusty Russell ru...@rustcorp.com.au writes: Michael S. Tsirkin m...@redhat.com writes: On Wed, Jan 16, 2013 at 01:43:32PM +1030, Rusty Russell wrote: Michael S. Tsirkin m...@redhat.com writes: +static int resize_iovec(struct vringh_iov *iov, gfp_t gfp) +{ +struct iovec *new

[PATCH 2/6] tools/virtio: fix compile.

2013-01-17 Thread Rusty Russell
Didn't test that it actually works, mind you! Signed-off-by: Rusty Russell ru...@rustcorp.com.au --- tools/virtio/linux/virtio.h |9 - tools/virtio/virtio_test.c |6 +++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/tools/virtio/linux/virtio.h b/tools/virtio

[PATCH 5/6] vringh: separate callback for notification.

2013-01-17 Thread Rusty Russell
=3.456 S=3.456 Using CPUS 0 and 3 Guest: notified 156578, pinged 156251 Host: notified 156251, pinged 78289 R=4.248 U=3.436 S=3.436 Using CPUS 0 and 3 Guest: notified 156594, pinged 156251 Host: notified 156251, pinged 78297 R=4.329 U=3.416 S=3.416 Signed-off-by: Rusty Russell ru...@rustcorp.com.au

[PATCH 3/6] tools/virtio: separate headers more.

2013-01-17 Thread Rusty Russell
This makes them a bit more like the kernel headers, so we can include more real kernel headers in our tests. Signed-off-by: Rusty Russell ru...@rustcorp.com.au --- tools/virtio/asm/barrier.h | 14 +++ tools/virtio/linux/bug.h|8 ++ tools/virtio/linux/err.h

[PATCH 1/6] virtio_host: host-side implementation of virtio rings.

2013-01-17 Thread Rusty Russell
, which gcc inlines correctly. Signed-off-by: Rusty Russell ru...@rustcorp.com.au --- drivers/Makefile |2 +- drivers/vhost/Kconfig|8 + drivers/vhost/Kconfig.tcm|1 + drivers/vhost/Makefile |2 + drivers/vhost/vringh.c | 818

[PATCH 4/6] tools/virtio: add vring_test.

2013-01-17 Thread Rusty Russell
, pinged 3172148 Time: R=17.659 U=6.640 S=6.640 ./vringh_test --eventidx --parallel: Using CPUS 0 and 3 Guest: notified 156357, pinged 156251 Host: notified 156251, pinged 78179 Time: R=4.518 U=3.536 S=3.536 Signed-off-by: Rusty Russell ru...@rustcorp.com.au

[PATCH 6/6] tools/virtio: adapt for API changes.

2013-01-17 Thread Rusty Russell
Signed-off-by: Rusty Russell ru...@rustcorp.com.au --- tools/virtio/vringh_test.c | 23 +-- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/tools/virtio/vringh_test.c b/tools/virtio/vringh_test.c index f3868f4..df09a3f 100644 --- a/tools/virtio/vringh_test.c

Re: [QEMU PATCH v2] virtio-net: introduce a new macaddr control

2013-01-16 Thread Rusty Russell
ak...@redhat.com writes: @@ -349,6 +351,14 @@ static int virtio_net_handle_mac(VirtIONet *n, uint8_t cmd, { struct virtio_net_ctrl_mac mac_data; +if (cmd == VIRTIO_NET_CTRL_MAC_ADDR_SET elem-out_num == 2 +elem-out_sg[1].iov_len == ETH_ALEN) { +/* Set MAC

Re: [RFCv2 00/12] Introduce host-side virtio queue and CAIF Virtio.

2013-01-16 Thread Rusty Russell
Michael S. Tsirkin m...@redhat.com writes: On Wed, Jan 16, 2013 at 01:43:32PM +1030, Rusty Russell wrote: Michael S. Tsirkin m...@redhat.com writes: +static int resize_iovec(struct vringh_iov *iov, gfp_t gfp) +{ + struct iovec *new; + unsigned int new_num = iov-max * 2; We must limit

Re: [RFCv2 00/12] Introduce host-side virtio queue and CAIF Virtio.

2013-01-15 Thread Rusty Russell
Michael S. Tsirkin m...@redhat.com writes: +static int resize_iovec(struct vringh_iov *iov, gfp_t gfp) +{ +struct iovec *new; +unsigned int new_num = iov-max * 2; We must limit this I think, this is coming from userspace. How about UIO_MAXIOV? We limit it to the ring size already;

Re: [PATCH 2/2] virtio-scsi: reset virtqueue affinity when doing cpu hotplug

2013-01-15 Thread Rusty Russell
Wanlong Gao gaowanl...@cn.fujitsu.com writes: Add hot cpu notifier to reset the request virtqueue affinity when doing cpu hotplug. You need to be careful to get_online_cpus() and put_online_cpus() here, so CPUs can't go up and down in the middle of operations. In particular,

Re: [RFCv2 00/12] Introduce host-side virtio queue and CAIF Virtio.

2013-01-11 Thread Rusty Russell
Sjur Brændeland sjurb...@gmail.com writes: How do you see the in-kernel API for this? I would like to see something similar to my previous patches, where we extend the virtqueue API. E.g. something like this: struct virtqueue *vring_new_virtqueueh(unsigned int index,

Re: [RFCv2 00/12] Introduce host-side virtio queue and CAIF Virtio.

2013-01-11 Thread Rusty Russell
Michael S. Tsirkin m...@redhat.com writes: On Fri, Jan 11, 2013 at 09:18:33AM +1030, Rusty Russell wrote: Michael S. Tsirkin m...@redhat.com writes: On Thu, Jan 10, 2013 at 09:00:55PM +1030, Rusty Russell wrote: Not sure why vhost/net doesn't built a packet and feed it in netif_rx_ni

Re: [RFCv2 00/12] Introduce host-side virtio queue and CAIF Virtio.

2013-01-10 Thread Rusty Russell
Rusty Russell ru...@rustcorp.com.au writes: It basically involves moving much of vring.c into a virtio_host.c: the parts which actually touch the ring. Then it provides accessors for vring.c to use which are __user-safe (all casts are inside virtio_host.c). I should have something to post

Re: [RFCv2 00/12] Introduce host-side virtio queue and CAIF Virtio.

2013-01-10 Thread Rusty Russell
Michael S. Tsirkin m...@redhat.com writes: On Thu, Jan 10, 2013 at 09:00:55PM +1030, Rusty Russell wrote: Not sure why vhost/net doesn't built a packet and feed it in netif_rx_ni(). This is what tun seems to do, and with this code it should be fairly optimal. Because we want to use NAPI

Re: [RFCv2 00/12] Introduce host-side virtio queue and CAIF Virtio.

2013-01-10 Thread Rusty Russell
Sjur Brændeland sjurb...@gmail.com writes: Hi Rusty, On Thu, Jan 10, 2013 at 11:30 AM, Rusty Russell ru...@rustcorp.com.au wrote: ... I now have some lightly-tested code (via a userspace harness). Great - thank you for looking into this. I will start integrating this with my patches when

Re: [RFC PATCH 2/2] virtio-net: introduce a new control to set macaddr

2013-01-10 Thread Rusty Russell
Michael S. Tsirkin m...@redhat.com writes: +if (virtio_has_feature(vdev, VIRTIO_NET_F_MAC)) { +/* Set MAC address by writing config space */ vdev-config-set(vdev, offsetof(struct virtio_net_config, mac), dev-dev_addr, dev-addr_len);

Re: [RFC PATCH 0/2] make mac programming for virtio net more robust

2013-01-10 Thread Rusty Russell
Michael S. Tsirkin m...@redhat.com writes: On Thu, Jan 10, 2013 at 10:45:39PM +0800, ak...@redhat.com wrote: From: Amos Kong ak...@redhat.com Currenly mac is programmed byte by byte. This means that we have an intermediate step where mac is wrong. Second patch introduced a new vq

Re: [RFCv2 00/12] Introduce host-side virtio queue and CAIF Virtio.

2013-01-10 Thread Rusty Russell
with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * Written by: Rusty Russell ru...@rustcorp.com.au + */ +#ifndef _LINUX_VIRTIO_HOST_H +#define _LINUX_VIRTIO_HOST_H +#include uapi/linux/virtio_ring.h +#include

Re: [PATCH] virtio-spec: fix two typos

2013-01-09 Thread Rusty Russell
Stefan Hajnoczi stefa...@gmail.com writes: On Wed, Jan 09, 2013 at 03:55:23PM +0800, ak...@redhat.com wrote: From: Amos Kong ak...@redhat.com VIRTIO_NET_F_VTRL_VQ - VIRTIO_NET_F_CTRL_VQ VIRTIO_NET_CTRL_MQ is defined to 4 in kernel code Signed-off-by: Amos Kong ak...@redhat.com ---

Re: [PATCH V3 1/2] virtio-net: fix the set affinity bug when CPU IDs are not consecutive

2013-01-08 Thread Rusty Russell
Wanlong Gao gaowanl...@cn.fujitsu.com writes: */ static u16 virtnet_select_queue(struct net_device *dev, struct sk_buff *skb) { - int txq = skb_rx_queue_recorded(skb) ? skb_get_rx_queue(skb) : - smp_processor_id(); + int txq = 0; + + if

Re: [RFCv2 00/12] Introduce host-side virtio queue and CAIF Virtio.

2013-01-08 Thread Rusty Russell
Sjur Brændeland sjurb...@gmail.com writes: On Fri, Dec 21, 2012 at 7:11 AM, Rusty Russell ru...@rustcorp.com.au wrote: Michael S. Tsirkin m...@redhat.com writes: On Wed, Dec 05, 2012 at 03:36:58PM +0100, Sjur Brændeland wrote: Feedback on this patch-set is appreciated, particularly

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

2013-01-07 Thread Rusty Russell
Paolo Bonzini pbonz...@redhat.com writes: Il 07/01/2013 01:02, Rusty Russell ha scritto: Paolo Bonzini pbonz...@redhat.com writes: Il 02/01/2013 06:03, Rusty Russell ha scritto: Paolo Bonzini pbonz...@redhat.com writes: The virtqueue_add_buf function has two limitations: 1) it requires

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

2013-01-06 Thread Rusty Russell
Wanlong Gao gaowanl...@cn.fujitsu.com writes: On 01/02/2013 01:03 PM, Rusty Russell wrote: Paolo Bonzini pbonz...@redhat.com writes: The virtqueue_add_buf function has two limitations: 1) it requires the caller to provide all the buffers in a single call; 2) it does not support chained

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

2013-01-06 Thread Rusty Russell
Paolo Bonzini pbonz...@redhat.com writes: Il 02/01/2013 06:03, Rusty Russell ha scritto: Paolo Bonzini pbonz...@redhat.com writes: The virtqueue_add_buf function has two limitations: 1) it requires the caller to provide all the buffers in a single call; 2) it does not support chained

Re: [PATCH] virtio-spec: serial: english tweak

2013-01-02 Thread Rusty Russell
Michael S. Tsirkin m...@redhat.com writes: A number of virtqueues are created seems clearer than the number of virtqueues: it's virtqueues that are created not the number. the appropriate number - there is only one appropriate number. an appropriate number - there is at least one appropriate

Re: [PATCH 2/2] Document VIRTIO_BLK_T_GET_ID

2013-01-01 Thread Rusty Russell
Alexey Zaytsev alexey.zayt...@gmail.com writes: Signed-off-by: Alexey Zaytsev alexey.zayt...@gmail.com Reviewed-by: Stefan Hajnoczi stefa...@redhat.com Thanks, applied. Cheers, Rusty. ___ Virtualization mailing list

Re: [PATCH] virtio-blk: Don't free ida when disk is in use

2013-01-01 Thread Rusty Russell
Alexander Graf ag...@suse.de writes: On 20.12.2012, at 09:46, Asias He as...@redhat.com wrote: On 12/20/2012 12:15 PM, Rusty Russell wrote: Alexander Graf ag...@suse.de writes: When a file system is mounted on a virtio-blk disk, we then remove it and then reattach it, the reattached disk

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

2013-01-01 Thread Rusty Russell
interface is pretty nasty; I think I'd prefer the chained scatterlists, if that's optimal for you. Cheers, Rusty. From: Rusty Russell ru...@rustcorp.com.au Subject: virtio: use chained scatterlists. Rather than handing a scatterlist[] and out and in numbers to virtqueue_add_buf(), hand two

Re: [RFCv2 00/12] Introduce host-side virtio queue and CAIF Virtio.

2012-12-20 Thread Rusty Russell
Michael S. Tsirkin m...@redhat.com writes: On Wed, Dec 05, 2012 at 03:36:58PM +0100, Sjur Brændeland wrote: Feedback on this patch-set is appreciated, particularly on structure and code-reuse between vhost.c and the host-side virtio-queue. I'd also like some suggestions on how to handle the

Re: [Qemu-devel] [PATCH v6 12/12] virtio-blk: add x-data-plane=on|off performance feature

2012-12-19 Thread Rusty Russell
Michael S. Tsirkin m...@redhat.com writes: On Tue, Dec 18, 2012 at 03:57:17PM +0100, Stefan Hajnoczi wrote: @@ -407,6 +409,14 @@ static void virtio_blk_handle_output(VirtIODevice *vdev, VirtQueue *vq) .num_writes = 0, }; +/* Some guests kick before setting

<    1   2   3   4   5   6   7   8   9   10   >