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

2011-11-14 Thread Krishna Kumar2
Sasha Levin wrote on 11/14/2011 03:45:40 PM: > > Why both the bandwidth and latency performance are dropping so > > dramatically with multiple VQ? > > It looks like theres no hash sync between host and guest, which makes > the RX VQ change for every packet. This is my guess. Yes, I confirmed thi

[RFC PATCH net-next v2] enable virtio_net to return bus_info in ethtool -i consistent with emulated NICs

2011-11-14 Thread Rick Jones
From: Rick Jones Add a new .bus_name to virtio_config_ops then modify virtio_net to call through to it in an ethtool .get_drvinfo routine to report bus_info in ethtool -i output which is consistent with other emulated NICs and the output of lspci. Signed-off-by: Rick Jones --- The changes

Re: [RFC PATCH net-next] enable virtio_net to return bus_info in ethtool -i consistent with emulated NICs

2011-11-14 Thread Ben Hutchings
On Mon, 2011-11-14 at 16:06 -0800, Rick Jones wrote: > On 11/14/2011 02:30 PM, Ben Hutchings wrote: > > On Mon, 2011-11-14 at 13:52 -0800, Rick Jones wrote: > >> From: Rick Jones > >> > >> Add a new .bus_name to virtio_config_ops then modify virtio_net to > >> call through to it in an ethtool .get_

Re: [RFC PATCH net-next] enable virtio_net to return bus_info in ethtool -i consistent with emulated NICs

2011-11-14 Thread Ben Hutchings
On Mon, 2011-11-14 at 13:52 -0800, Rick Jones wrote: > From: Rick Jones > > Add a new .bus_name to virtio_config_ops then modify virtio_net to > call through to it in an ethtool .get_drvinfo routine to report > bus_info in ethtool -i output which is consistent with other > emulated NICs and the

[RFC PATCH net-next] enable virtio_net to return bus_info in ethtool -i consistent with emulated NICs

2011-11-14 Thread Rick Jones
From: Rick Jones Add a new .bus_name to virtio_config_ops then modify virtio_net to call through to it in an ethtool .get_drvinfo routine to report bus_info in ethtool -i output which is consistent with other emulated NICs and the output of lspci. Signed-off-by: Rick Jones --- The changes

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

2011-11-14 Thread Pekka Enberg
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? What's the expected benefit from multiple VQs i.e. why are doing the patches Sasha? ___ Virtualization mai

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

2011-11-14 Thread Asias He
Hi, Shsha On 11/13/2011 11:00 PM, Sasha Levin wrote: On Sun, 2011-11-13 at 12:24 +0200, Michael S. Tsirkin wrote: On Sat, Nov 12, 2011 at 12:12:01AM +0200, Sasha Levin wrote: This is a patch based on Krishna Kumar's patch series which implements multiple VQ support for virtio-net. The patch w

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

2011-11-14 Thread Pawel Moll
> > Also, an unrelated questions: With PIO, requests were ordered, which > > means that if we wrote to the queue selector and then read from a > > queue register we would read the correct queue info. > > Is the same thing assured to us with MMIO? > > For real PCI, reads do not bypass writes in PCI

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

2011-11-14 Thread Pekka Enberg
On Wed, 9 Nov 2011, Sasha Levin wrote: They don't exist in kernel code either, for same reason as above. Nothing will break if we remove it since no one really used it, we were probably the first and only implementation of the spec which considered them :) As long as we are able to run older v

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

2011-11-14 Thread Pekka Enberg
On Wed, 9 Nov 2011, Michael S. Tsirkin wrote: KVM tool actually has support for 64bit features, we can probably remove that when Pekka isn't looking :) It's not yet released so maybe it's not an issue yet. If it's too late I can re-add them to legacy too. Pekka, 64 features aren't yet used and

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

2011-11-14 Thread Peter Maydell
On 9 November 2011 11:06, Pawel Moll wrote: > On Wed, 2011-11-09 at 10:55 +, Sasha Levin wrote: >> On Wed, 2011-11-09 at 10:47 +, Pawel Moll wrote: >> > Yep, it's actually already in 3.2-rc1 (drivers/virtio/virtio_mmio.c) and >> > in the spec (see Appendix X). And actually the control regi

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

