Re: [RFC] virtio: use mandatory barriers for remote processor vdevs

2011-11-30 Thread Rusty Russell
On Thu, 1 Dec 2011 01:13:07 +0200, "Michael S. Tsirkin" wrote: > For x86, stores into memory are ordered. So I think that yes, smp_XXX > can be selected at compile time. > > So let's forget the virtio strangeness for a minute, Hmm, we got away with light barriers because we knew we were not *rea

Re: [PATCH] Add virtio-scsi to the virtio spec

2011-11-30 Thread Rusty Russell
On Wed, 30 Nov 2011 14:50:41 +0100, Paolo Bonzini wrote: > Hi all, > > here is the specification for a virtio-based SCSI host (controller, HBA, > you name it). The virtio SCSI host is the basis of an alternative > storage stack for KVM. This stack would overcome several limitations of > the curr

Re: [PATCHv3 RFC] virtio-pci: flexible configuration layout

2011-11-30 Thread Rusty Russell
On Wed, 30 Nov 2011 15:12:43 +0200, Sasha Levin wrote: > On Wed, 2011-11-30 at 10:10 +1030, Rusty Russell wrote: > > On Mon, 28 Nov 2011 11:15:31 +0200, Sasha Levin > > wrote: > > > On Mon, 2011-11-28 at 11:25 +1030, Rusty Russell wrote: > > > > I'

Re: [PATCH] virtio-mmio: Devices parameter parsing

2011-11-30 Thread Rusty Russell
On Tue, 29 Nov 2011 17:36:30 +, Pawel Moll wrote: > On Mon, 2011-11-28 at 00:31 +0000, Rusty Russell wrote: > > Off the top of my head, this makes me think of the way initcalls are > > ordered. We could put a parameter parsing initcall at the start of each > > initcall

Re: [PATCH] virtio-ring: Use threshold for switching to indirect descriptors

2011-11-30 Thread Rusty Russell
On Wed, 30 Nov 2011 18:11:51 +0200, Sasha Levin wrote: > On Tue, 2011-11-29 at 16:58 +0200, Avi Kivity wrote: > > On 11/29/2011 04:54 PM, Michael S. Tsirkin wrote: > > > > > > > > Which is actually strange, weren't indirect buffers introduced to make > > > > the performance *better*? From what I

Re: [PATCHv3 RFC] virtio-pci: flexible configuration layout

2011-11-29 Thread Rusty Russell
On Mon, 28 Nov 2011 10:41:51 +0200, "Michael S. Tsirkin" wrote: > On Mon, Nov 28, 2011 at 11:25:43AM +1030, Rusty Russell wrote: > > > > But I'm *terrified* of making the spec more complex; > > > > > > All you do is move stuff around. Why d

Re: [PATCHv3 RFC] virtio-pci: flexible configuration layout

2011-11-29 Thread Rusty Russell
On Mon, 28 Nov 2011 11:15:31 +0200, Sasha Levin wrote: > On Mon, 2011-11-28 at 11:25 +1030, Rusty Russell wrote: > > I'd like to see kvmtools remove support for legacy mode altogether, > > but they probably have existing users. > > While we can't simply remove i

Re: [PATCHv3 RFC] virtio-pci: flexible configuration layout

2011-11-27 Thread Rusty Russell
On Thu, 24 Nov 2011 09:11:22 +0200, "Michael S. Tsirkin" wrote: > On Thu, Nov 24, 2011 at 11:06:44AM +1030, Rusty Russell wrote: > > It'll be *clearer* to have two completely separate paths than to fill > > with if() statements. > > Well, look at my patches

Re: [PATCH] virtio-mmio: Devices parameter parsing

2011-11-27 Thread Rusty Russell
On Wed, 23 Nov 2011 18:08:52 +, Pawel Moll wrote: > On Tue, 2011-11-22 at 00:44 +0000, Rusty Russell wrote: > > Or would it be simpler to enhance sscanf() with some weird format option > > for suffixing? I haven't looked for similar cases, but I'd suspect

Re: [PATCHv3 RFC] virtio-pci: flexible configuration layout

2011-11-23 Thread Rusty Russell
On Wed, 23 Nov 2011 10:46:41 +0200, "Michael S. Tsirkin" wrote: > On Wed, Nov 23, 2011 at 01:02:22PM +1030, Rusty Russell wrote: > > On Tue, 22 Nov 2011 20:36:22 +0200, "Michael S. Tsirkin" > > wrote: > > > Here's an updated vesion. > &

Re: [PATCHv3 RFC] virtio-pci: flexible configuration layout

2011-11-23 Thread Rusty Russell
On Wed, 23 Nov 2011 11:38:40 +0200, Sasha Levin wrote: > On Wed, 2011-11-23 at 10:49 +0200, Michael S. Tsirkin wrote: > > On Wed, Nov 23, 2011 at 01:02:22PM +1030, Rusty Russell wrote: > > > +/* Fields in VIRTIO_PCI_CAP_COMMON_CFG: */ > > > +struct virtio_pci_common

Re: [PATCHv3 RFC] virtio-pci: flexible configuration layout

2011-11-22 Thread Rusty Russell
On Tue, 22 Nov 2011 20:36:22 +0200, "Michael S. Tsirkin" wrote: > Here's an updated vesion. > I'm alternating between updating the spec and the driver, > spec update to follow. Don't touch the spec yet, we have a long way to go :( I want the ability for driver to set the ring size, and the devi