2011-11-14 Thread Pawel Moll
On Wed, 2011-11-09 at 10:55 +, Sasha Levin wrote: > On Wed, 2011-11-09 at 10:47 +, Pawel Moll wrote: > > Yep, it's actually already in 3.2-rc1 (drivers/virtio/virtio_mmio.c) and > > in the spec (see Appendix X). And actually the control registers layout > > I used was originally based on th

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

2011-11-14 Thread Pawel Moll
On Wed, 2011-11-09 at 10:20 +, Sasha Levin wrote: > > > I'm also wondering it it's ok to move virtio configuration out of virtio > > > space and into PCI space for archs that don't have PCI (such as ARM). Just a note - ARM-based chips can by all means have PCI (grep -r PCI arch/arm/ ;-). The f

[PATCH v3 3/3] Use separate struct console structure for each hvc_console.

2011-11-14 Thread Miche Baker-Harvey
It is possible to make any virtio_console port be a console by sending VIRITO_CONSOLE_CONSOLE_PORT. But hvc_alloc was using a single struct console hvc_console, which contains both an index and flags which are per-port. This adds a separate struct console for each virtio_console that is CONSOLE_P

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

2011-11-14 Thread Miche Baker-Harvey
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_init() to a single thread, and blocks all later comers until it has compl

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

2011-11-14 Thread Miche Baker-Harvey
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-Harvey --- drivers/char/virtio_console.c |9 ++--- 1 files changed, 6

[PATCH RFC v3 0/3] Support multiple VirtioConsoles.

2011-11-14 Thread Miche Baker-Harvey
(Amit pointed out that the patches never went out. This was a resend of the series meant to go out on 11/2/2011; Now it's a resend of the mail this morning, with everyone copied on the same mail. So sorry for the spam! This is v3.) This patchset applies to linux-next/next-2002. This series i

[PATCH v2 3/3] Use separate struct console structure for each hvc_console.

2011-11-14 Thread Miche Baker-Harvey
It is possible to make any virtio_console port be a console by sending VIRITO_CONSOLE_CONSOLE_PORT. But hvc_alloc was using a single struct console hvc_console, which contains both an index and flags which are per-port. This adds a separate struct console for each virtio_console that is CONSOLE_P

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

2011-11-14 Thread Miche Baker-Harvey
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-Harvey --- drivers/char/virtio_console.c |9 ++--- 1 files changed, 6

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

2011-11-14 Thread Miche Baker-Harvey
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_init() to a single thread, and blocks all later comers until it has compl

[PATCH RFC v2 0/3] Support multiple VirtioConsoles.

2011-11-14 Thread Miche Baker-Harvey
(Amit pointed out that the patches never went out. This is a resend of the series meant to go out on 11/2/2011; I've marked it "v2".) This patchset applies to linux-next/next-2002. This series implements support for multiple virtio_consoles using KVM. This patchset addresses several issues

[patch 2/2] xen-gntalloc: signedness bug in add_grefs()

2011-11-14 Thread Dan Carpenter
gref->gref_id is unsigned so the error handling didn't work. gnttab_grant_foreign_access() returns an int type, so we can add a cast here, and it doesn't cause any problems. gnttab_grant_foreign_access() can return a variety of errors including -ENOSPC, -ENOSYS and -ENOMEM. Signed-off-by: Dan Carp

[patch 1/2] xen-gntalloc: integer overflow in gntalloc_ioctl_alloc()

2011-11-14 Thread Dan Carpenter
On 32 bit systems a high value of op.count could lead to an integer overflow in the kzalloc() and gref_ids would be smaller than expected. If the you triggered another integer overflow in "if (gref_size + op.count > limit)" then you'd probably get memory corruption inside add_grefs(). Signed-off-

[patch] xen-gntdev: integer overflow in gntdev_alloc_map()

2011-11-14 Thread Dan Carpenter
The multiplications here can overflow resulting in smaller buffer sizes than expected. "count" comes from a copy_from_user(). Signed-off-by: Dan Carpenter diff --git a/drivers/xen/gntdev.c b/drivers/xen/gntdev.c index 880798a..2f3c363 100644 --- a/drivers/xen/gntdev.c +++ b/drivers/xen/gntdev.c

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

2011-11-14 Thread Pekka Enberg
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 Russell > --- >  drivers/virtio/virtio_ring.c |   10 ++ >  1 file changed, 6 insertions(+), 4 deletions(

[PATCH RFC 0/3] Support multiple VirtioConsoles.

2011-11-14 Thread Miche Baker-Harvey
This patchset applies to linux-next/next-2002. This series implements support for multiple virtio_consoles using KVM. This patchset addresses several issues associated with trying to establish multiple virtio consoles. I'm trying to start a guest via KVM that supports multiple virtual conso

Re: Additional virtio-mmio spec changes

2011-11-14 Thread Peter Maydell
Rusty wrote: >Pawel Moll wrote: >> Peter also mentioned that he didn't like the "Num" in >> "QueueNum" register name and would rather see it called "QueueSize". I >> have no strong opinions either way and can provide patches to both the >> spec and the driver (and header) to change it. Any thought

Additional virtio-mmio spec changes

2011-11-14 Thread Pawel Moll
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 any point, Peter ;-): diff --git a/virtio-spec.lyx b/virtio-spec.lyx

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

2011-11-14 Thread Jens Axboe
On 2011-10-30 20:29, Michael S. Tsirkin wrote: > Based on a patch by Mark Wu > > Current index allocation in virtio-blk is based on a monotonically > increasing variable "index". This means we'll run out of numbers > after a while. It also could cause confusion about the disk > name in the case

Re: [PATCH] VirtioConsole support.

2011-11-14 Thread Stephen Boyd
On 10/27/11 19:55, Joe Perches wrote: > > @@ -845,6 +857,19 @@ struct hvc_struct *hvc_alloc(uint32_t vtermno, int data, > kref_init(&hp->kref); > > INIT_WORK(&hp->tty_resize, hvc_set_winsz); > + /* > + * make each console its own struct console. > + * No need to do alloc

[PATCH] VirtioConsole support.

2011-11-14 Thread Miche Baker-Harvey
Multiple HVC console terminals enabled. Serialize device and port open and initialization. Added a mutex which gates the handling of control messages in virtio_console.c. This includes adding and removing ports, and making opened ports be consoles. Extended the use of the prvdata spinlock to cov

[PATCH] VirtioConsole support.

2011-11-14 Thread Miche Baker-Harvey
Multiple HVC console terminals enabled. Serialize device and port open and initialization. Added a mutex which gates the handling of control messages in virtio_console.c. This includes adding and removing ports, and making opened ports be consoles. Extended the use of the prvdata spinlock to cov

[PATCH v4] virtio: Add platform bus driver for memory mapped virtio device

2011-11-14 Thread Pawel Moll
This patch, based on virtio PCI driver, adds support for memory mapped (platform) virtio device. This should allow environments like qemu to use virtio-based block & network devices even on platforms without PCI support. One can define and register a platform device which resources will describe m

Re: [PATCH v3] virtio: Add platform bus driver for memory mapped virtio device

2011-11-14 Thread Pawel Moll
On Mon, 2011-10-24 at 03:33 +0100, Rusty Russell wrote: > No, that's it I think. Please send a diff for the documentation, since > I'm updating the LyX master and I've already applied your previous > version. Here it goes (below). Also do you think you would be able to merge the driver (correspon

Re: [RFC PATCH net-next] enable virtio_net to return bus_info in ethtool -i consistent with emulated NICs

2011-11-14 Thread Rick Jones
Please use the existing 'not implemented' value, which is the empty string. If you think ethtool should print some helpful message instead of an empty string, please submit a patch for ethtool. One question - will those actually be called via an ethtool path? In my poking about through the v

Re: [RFC PATCH net-next] enable virtio_net to return bus_info in ethtool -i consistent with emulated NICs

2011-11-14 Thread Rick Jones
On 11/14/2011 02:30 PM, Ben Hutchings wrote: On Mon, 2011-11-14 at 13:52 -0800, Rick Jones wrote: From: Rick Jones Add a new .bus_name to virtio_config_ops then modify virtio_net to call through to it in an ethtool .get_drvinfo routine to report bus_info in ethtool -i output which is consistent

[RFC 5/5] kvm tools: Support new virtio-pci configuration layout

2011-11-14 Thread Sasha Levin
Signed-off-by: Sasha Levin --- tools/kvm/include/kvm/pci.h| 13 ++- tools/kvm/include/kvm/virtio-pci.h |4 + tools/kvm/virtio/pci.c | 248 ++-- 3 files changed, 254 insertions(+), 11 deletions(-) diff --git a/tools/kvm/include/kvm/pci.h

[RFC 4/5] kvm tools: Free up the MSI-X PBA BAR

2011-11-14 Thread Sasha Levin
Free up the BAR to make space for the new virtio BARs. It isn't required to have the PBA and the table in the separate BARs, and uniting them will just give us extra BARs to play with. Signed-off-by: Sasha Levin --- tools/kvm/include/kvm/virtio-pci.h |1 - tools/kvm/virtio/pci.c

[RFC 3/5] iomap: Don't ignore offset

2011-11-14 Thread Sasha Levin
Offset was ignored for start calulcations, making all mappings start at offset 0 always. Signed-off-by: Sasha Levin --- lib/iomap.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/lib/iomap.c b/lib/iomap.c index f28720e..93ae915 100644 --- a/lib/iomap.c +++ b/lib/iomap.c

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

2011-11-14 Thread Sasha Levin
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. Warning: compiled only. This patch also needs to be split up, pci_iomap cha

[RFC 2/5] virtio-pci: Fix compilation issue

2011-11-14 Thread Sasha Levin
Signed-off-by: Sasha Levin --- drivers/virtio/virtio_pci.c |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/virtio/virtio_pci.c b/drivers/virtio/virtio_pci.c index 7625434..d242fcc 100644 --- a/drivers/virtio/virtio_pci.c +++ b/drivers/virtio/virtio_pci.c @@ -

[RFC 0/5] virtio-pci, kvm tools: Support new virtio-pci spec in kvm tools

2011-11-14 Thread Sasha Levin
This patch series contains two fixes for the RFC patch send by Michael. These patches are pretty basic and should probably be merged into the next version of that patch. Other two patches add support to the new virtio-pci spec in KVM tools, allowing for easy testing of any future virtio-pci kernel

Re: [RFC PATCH net-next] enable virtio_net to return bus_info in ethtool -i consistent with emulated NICs

2011-11-14 Thread Rick Jones
On 11/14/2011 02:30 PM, Ben Hutchings wrote: On Mon, 2011-11-14 at 13:52 -0800, Rick Jones wrote: From: Rick Jones Add a new .bus_name to virtio_config_ops then modify virtio_net to call through to it in an ethtool .get_drvinfo routine to report bus_info in ethtool -i output which is consistent

[PATCHv2 RFC] virtio-pci: flexible configuration layout

2011-11-14 Thread 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. Warning: compiled only. This patch also needs to be split up, pci_iomap changes also need arch updates f

Re: [PATCH RFC] ndo: ndo_queue_xmit/ndo_flush_xmit (was Re: [RFC] [ver3 PATCH 0/6] Implement multiqueue virtio-net)

2011-11-14 Thread Michael S. Tsirkin
On Sun, Nov 13, 2011 at 07:48:28PM +0200, Michael S. Tsirkin wrote: > @@ -863,6 +872,9 @@ struct net_device_ops { > int (*ndo_stop)(struct net_device *dev); > netdev_tx_t (*ndo_start_xmit) (struct sk_buff *skb, >

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

2011-11-14 Thread Michael S. Tsirkin
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? > > What's the expected benefit from multiple VQs Heh, the original patchset didn

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

2011-11-14 Thread Sasha Levin
On Mon, 2011-11-14 at 10:04 +0800, Asias He wrote: > Hi, Shsha > > On 11/13/2011 11:00 PM, Sasha Levin wrote: > > On Sun, 2011-11-13 at 12:24 +0200, Michael S. Tsirkin wrote: > >> On Sat, Nov 12, 2011 at 12:12:01AM +0200, Sasha Levin wrote: > >>> This is a patch based on Krishna Kumar's patch seri