Re: [PATCH 5 of 5] virtio: expose added descriptors immediately

2011-11-22 Thread Rusty Russell
On Tue, 22 Nov 2011 08:29:08 +0200, "Michael S. Tsirkin" wrote: > On Tue, Nov 22, 2011 at 11:03:04AM +1030, Rusty Russell wrote: > > - /* If you haven't kicked in this long, you're probably doing something > > -* wrong. */ > > - WARN_ON(vq->nu

Re: [PATCH] virtio-mmio: Devices parameter parsing

2011-11-21 Thread Rusty Russell
On Mon, 21 Nov 2011 17:56:50 +, Pawel Moll wrote: > On Mon, 2011-11-21 at 14:44 +, Pawel Moll wrote: > > I'll post v3 tonight or tomorrow. > > Ok, it won't be v3 then... > > I tried again, using your suggestions - see below (just the crucial bit, > however I have the kernel-parameters.tx

Re: [PATCH] virtio-mmio: Devices parameter parsing

2011-11-21 Thread Rusty Russell
On Mon, 21 Nov 2011 14:44:48 +, Pawel Moll wrote: > On Mon, 2011-11-21 at 03:32 +0000, Rusty Russell wrote: > > 2) Doesn't leak mem on error paths. > > Em, I don't think my code was leaking memory in any error case? (no > offence meant or taken ;-) You're ri

Re: [PATCH v3 2/3] hvc_init(): Enforce one-time initialization.

2011-11-21 Thread Rusty Russell
On Mon, 21 Nov 2011 14:16:38 -0800, Miche Baker-Harvey wrote: > Thanks, Rusty. I'm not using QEMU though, just KVM. I create the device, > wait > for the message from the guest that the device is ready, and then add ports. > > Miche OK, since Amit was the one who implemented multi-port conso

Re: [PATCH 5 of 5] virtio: expose added descriptors immediately

2011-11-21 Thread Rusty Russell
On Mon, 21 Nov 2011 13:57:04 +0200, "Michael S. Tsirkin" wrote: > On Mon, Nov 21, 2011 at 12:18:45PM +1030, Rusty Russell wrote: > > On Wed, 16 Nov 2011 09:18:38 +0200, "Michael S. Tsirkin" > > wrote: > > > My unlocked kick patches will trip thi

Re: [PATCH v3 2/3] hvc_init(): Enforce one-time initialization.

2011-11-20 Thread Rusty Russell
On Thu, 17 Nov 2011 10:57:37 -0800, Miche Baker-Harvey wrote: > Rusty, Michael, Stephen, et al, > > Thanks for your comments on these patches. > > For what I'm trying to do, all three patches are necessary, but maybe > I'm going about it the wrong way. Your input would be appreciated. > I'm in n

Re: [PATCH] virtio-pci: make reset operation safer

2011-11-20 Thread Rusty Russell
On Thu, 17 Nov 2011 17:41:15 +0200, "Michael S. Tsirkin" wrote: > virtio pci device reset actually just does an I/O > write, which in PCI is really posted, that is it > can complete on CPU before the device has received it. Thanks, applied. Because it's a theoretical issue, I've not cc'd stable

Re: [PATCH] virtio-mmio: Devices parameter parsing

2011-11-20 Thread Rusty Russell
On Wed, 16 Nov 2011 18:13:42 +, Pawel Moll wrote: > On Wed, 2011-11-16 at 00:42 +0000, Rusty Russell wrote: > > On Tue, 15 Nov 2011 13:53:05 +, Pawel Moll wrote: > > > +static char *virtio_mmio_cmdline_devices; > > > +module_param_named(devices, virtio_mmi

Re: [PATCH 5 of 5] virtio: expose added descriptors immediately

2011-11-20 Thread Rusty Russell
there in case a driver is never doing a kick, and getting away with it (mostly) because the device is polling. Let's not penalize good drivers to catch bad ones. How about we do this properly, like so: From: Rusty Russell Subject: virtio: add debugging if driver doesn't kick. Under

Re: [RFC 1/5] virtio-pci: flexible configuration layout

2011-11-20 Thread Rusty Russell
On Tue, 15 Nov 2011 01:43:13 +0200, Sasha Levin wrote: > From: "Michael S. Tsirkin" > > Add a flexible mechanism to specify virtio configuration layout, using > pci vendor-specific capability. A separate capability is used for each > of common, device specific and data-path accesses. OK, a cou

Re: [RFC] kvm tools: Implement multiple VQ for virtio-net

2011-11-20 Thread Rusty Russell
On Wed, 16 Nov 2011 09:23:17 +0200, "Michael S. Tsirkin" wrote: > On Wed, Nov 16, 2011 at 10:34:42AM +1030, Rusty Russell wrote: > > On Mon, 14 Nov 2011 15:05:07 +0200, "Michael S. Tsirkin" > > wrote: > > > On Mon, Nov 14, 2011 at 02:25:17PM +0200

Re: [PATCH 5 of 5] virtio: expose added descriptors immediately

2011-11-15 Thread Rusty Russell
On Mon, 14 Nov 2011 08:56:06 +0200, "Michael S. Tsirkin" wrote: > On Sun, Nov 13, 2011 at 11:03:13PM +0200, Michael S. Tsirkin wrote: > > On Thu, Nov 03, 2011 at 06:12:53PM +1030, Rusty Russell wrote: > > > A virtio driver does virtqueue_add_buf() multiple times

Re: [PATCH] virtio-mmio: Devices parameter parsing

2011-11-15 Thread Rusty Russell
On Tue, 15 Nov 2011 13:53:05 +, Pawel Moll wrote: > +static char *virtio_mmio_cmdline_devices; > +module_param_named(devices, virtio_mmio_cmdline_devices, charp, 0); This is the wrong way to do this. Don't put things in a charp and process it later. It's lazy. You should write parsers for

Re: [PATCH] virtio-mmio: Correct the name of the guest features selector

2011-11-15 Thread Rusty Russell
On Tue, 15 Nov 2011 14:25:22 +, Pawel Moll wrote: > On Tue, 2011-11-15 at 14:17 +, Sasha Levin wrote: > > Guest features selector spelling mistake. > > > > diff --git a/include/linux/virtio_mmio.h b/include/linux/virtio_mmio.h > > index 27c7ede..5c7b6f0 100644 > > --- a/include/linux/virti

Re: [PATCHv2 RFC] virtio-spec: flexible configuration layout

2011-11-15 Thread Rusty Russell
On Fri, 11 Nov 2011 09:39:13 +0200, Sasha Levin wrote: > On Fri, Nov 11, 2011 at 6:24 AM, Rusty Russell wrote: > > (2) There's no huge win in keeping the same layout.  Let's make some > >    cleanups.  There are more users ahead of us then behind us (I > >    hope!

Re: [PATCHv2 RFC] virtio-spec: flexible configuration layout

2011-11-15 Thread Rusty Russell
On Sun, 13 Nov 2011 17:14:27 +0200, "Michael S. Tsirkin" wrote: > On Fri, Nov 11, 2011 at 02:54:31PM +1030, Rusty Russell wrote: > > Indeed, I'd like to see two changes to your proposal: > > > > (1) It should be all or nothing. If a driver can find the

Re: [RFC] kvm tools: Implement multiple VQ for virtio-net

2011-11-15 Thread Rusty Russell
On Mon, 14 Nov 2011 15:05:07 +0200, "Michael S. Tsirkin" wrote: > On Mon, Nov 14, 2011 at 02:25:17PM +0200, Pekka Enberg wrote: > > On Mon, Nov 14, 2011 at 4:04 AM, Asias He wrote: > > > Why both the bandwidth and latency performance are dropping so > > > dramatically > > > with multiple VQ? >

Re: [PATCH 5 of 5] virtio: expose added descriptors immediately

2011-11-13 Thread Rusty Russell
On Sun, 13 Nov 2011 23:03:14 +0200, "Michael S. Tsirkin" wrote: > On Thu, Nov 03, 2011 at 06:12:53PM +1030, Rusty Russell wrote: > > A virtio driver does virtqueue_add_buf() multiple times before finally > > calling virtqueue_kick(); previously we only exposed the

[PULL] virtio pci fix

2011-11-13 Thread Rusty Russell
* [new tag] ru...@rustcorp.com.au-v3.2-rc1-1-g72103bd -> ru...@rustcorp.com.au-v3.2-rc1-1-g72103bd The following changes since commit 1ea6b8f48918282bdca0b32a34095504ee65bab5: Linux 3.2-rc1 (2011-11-07 16:16:02 -0800) are available in the git repository at: git://github.com/rustyrus

Re: [PATCH v3 2/3] hvc_init(): Enforce one-time initialization.

2011-11-13 Thread Rusty Russell
On Tue, 08 Nov 2011 13:45:04 -0800, Miche Baker-Harvey wrote: > hvc_init() must only be called once, and no thread should continue with > hvc_alloc() > until after initialization is complete. The original code does not enforce > either > of these requirements. A new mutex limits entry to hvc_i

Re: [PATCHv2 RFC] virtio-spec: flexible configuration layout

2011-11-10 Thread Rusty Russell
On Wed, 09 Nov 2011 22:57:28 +0200, Sasha Levin wrote: > On Wed, 2011-11-09 at 22:52 +0200, Michael S. Tsirkin wrote: > > On Wed, Nov 09, 2011 at 10:24:47PM +0200, Sasha Levin wrote: > > > It'll be a bit harder deprecating it in the future. > > > > Harder than ... what ? > > Harder than allowing

Re: [PATCH v3 1/3] virtio_console: Fix locking of vtermno.

2011-11-10 Thread Rusty Russell
On Tue, 08 Nov 2011 13:44:58 -0800, Miche Baker-Harvey wrote: > Some modifications of vtermno were not done under the spinlock. > > Moved assignment from vtermno and increment of vtermno together, > putting both under the spinlock. Revert vtermno on failure. > > Signed-off-by: Miche Baker-Harve

Re: virtio-pci new configuration proposal

2011-11-08 Thread Rusty Russell
On Tue, 8 Nov 2011 08:32:50 +0200, "Michael S. Tsirkin" wrote: > On Tue, Nov 08, 2011 at 10:23:33AM +1030, Rusty Russell wrote: > > Even so, should we just use the PCI cap list, and have each > > cap entry just contain a BIR & offset? > > > > Thanks, &

Re: [PATCH] virtio-pci: fix use after free

2011-11-08 Thread Rusty Russell
On Tue, 8 Nov 2011 11:16:16 +0530, Amit Shah wrote: > On (Mon) 07 Nov 2011 [18:37:05], Michael S. Tsirkin wrote: > > Commit 31a3ddda166cda86d2b5111e09ba4bda5239fae6 introduced > > a use after free in virtio-pci. The main issue is > > that the release method signals removal of the virtio device, >

Re: virtio-pci new configuration proposal

2011-11-07 Thread Rusty Russell
On Mon, 7 Nov 2011 23:14:14 +0200, "Michael S. Tsirkin" wrote: > On Mon, Nov 07, 2011 at 03:46:23PM +1030, Rusty Russell wrote: > > So far, the only three things make sense to have in a capability list: > > MSI-X, the upper 32 feature bits, and the per-device config. >

Re: [PATCH] virtio-pci: fix use after free

2011-11-07 Thread Rusty Russell
On Mon, 7 Nov 2011 18:37:05 +0200, "Michael S. Tsirkin" wrote: > Commit 31a3ddda166cda86d2b5111e09ba4bda5239fae6 introduced > a use after free in virtio-pci. The main issue is > that the release method signals removal of the virtio device, > while remove signals removal of the pci device. > > For

Re: virtio-pci new configuration proposal

2011-11-06 Thread Rusty Russell
On Sun, 6 Nov 2011 23:38:49 +0200, "Michael S. Tsirkin" wrote: > On Sun, Nov 06, 2011 at 10:24:57PM +0200, Sasha Levin wrote: > > On Sun, 2011-11-06 at 09:30 +0200, Michael S. Tsirkin wrote: > > > On Fri, Nov 04, 2011 at 04:53:05PM +0200, Sasha Levin wrote: > > > > > I guess my assumption is that

Re: [PATCH 3 of 5] virtio: support unlocked queue kick

2011-11-04 Thread Rusty Russell
On Thu, 3 Nov 2011 03:52:11 -0400, Christoph Hellwig wrote: > On Thu, Nov 03, 2011 at 06:12:51PM +1030, Rusty Russell wrote: > > Based on patch by Christoph for virtio_blk speedup: > > Please credit it to Stefan - he also sent a pointer to his original > version in reply to t

Re: virtio-pci new configuration proposal

2011-11-04 Thread Rusty Russell
On Thu, 03 Nov 2011 10:33:23 +0200, Sasha Levin wrote: > On Thu, 2011-11-03 at 12:28 +1030, Rusty Russell wrote: > > 2) I don't think we want to turn the device-specific config into a > >linked list. We haven't needed variable-length config (yet!), and > >

Re: [PATCH] virtio-balloon: Trivial cleanups

2011-11-04 Thread Rusty Russell
On Thu, 3 Nov 2011 13:09:55 +0200, "Michael S. Tsirkin" wrote: > On Thu, Nov 03, 2011 at 10:20:04AM +0200, Sasha Levin wrote: > > Trivial changes to remove forgotten junk, format comments, and correct > > names. > > > > Cc: Rusty Russell > > Cc: &

Re: [PATCH 4 of 5] virtio: avoid modulus operation

2011-11-03 Thread Rusty Russell
On Thu, 3 Nov 2011 09:51:15 +0200, Pekka Enberg wrote: > On Thu, Nov 3, 2011 at 9:42 AM, Rusty Russell wrote: > > Since we know vq->vring.num is a power of 2, modulus is lazy (it's asserted > > in vring_new_virtqueue()). > > > > Signed-off-by: Rusty R

[PATCH 3 of 5] virtio: support unlocked queue kick

2011-11-03 Thread Rusty Russell
ad to recreated it from memory. Pointers to the original or corrections for the commit message are welcome. Signed-off-by: Rusty Russell diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c --- a/drivers/virtio/virtio_ring.c +++ b/drivers/virtio/virtio_ring.c @@ -2

[PATCH 1 of 5] virtio: document functions better

2011-11-03 Thread Rusty Russell
The old documentation is left over from when we used a structure with strategy pointers. Signed-off-by: Rusty Russell --- include/linux/virtio.h | 130 - 1 file changed, 87 insertions(+), 43 deletions(-) diff --git a/include/linux/virtio.h b

[PATCH 2 of 5] virtio: rename virtqueue_add_buf_gfp to virtqueue_add_buf

2011-11-03 Thread Rusty Russell
Remove wrapper functions. This makes the allocation type explicit in all callers; I used GPF_KERNEL where it seemed obvious, left it at GFP_ATOMIC otherwise. Signed-off-by: Rusty Russell diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c --- a/drivers/block/virtio_blk.c +++ b

[PATCH 4 of 5] virtio: avoid modulus operation

2011-11-03 Thread Rusty Russell
Since we know vq->vring.num is a power of 2, modulus is lazy (it's asserted in vring_new_virtqueue()). Signed-off-by: Rusty Russell --- drivers/virtio/virtio_ring.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/arch/x86/lguest/boot.c b/arch/x86/lgues

[PATCH 5 of 5] virtio: expose added descriptors immediately

2011-11-03 Thread Rusty Russell
can't see the buffers until the kick. Signed-off-by: Rusty Russell --- drivers/virtio/virtio_ring.c | 37 ++--- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c --- a/drivers/virtio/vir

[PATCH 1/5] virtio: document functions better.

2011-11-03 Thread Rusty Russell
The old documentation is left over from when we used a structure with strategy pointers. Signed-off-by: Rusty Russell --- include/linux/virtio.h | 130 - 1 file changed, 87 insertions(+), 43 deletions(-) diff --git a/include/linux/virtio.h b

Re: [PATCH RFC 0/2] virtio-pci: polling mode support

2011-11-02 Thread Rusty Russell
On Wed, 2 Nov 2011 21:02:42 +0200, "Michael S. Tsirkin" wrote: > MSIX spec requires that device can be operated with > all vectors masked, by polling. > > So the following patchset (lightly tested) adds this > ability: when driver reads ISR, the device > recalls a pending notification, and return

Re: virtio-pci new configuration proposal

2011-11-02 Thread Rusty Russell
On Wed, 02 Nov 2011 20:49:27 +0200, Sasha Levin wrote: > This is a proposal for a new layout of the virtio-pci config space. > > We will separate the current configuration into two: A virtio-pci common > configuration and a device specific configuration. This allows more > flexibility > with add

Re: [PULL] virtio

2011-11-02 Thread Rusty Russell
On Wed, 02 Nov 2011 06:52:44 +0200, Sasha Levin wrote: > Since the PCI spec allows you to have the MSI-X table and the PBA in > completely different regions pointed by two different BARs, we did so in > kvm tools and have BAR 1 pointing to the MSI-X table, and BAR 2 pointing > to the PBA ( - we *a

Re: [PATCH] VirtioConsole support.

2011-11-02 Thread Rusty Russell
On Fri, 28 Oct 2011 11:19:40 -0700, Stephen Boyd wrote: > Even better would be kmemdup(). OK, this driver is horribly unloved, and ugly. Noone claims to really understand it, but people keep poking it. Ben, Christian, can you figure out what's going on? Is it time for a complete rewrite? Than

Re: Additional virtio-mmio spec changes

2011-11-01 Thread Rusty Russell
On Tue, 01 Nov 2011 13:01:39 +, Pawel Moll wrote: > Hi Rusty, > > Peter (on Cc) got the qemu implementation up and running (thanks!) and > provided some useful feedback regarding the spec. To make the long story > short, this is what came out of the discussion (feel free to correct me > at an

Re: [PULL] virtio

2011-11-01 Thread Rusty Russell
On Tue, 1 Nov 2011 14:42:23 +0200, "Michael S. Tsirkin" wrote: > On Tue, Nov 01, 2011 at 02:33:33PM +0200, Sasha Levin wrote: > > A proper solution would be for example a configuration in the PIO config > > space which points to the MMIO BAR to use instead. > > I think it makes sense to put the c

Re: [PATCH 0/8] virtio: console: Fixes, cleanups, stats for bytes transferred

2011-10-31 Thread Rusty Russell
On Mon, 31 Oct 2011 15:49:40 +0530, Amit Shah wrote: > On (Wed) 14 Sep 2011 [13:06:38], Amit Shah wrote: > > Hello, > > > > These patches are mostly cleanups (patches 1, 4, 5, 6, 7). Patches 2 > > and 3 fix cases which will be exposed when S4 support is enabled. > > > > Patch 8 adds stats for b

Re: [PATCHv4] virtio-blk: use ida to allocate disk index

2011-10-31 Thread Rusty Russell
gt; > Changes from Mark's versions: > > use the new ida_simple_get > > error handling cleanup > > fix user after free > > > > Works fine for me. > > > > Jens, could you merge this for 3.2? > > That is, unless Rusty complains shortly ...

Re: [PATCH] virtio: fix size computation according to the definition of struct vring_used in vring_size

2011-08-30 Thread Rusty Russell
On Mon, 29 Aug 2011 15:55:59 +0800, Wang Sheng-Hui wrote: > Patch regerated to use sizeof(__u16) instead of 16 in vring_init. > Please check it. Applied. Thanks, Rusty. ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://l

Re: [PATCH] virtio: fix size computation according to the definition of struct vring_used in vring_size

2011-08-28 Thread Rusty Russell
On Sat, 27 Aug 2011 17:52:02 +0800, Wang Sheng-Hui wrote: > On 2011年08月27日 17:34, Wang Sheng-Hui wrote: > diff --git a/include/linux/virtio_ring.h b/include/linux/virtio_ring.h > index 4a32cb6..300af76 100644 > --- a/include/linux/virtio_ring.h > +++ b/include/linux/virtio_ring.h > @@ -135,13 +135

Re: [PATCH] virtio.h: correct comment for struct virtio_driver

2011-08-25 Thread Rusty Russell
On Thu, 25 Aug 2011 21:04:05 +0800, Wang Sheng-Hui wrote: > The patch is against 3.0. > > Signed-off-by: Wang Sheng-Hui Thanks, applied! Cheers, Rusty. ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linux-foun

Re: [PATCH] virtio-net: Read MAC only after initializing MSI-X

2011-08-22 Thread Rusty Russell
On Mon, 22 Aug 2011 11:36:13 +0300, "Michael S. Tsirkin" wrote: > Yes. Or maybe 'WHEN' - since if MSI-X is disabled again, it moves back. > Let's update the spec to make it clearer? I left the language as is, but added a footnote at the end of the sentence: If MSI-X is enabled for the device, t

Re: [PULL] lguest fix, virtio documentation

2011-08-21 Thread Rusty Russell
On Mon, 15 Aug 2011 17:48:32 +0300, Sasha Levin wrote: > On Mon, 2011-08-15 at 10:25 +0930, Rusty Russell wrote: > > [ This adds a text copy of the virtio draft spec to the kernel source, > > which should make it easier for people to find and read. The master > > is stil

Re: [PATCH] virtio-net: Read MAC only after initializing MSI-X

2011-08-21 Thread Rusty Russell
> > > This patch moves the MAC probe to after the detection of whether MSI-X is > > enabled. This way the MAC will be read from offset 24 if the device indeed > > supports MSI-X. > > > > Cc: Rusty Russell > > Cc: Michael S. Tsirkin > > Cc: virtualizat

Re: [PATCH 3/3] virtio-net: Use virtio_config_val() for retrieving config

2011-08-14 Thread Rusty Russell
On Sun, 14 Aug 2011 17:52:33 +0300, Sasha Levin wrote: > This patch modifies virtio-net to use virtio_config_val() instead > of a 'if(virtio_has_feature()) vdev->config->get()' construct to retrieve > optional values from the config space. Thanks, all applied. Cheers, Rusty.

[PULL] lguest fix, virtio documentation

2011-08-14 Thread Rusty Russell
Merge branch 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/staging (2011-08-13 18:37:28 -0700) are available in the git repository at: ssh://master.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus.git master Rusty Russell (2): virtio

Re: [PATCH] virtio-net: Read MAC only after initializing MSI-X

2011-08-14 Thread Rusty Russell
On Sun, 14 Aug 2011 16:57:32 +0300, Sasha Levin wrote: > On Sun, 2011-08-14 at 12:23 +0930, Rusty Russell wrote: > > On Sat, 13 Aug 2011 11:51:01 +0300, Sasha Levin > > wrote: > > > The MAC of a virtio-net device is located at the first field of the device > > >

Re: [PATCH] virtio-net: Read MAC only after initializing MSI-X

2011-08-13 Thread Rusty Russell
On Sat, 13 Aug 2011 11:51:01 +0300, Sasha Levin wrote: > The MAC of a virtio-net device is located at the first field of the device > specific header. This header is located at offset 20 if the device doesn't > support MSI-X or offset 24 if it does. Erk. This means, in general, we have to do vir

Re: [RFC] virtio: expose for non-virtualization users too

2011-07-06 Thread Rusty Russell
On Tue, 05 Jul 2011 15:35:46 -0700, "H. Peter Anvin" wrote: > On 07/05/2011 07:06 AM, Ohad Ben-Cohen wrote: > > virtio has been so far used only in the context of virtualization, > > and the virtio Kconfig was sourced directly by the relevant arch > > Kconfigs when VIRTUALIZATION was selected. > >

Re: [PATCH] virtio_balloon: Notify guest only after deflating the balloon

2011-07-04 Thread Rusty Russell
On Sun, 3 Jul 2011 15:11:37 +0300, "Michael S. Tsirkin" wrote: > On Sun, Jul 03, 2011 at 01:52:29PM +0300, Sasha Levin wrote: > > This just leads me to believe that we should either not notify the host, > > or not wait_for_completion() when telling the host. > > Interesting. The spec says > > (a

Re: Make virtio vq size configurable by a guest.

2011-06-22 Thread Rusty Russell
On Wed, 22 Jun 2011 13:21:23 +0300, Gleb Natapov wrote: > On Tue, Jun 21, 2011 at 11:32:04AM +0930, Rusty Russell wrote: > > On Mon, 20 Jun 2011 16:16:24 +0300, Gleb Natapov wrote: > > > Hi, > > > > > > Currently in virtio host dictates the size and layout

Re: [PATCH 00/02][RESEND] virtio: Virtio platform driver

2011-06-21 Thread Rusty Russell
On Tue, 21 Jun 2011 19:26:05 +0900, Magnus Damm wrote: > virtio: Virtio platform driver > > [PATCH 01/02] virtio: Break out lguest virtio code to virtio_lguest.c > [PATCH 02/02] virtio: Add virtio platform driver > > These patches add a virtio platform driver to the Linux kernel. This > platform

Re: Make virtio vq size configurable by a guest.

2011-06-21 Thread Rusty Russell
On Mon, 20 Jun 2011 16:16:24 +0300, Gleb Natapov wrote: > Hi, > > Currently in virtio host dictates the size and layout of vq that should > be used. To talk to a device that has one vq with 128 elements guest > needs to allocate at least 2 pages. Usually this is not a problem, but > sometimes gu

Re: [PATCH 1/1] [virt] virtio-blk: Use ida to allocate disk index

2011-06-15 Thread Rusty Russell
On Wed, 15 Jun 2011 09:06:38 +0200, Tejun Heo wrote: > It's inherited from idr which was designed to have separate > prepare/allocation stages so that allocation can happen inside an > outer spinlock. It doesn't have too much to do with optimization. > It's mostly to be able to use sleepable cont

Re: [PATCH 1/1] [virt] virtio-blk: Use ida to allocate disk index

2011-06-14 Thread Rusty Russell
r id allocation. The current hyper-optimized functions are overkill if you simply want to allocate an id for a device. Create versions which use an internal lock. Signed-off-by: Rusty Russell diff --git a/include/linux/idr.h b/include/linux/idr.h --- a/include/linux/idr.h +++ b/include/linux/i

Re: virtio scsi host draft specification, v3

2011-06-10 Thread Rusty Russell
On Thu, 09 Jun 2011 08:59:27 +0200, Paolo Bonzini wrote: > On 06/09/2011 01:28 AM, Rusty Russell wrote: > >> > after some preliminary discussion on the QEMU mailing list, I present a > >> > draft specification for a virtio-based SCSI host (controller, HBA, you > &

Re: virtio scsi host draft specification, v3

2011-06-08 Thread Rusty Russell
On Tue, 07 Jun 2011 15:43:49 +0200, Paolo Bonzini wrote: > Hi all, > > after some preliminary discussion on the QEMU mailing list, I present a > draft specification for a virtio-based SCSI host (controller, HBA, you > name it). OK, I'm impressed. This is very well written and I doesn't make any

Re: [PATCH 1/1] [virt] virtio-blk: Use ida to allocate disk index

2011-06-08 Thread Rusty Russell
On Wed, 08 Jun 2011 09:08:29 -0400, Mark Wu wrote: > Hi Rusty, > Yes, I can't figure out an instance of disk probing in parallel either, but as > per the following commit, I think we still need use lock for safety. What's > your opinion? > > commit 4034cc68157bfa0b6622efe368488d3d3e20f4e6 > Auth

Re: [PATCHv2 RFC 4/4] Revert "virtio: make add_buf return capacity remaining:

2011-06-07 Thread Rusty Russell
On Tue, 7 Jun 2011 18:54:57 +0300, "Michael S. Tsirkin" wrote: > On Thu, Jun 02, 2011 at 06:43:25PM +0300, Michael S. Tsirkin wrote: > > This reverts commit 3c1b27d5043086a485f8526353ae9fe37bfa1065. > > The only user was virtio_net, and it switched to > > min_capacity instead. > > > > Signed-off-

Re: [PATCHv2 RFC 0/4] virtio and vhost-net capacity handling

2011-06-06 Thread Rusty Russell
On Thu, 2 Jun 2011 20:17:21 +0300, "Michael S. Tsirkin" wrote: > On Thu, Jun 02, 2011 at 06:42:35PM +0300, Michael S. Tsirkin wrote: > > OK, here's a new attempt to use the new capacity api. I also added more > > comments to clarify the logic. Hope this is more readable. Let me know > > pls. >

Re: [PATCH RFC 2/3] virtio_net: fix tx capacity checks using new API

2011-06-01 Thread Rusty Russell
On Wed, 1 Jun 2011 12:49:54 +0300, "Michael S. Tsirkin" wrote: > In the (rare) case where new descriptors are used > while virtio_net enables vq callback for the TX vq, > virtio_net uses the number of sg entries in the skb it frees to > calculate how many descriptors in the ring have just been mad

Re: [PATCH RFC 1/3] virtio_ring: add capacity check API

2011-06-01 Thread Rusty Russell
On Wed, 1 Jun 2011 12:49:46 +0300, "Michael S. Tsirkin" wrote: > Add API to check ring capacity. Because of the option > to use indirect buffers, this returns the worst > case, not the normal case capacity. Can we drop the silly "add_buf() returns capacity" hack then? Thanks, Rusty.

Re: [PATCH RFC 3/3] virtio_net: limit xmit polling

2011-06-01 Thread Rusty Russell
On Wed, 1 Jun 2011 12:50:03 +0300, "Michael S. Tsirkin" wrote: > Current code might introduce a lot of latency variation > if there are many pending bufs at the time we > attempt to transmit a new one. This is bad for > real-time applications and can't be good for TCP either. > > Free up just eno

Re: [PATCH 1/1] [virt] virtio-blk: Use ida to allocate disk index

2011-06-01 Thread Rusty Russell
On Wed, 1 Jun 2011 03:24:29 -0400, Mark Wu wrote: > Current index allocation in virtio-blk is based on a monotonically > increasing variable "index". It could cause some confusion about disk > name in the case of hot-plugging disks. And it's impossible to find the > lowest available index by just

Re: [PATCHv3] virtio-spec: 64 bit features, used/avail event, fixes

2011-06-01 Thread Rusty Russell
On Wed, 1 Jun 2011 13:25:48 +0300, "Michael S. Tsirkin" wrote: > Add an option to modify the notificatin > hand-off in virtio to be basically like Xen: > each side published an index, the other side only triggers > an event when it crosses that index value > (Xen event indexes start at 1, ours sta

Re: [PATCHv2 10/14] virtio_net: limit xmit polling

2011-05-29 Thread Rusty Russell
On Sat, 28 May 2011 23:02:04 +0300, "Michael S. Tsirkin" wrote: > On Thu, May 26, 2011 at 12:58:23PM +0930, Rusty Russell wrote: > > ie. free two packets for every one we're about to add. For steady state > > that would work really well. > > Sure, with ind

Re: [PATCHv2 10/14] virtio_net: limit xmit polling

2011-05-27 Thread Rusty Russell
On Wed, 25 May 2011 09:07:59 +0300, "Michael S. Tsirkin" wrote: > On Wed, May 25, 2011 at 11:05:04AM +0930, Rusty Russell wrote: > Hmm I'm not sure I got it, need to think about this. > I'd like to go back and document how my design was supposed to work. > This r

Re: [PATCHv2 10/14] virtio_net: limit xmit polling

2011-05-24 Thread Rusty Russell
On Mon, 23 May 2011 14:19:00 +0300, "Michael S. Tsirkin" wrote: > I do understand how it seems a waste to leave direct space > in the ring while we might in practice have space > due to indirect. Didn't come up with a nice way to > solve this yet - but 'no worse than now :)' Let's just make it "

Re: 2.6.40 event idx patches

2011-05-24 Thread Rusty Russell
On Tue, 24 May 2011 12:23:45 +0300, "Michael S. Tsirkin" wrote: > Just checking: were you going to send the following to Linus for 2.6.40? > virtio:event_index_interface.patch > virtio:ring_inline_function_to_check_for_events.patch > virtio:ring_support_event_idx_feature.patch > misc:vhost_suppor

Re: [PATCHv2 10/14] virtio_net: limit xmit polling

2011-05-24 Thread Rusty Russell
On Mon, 23 May 2011 14:19:00 +0300, "Michael S. Tsirkin" wrote: > On Mon, May 23, 2011 at 11:37:15AM +0930, Rusty Russell wrote: > > Can we hit problems with OOM? Sure, but no worse than now... > > The problem is that this "virtqueue_get_capacity()" returns

Re: [PATCHv2 10/14] virtio_net: limit xmit polling

2011-05-22 Thread Rusty Russell
On Sun, 22 May 2011 15:10:08 +0300, "Michael S. Tsirkin" wrote: > On Sat, May 21, 2011 at 11:49:59AM +0930, Rusty Russell wrote: > > On Fri, 20 May 2011 02:11:56 +0300, "Michael S. Tsirkin" > > wrote: > > > Current code might introduce a lot of laten

Re: [PATCHv2 11/14] virtio: don't delay avail index update

2011-05-20 Thread Rusty Russell
On Fri, 20 May 2011 02:12:19 +0300, "Michael S. Tsirkin" wrote: > Update avail index immediately instead of upon kick: > for virtio-net RX this helps parallelism with the host. > > Signed-off-by: Michael S. Tsirkin > --- > drivers/virtio/virtio_ring.c | 28 +++- > 1 f

Re: [PATCHv2 10/14] virtio_net: limit xmit polling

2011-05-20 Thread Rusty Russell
On Fri, 20 May 2011 02:11:56 +0300, "Michael S. Tsirkin" wrote: > Current code might introduce a lot of latency variation > if there are many pending bufs at the time we > attempt to transmit a new one. This is bad for > real-time applications and can't be good for TCP either. Do we have more th

Re: [PATCHv2 05/14] virtio_test: support event index

2011-05-20 Thread Rusty Russell
On Fri, 20 May 2011 02:11:05 +0300, "Michael S. Tsirkin" wrote: > Add ability to test the new event idx feature, > enable by default. Applied. Thanks, Rusty. ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linux

Re: [PATCHv2 01/14] virtio: event index interface

2011-05-20 Thread Rusty Russell
On Fri, 20 May 2011 02:10:17 +0300, "Michael S. Tsirkin" wrote: > Define a new feature bit for the guest and host to utilize > an event index (like Xen) instead if a flag bit to enable/disable > interrupts and kicks. Applied. Thanks, Rusty. ___ Virtua

Re: [PATCHv2 02/14] virtio ring: inline function to check for events

2011-05-20 Thread Rusty Russell
On Fri, 20 May 2011 02:10:27 +0300, "Michael S. Tsirkin" wrote: > With the new used_event and avail_event and features, both > host and guest need similar logic to check whether events are > enabled, so it helps to put the common code in the header. > > Note that Xen has similar logic for notifi

Re: [PATCHv2 04/14] vhost: support event index

2011-05-20 Thread Rusty Russell
On Fri, 20 May 2011 02:10:54 +0300, "Michael S. Tsirkin" wrote: > Support the new event index feature. When acked, > utilize it to reduce the # of interrupts sent to the guest. > > Signed-off-by: Michael S. Tsirkin Applied, even though it'd normally be in your tree, it's easier for me to push

Re: [PATCHv2 09/14] virtio_net: fix TX capacity checks using new API

2011-05-20 Thread Rusty Russell
On Fri, 20 May 2011 02:11:47 +0300, "Michael S. Tsirkin" wrote: > virtio net uses the number of sg entries to > check for TX ring capacity freed. But this > gives incorrect results when indirect buffers > are used. Use the new capacity API instead. OK, but this explanation needs enhancement, suc

Re: [PATCHv2 03/14] virtio_ring: support event idx feature

2011-05-20 Thread Rusty Russell
On Fri, 20 May 2011 02:10:44 +0300, "Michael S. Tsirkin" wrote: > Support for the new event idx feature: > 1. When enabling interrupts, publish the current avail index >value to the host to get interrupts on the next update. > 2. Use the new avail_event feature to reduce the number >of ex

Re: [PATCHv2 06/14] virtio: add api for delayed callbacks

2011-05-20 Thread Rusty Russell
On Fri, 20 May 2011 02:11:14 +0300, "Michael S. Tsirkin" wrote: > Add an API that tells the other side that callbacks > should be delayed until a lot of work has been done. > Implement using the new event_idx feature. > > Note: it might seem advantageous to let the drivers > ask for a callback a

Re: [PATCHv2 00/14] virtio and vhost-net performance enhancements

2011-05-20 Thread Rusty Russell
On Fri, 20 May 2011 02:10:07 +0300, "Michael S. Tsirkin" wrote: > OK, here is the large patchset that implements the virtio spec update > that I sent earlier (the spec itself needs a minor update, will send > that out too next week, but I think we are on the same page here > already). It superced

<    4   5   6   7   8   9   10   11   12   13   >