Re: [patch v2] virtio: console: cleanup an error message

2013-07-30 Thread Rusty Russell
Dan Carpenter dan.carpen...@oracle.com writes: The PTR_ERR(NULL) here is not useful. Signed-off-by: Dan Carpenter dan.carpen...@oracle.com --- v2: completely different Applied. Thanks, Rusty. diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c index

Re: [PATCH v3 5/9] virtio: console: return -ENODEV on all read operations after unplug

2013-07-29 Thread Rusty Russell
Amit Shah amit.s...@redhat.com writes: If a port gets unplugged while a user is blocked on read(), -ENODEV is returned. However, subsequent read()s returned 0, indicating there's no host-side connection (but not indicating the device went away). This also happened when a port was unplugged

Re: [PATCH v3 3/9] virtio: console: clean up port data immediately at time of unplug

2013-07-29 Thread Rusty Russell
Amit Shah amit.s...@redhat.com writes: We used to keep the port's char device structs and the /sys entries around till the last reference to the port was dropped. This is actually unnecessary, and resulted in buggy behaviour: 1. Open port in guest 2. Hot-unplug port 3. Hot-plug a port with

Re: [PATCH v3 4/9] virtio: console: fix raising SIGIO after port unplug

2013-07-29 Thread Rusty Russell
Amit Shah amit.s...@redhat.com writes: SIGIO should be sent when a port gets unplugged. It should only be sent to prcesses that have the port opened, and have asked for SIGIO to be delivered. We were clearing out guest_connected before calling send_sigio_to_port(), resulting in a sigio not

Re: [PATCH v3 1/9] virtio: console: fix race with port unplug and open/close

2013-07-29 Thread Rusty Russell
Amit Shah amit.s...@redhat.com writes: There's a window between find_port_by_devt() returning a port and us taking a kref on the port, where the port could get unplugged. Fix it by taking the reference in find_port_by_devt() itself. Problem reported and analyzed by Mateusz Guzik. This fix

Re: [PATCH v3 8/9] virtio: console: fix locking around send_sigio_to_port()

2013-07-29 Thread Rusty Russell
Amit Shah amit.s...@redhat.com writes: send_sigio_to_port() checks the value of guest_connected, which we always modify under the inbuf_lock; make sure invocations of send_sigio_to_port() have take the inbuf_lock around the call. Signed-off-by: Amit Shah amit.s...@redhat.com Applied, Rusty.

Re: [PATCH v3 6/9] virtio: console: add locks around buffer removal in port unplug path

2013-07-29 Thread Rusty Russell
Amit Shah amit.s...@redhat.com writes: The removal functions act on the vqs, and the vq operations need to be locked. Signed-off-by: Amit Shah amit.s...@redhat.com Applied, Rusty. --- drivers/char/virtio_console.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git

Re: [PATCH v3 7/9] virtio: console: add locking in port unplug path

2013-07-29 Thread Rusty Russell
Amit Shah amit.s...@redhat.com writes: Port unplug can race with close() in port_fops_release(). port_fops_release() already takes the necessary locks, ensure unplug_port() does that too. Signed-off-by: Amit Shah amit.s...@redhat.com Applied, Rusty. --- drivers/char/virtio_console.c | 2

Re: [PATCH v3 9/9] virtio: console: prevent use-after-free of port name in port unplug

2013-07-29 Thread Rusty Russell
Amit Shah amit.s...@redhat.com writes: Remove the debugfs path before freeing port-name, to prevent a possible use-after-free. Reported-by: Jason Wang jasow...@redhat.com Signed-off-by: Amit Shah amit.s...@redhat.com Applied, Rusty. --- drivers/char/virtio_console.c | 3 +-- 1 file

Re: [PATCH v3 2/9] virtio: console: fix race in port_fops_open() and port unplug

2013-07-29 Thread Rusty Russell
Amit Shah amit.s...@redhat.com writes: Between open() being called and processed, the port can be unplugged. Check if this happened, and bail out. A simple test script to reproduce this is: while true; do for i in $(seq 1 100); do echo $i /dev/vport0p3; done; done; This opens and closes

Re: [PATCH 4/5] Intel MIC Card Driver Changes for Virtio Devices.

2013-07-28 Thread Rusty Russell
Sudeep Dutt sudeep.d...@intel.com writes: From: Ashutosh Dixit ashutosh.di...@intel.com This patch introduces the card Virtio over PCIe interface for Intel MIC. It allows virtio drivers on the card to communicate with their user space backends on the host via a device page. Ring 3 apps on the

Re: [PATCH 06/10] virtio: console: fix race in port_fops_poll() and port unplug

2013-07-23 Thread Rusty Russell
Jason Wang jasow...@redhat.com writes: On 07/22/2013 01:45 PM, Rusty Russell wrote: Amit Shah amit.s...@redhat.com writes: On (Fri) 19 Jul 2013 [18:17:32], Jason Wang wrote: On 07/19/2013 03:48 PM, Amit Shah wrote: On (Fri) 19 Jul 2013 [15:03:50], Jason Wang wrote: On 07/19/2013 04:16 AM

Re: [PATCH 06/10] virtio: console: fix race in port_fops_poll() and port unplug

2013-07-22 Thread Rusty Russell
Amit Shah amit.s...@redhat.com writes: On (Fri) 19 Jul 2013 [18:17:32], Jason Wang wrote: On 07/19/2013 03:48 PM, Amit Shah wrote: On (Fri) 19 Jul 2013 [15:03:50], Jason Wang wrote: On 07/19/2013 04:16 AM, Amit Shah wrote: Between poll() being called and processed, the port can be

Re: [PATCH V3 0/2] [BUGFIX] virtio/console: Fix two bugs of splice_write

2013-07-22 Thread Rusty Russell
Amit Shah amit.s...@redhat.com writes: On (Mon) 22 Jul 2013 [13:00:43], Yoshihiro YUNOMAE wrote: Hi, This patch set fixes two bugs of splice_write in the virtio-console driver. [BUG1] Although pipe-nrbufs is empty, the driver tries to do splice_write. = This induces oops in

Re: [PATCH] virtio-net: put virtio net header inline with data

2013-07-17 Thread Rusty Russell
David Miller da...@davemloft.net writes: From: Michael S. Tsirkin m...@redhat.com Date: Wed, 17 Jul 2013 08:00:32 +0300 On Tue, Jul 16, 2013 at 12:33:26PM -0700, David Miller wrote: From: Rusty Russell ru...@rustcorp.com.au Date: Mon, 15 Jul 2013 11:13:25 +0930 From: Michael S. Tsirkin m

Re: [PATCH] virtio-net: put virtio net header inline with data

2013-07-16 Thread Rusty Russell
David Miller da...@davemloft.net writes: From: Rusty Russell ru...@rustcorp.com.au Date: Mon, 15 Jul 2013 11:13:25 +0930 From: Michael S. Tsirkin m...@redhat.com For small packets we can simplify xmit processing by linearizing buffers with the header: most packets seem to have enough head

[PATCH] virtio-net: put virtio net header inline with data

2013-07-14 Thread Rusty Russell
for this. Signed-off-by: Michael S. Tsirkin m...@redhat.com Signed-off-by: Rusty Russell ru...@rustcorp.com.au --- drivers/net/virtio_net.c| 42 + include/uapi/linux/virtio_net.h | 4 +++- 2 files changed, 37 insertions(+), 9 deletions(-) diff

Re: [PATCH] virtio-net: put virtio net header inline with data

2013-07-14 Thread Rusty Russell
Michael S. Tsirkin m...@redhat.com writes: On Tue, Jul 09, 2013 at 05:38:51PM +0930, Rusty Russell wrote: Michael S. Tsirkin m...@redhat.com writes: On Tue, Jul 09, 2013 at 11:46:23AM +0930, Rusty Russell wrote: Michael S. Tsirkin m...@redhat.com writes: For small packets we can simplify

Re: [PATCH] virtio-net: put virtio net header inline with data

2013-07-09 Thread Rusty Russell
Michael S. Tsirkin m...@redhat.com writes: On Tue, Jul 09, 2013 at 11:46:23AM +0930, Rusty Russell wrote: Michael S. Tsirkin m...@redhat.com writes: For small packets we can simplify xmit processing by linearizing buffers with the header: most packets seem to have enough head room we can

Re: [PATCH 1/2] virtio: support unlocked queue poll

2013-07-09 Thread Rusty Russell
of a barrier here. Deferring this optimization until we do some benchmarking. Signed-off-by: Michael S. Tsirkin m...@redhat.com Acked-by: Rusty Russell ru...@rustcorp.com.au Thanks, Rusty. ___ Virtualization mailing list Virtualization@lists.linux

Re: [PATCH] virtio-spec: add field for scsi command size

2013-07-08 Thread Rusty Russell
Paolo Bonzini pbonz...@redhat.com writes: Il 04/07/2013 09:39, Michael S. Tsirkin ha scritto: Transport feature bits are still negotiated per device though. virtio-scsi devices in QEMU would not negotiate that feature. Paolo So I think it needs to be a per-device feature bit. We

Re: [PATCH] virtio-spec: add field for scsi command size

2013-07-08 Thread Rusty Russell
Michael S. Tsirkin m...@redhat.com writes: On Mon, Jul 08, 2013 at 10:51:39AM +0930, Rusty Russell wrote: Michael S. Tsirkin m...@redhat.com writes: On Thu, Jul 04, 2013 at 10:49:42AM +0300, Michael S. Tsirkin wrote: case). Regrettably, initial driver implementations used simple

Re: [PATCH] virtio-net: put virtio net header inline with data

2013-07-08 Thread Rusty Russell
Michael S. Tsirkin m...@redhat.com writes: For small packets we can simplify xmit processing by linearizing buffers with the header: most packets seem to have enough head room we can use for this purpose. Since existing hypervisors require that header is the first s/g element, we need a

Re: [PATCH] virtio: include asm/barrier explicitly

2013-07-07 Thread Rusty Russell
Michael S. Tsirkin m...@redhat.com writes: virtio_ring.h uses mb() and friends, make it pull in asm/barrier.h itself, not rely on other headers to do it. Signed-off-by: Michael S. Tsirkin m...@redhat.com Applied. Thanks, Rusty. PS. I'll squeeze these into this merge window, since they're

Re: [PATCH] virtio-spec: add field for scsi command size

2013-07-07 Thread Rusty Russell
. Here's the kernel patch: virtio: VIRTIO_F_ANY_LAYOUT feature Also known as the no really, I read the spec bit. Signed-off-by: Rusty Russell ru...@rustcorp.com.au diff --git a/include/uapi/linux/virtio_config.h b/include/uapi/linux/virtio_config.h index b7cda39..4b5da48 100644 --- a/include

Re: [PATCH] tools/virtio: move module license stub to module.h

2013-07-07 Thread Rusty Russell
Michael S. Tsirkin m...@redhat.com writes: This fixes build for the vringh test: [linux]$ make -C tools/virtio/ make: Entering directory `/home/mst/scm/linux/tools/virtio' cc -g -O2 -Wall -I. -I ../../usr/include/ -Wno-pointer-sign -fno-strict-overflow -fno-strict-aliasing -fno-common -MMD

Re: [PATCH net] virtio-net: fix the race between channels setting and refill

2013-07-03 Thread Rusty Russell
: Sasha Levin sasha.le...@oracle.com Cc: Rusty Russell ru...@rustcorp.com.au Cc: Michael S. Tsirkin m...@redhat.com Signed-off-by: Jason Wang jasow...@redhat.com Thanks. Applied, Rusty. ___ Virtualization mailing list Virtualization@lists.linux

[PULL] virtio-next

2013-06-30 Thread Rusty Russell
): virtio_pci: better macro exported in uapi Pranavkumar Sawargaonkar (1): virtio: console: Add emergency writeonly register to config space Rusty Russell (1): virtio: remove virtqueue_add_buf(). arch/x86/lguest/Makefile | 2 +- arch/x86/lguest/{i386_head.S = head_32.S

Re: [PATCH] virtio-spec: add field for scsi command size

2013-06-30 Thread Rusty Russell
Paolo Bonzini pbonz...@redhat.com writes: Il 20/06/2013 04:40, Rusty Russell ha scritto: Paolo Bonzini pbonz...@redhat.com writes: Il 19/06/2013 10:24, Michael S. Tsirkin ha scritto: 2) We introduce VIRTIO_NET_F_ANY_LAYOUT and VIRTIO_BLK_F_ANY_LAYOUT specifically for net and block (note

Re: [PATCH] virtio-pci: fix leaks of msix_affinity_masks

2013-06-30 Thread Rusty Russell
: Rusty Russell ru...@rustcorp.com.au Cc: Michael S. Tsirkin m...@redhat.com Cc: Jason Wang jasow...@redhat.com Signed-off-by: Andrew Vagin ava...@openvz.org Signed-off-by: Andrey Vagin ava...@openvz.org --- drivers/virtio/virtio_pci.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions

Re: [PATCH] virtio-spec: add field for scsi command size

2013-06-19 Thread Rusty Russell
Michael S. Tsirkin m...@redhat.com writes: On Wed, Jun 19, 2013 at 02:16:06PM +0930, Rusty Russell wrote: Michael S. Tsirkin m...@redhat.com writes: On Thu, Jun 13, 2013 at 11:10:47AM +0300, Michael S. Tsirkin wrote: On Thu, Jun 13, 2013 at 11:02:59AM +0300, Michael S. Tsirkin wrote

Re: [PATCH] virtio-spec: add field for scsi command size

2013-06-19 Thread Rusty Russell
descriptors. Signed-off-by: Rusty Russell ru...@rustcorp.com.au diff --git a/drivers/virtio/Kconfig b/drivers/virtio/Kconfig index 8d5bddb..99c0187 100644 --- a/drivers/virtio/Kconfig +++ b/drivers/virtio/Kconfig @@ -5,6 +5,22 @@ config VIRTIO bus, such as CONFIG_VIRTIO_PCI

Re: [PATCH 0/2] fix kernel crash with macvtap on top of LRO

2013-06-18 Thread Rusty Russell
Ben Hutchings bhutchi...@solarflare.com writes: On Mon, 2013-06-17 at 11:05 +0930, Rusty Russell wrote: I thought LRO was deprecated and GRO was the new hotness, but I haven't been following. Do we still care about LRO? The old software LRO implementation, inet_lro, is deprecated in favour

Re: [PATCH] virtio-spec: balloon: MUST_TELL_HOST is optional

2013-06-18 Thread Rusty Russell
Michael S. Tsirkin m...@redhat.com writes: On Sun, Sep 09, 2012 at 02:36:50PM +0300, Michael S. Tsirkin wrote: Drivers treat MUST_TELL_HOST as optional: windows drivers do not ack it and expect this means they can tell host *after* deflate. This was not the intent but the documentation was

Re: [PATCH] virtio-spec: add field for scsi command size

2013-06-18 Thread Rusty Russell
Michael S. Tsirkin m...@redhat.com writes: On Thu, Jun 13, 2013 at 11:10:47AM +0300, Michael S. Tsirkin wrote: On Thu, Jun 13, 2013 at 11:02:59AM +0300, Michael S. Tsirkin wrote: On Thu, Jun 13, 2013 at 02:12:22PM +0930, Rusty Russell wrote: Michael S. Tsirkin m...@redhat.com writes

Re: [PATCH 0/2] fix kernel crash with macvtap on top of LRO

2013-06-16 Thread Rusty Russell
Michael S. Tsirkin m...@redhat.com writes: On Wed, Jun 12, 2013 at 03:56:36PM +0100, Ben Hutchings wrote: On Mon, 2013-06-10 at 10:07 +0300, Michael S. Tsirkin wrote: On Thu, Feb 07, 2013 at 01:14:20PM -0500, David Miller wrote: From: Ben Hutchings bhutchi...@solarflare.com Date: Thu, 7

Re: [virtio-spec PATCH 0/5] Receiving Used Buffers example code: cleanups and an extra mb()

2013-06-16 Thread Rusty Russell
Stefan Hajnoczi stefa...@gmail.com writes: On Sat, Jun 8, 2013 at 7:39 PM, Laszlo Ersek ler...@redhat.com wrote: Patches before the last are small cleanups. In the last patch I'm trying to extract / generalize an idea from Stefan Hajnoczi's review of my virtio-net driver for OVMF. How about

Re: [PATCH] virtio-spec: add field for scsi command size

2013-06-13 Thread Rusty Russell
Michael S. Tsirkin m...@redhat.com writes: On Thu, Mar 14, 2013 at 04:15:28PM +0100, Paolo Bonzini wrote: Il 14/03/2013 12:10, Michael S. Tsirkin ha scritto: Add field for guest to specify command size for virtio-blk. Signed-off-by: Michael S. Tsirkin m...@redhat.com OK, but Rusty

Re: [PATCH RFC] virtio-pci: new config layout: using memory BAR

2013-06-04 Thread Rusty Russell
Michael S. Tsirkin m...@redhat.com writes: On Mon, Jun 03, 2013 at 09:56:15AM +0930, Rusty Russell wrote: Michael S. Tsirkin m...@redhat.com writes: On Thu, May 30, 2013 at 08:53:45AM -0500, Anthony Liguori wrote: Rusty Russell ru...@rustcorp.com.au writes: Anthony Liguori aligu

Re: [PATCH RFC] virtio-pci: new config layout: using memory BAR

2013-06-02 Thread Rusty Russell
Michael S. Tsirkin m...@redhat.com writes: On Thu, May 30, 2013 at 01:28:26PM +0930, Rusty Russell wrote: Yet the structure definitions are descriptive, capturing layout, size and endianness in natural a format readable by any C programmer. From an API design point of view, here

Re: [PATCH RFC] virtio-pci: new config layout: using memory BAR

2013-06-02 Thread Rusty Russell
Michael S. Tsirkin m...@redhat.com writes: On Thu, May 30, 2013 at 08:53:45AM -0500, Anthony Liguori wrote: Rusty Russell ru...@rustcorp.com.au writes: Anthony Liguori aligu...@us.ibm.com writes: Forcing a guest driver change is a really big deal and I see no reason to do that unless

Re: updated: kvm networking todo wiki

2013-06-02 Thread Rusty Russell
Anthony Liguori anth...@codemonkey.ws writes: Michael S. Tsirkin m...@redhat.com writes: On Thu, May 30, 2013 at 08:40:47AM -0500, Anthony Liguori wrote: Stefan Hajnoczi stefa...@gmail.com writes: On Thu, May 30, 2013 at 7:23 AM, Rusty Russell ru...@rustcorp.com.au wrote: Anthony

Re: updated: kvm networking todo wiki

2013-05-30 Thread Rusty Russell
Stefan Hajnoczi stefa...@gmail.com writes: On Thu, May 30, 2013 at 7:23 AM, Rusty Russell ru...@rustcorp.com.au wrote: On the receive side, what can we do better than readv? If we need to return to userspace to tell the guest that we've got a new packet, we don't win on latency. We might

Re: [RFC 7/11] virtio_pci: new, capability-aware driver.

2013-05-29 Thread Rusty Russell
Michael S. Tsirkin m...@redhat.com writes: On Wed, May 29, 2013 at 10:47:52AM +0930, Rusty Russell wrote: Michael S. Tsirkin m...@redhat.com writes: On Mon, Dec 12, 2011 at 01:49:13PM +0200, Michael S. Tsirkin wrote: On Mon, Dec 12, 2011 at 09:15:03AM +1030, Rusty Russell wrote: On Sun

Re: updated: kvm networking todo wiki

2013-05-29 Thread Rusty Russell
Anthony Liguori anth...@codemonkey.ws writes: Rusty Russell ru...@rustcorp.com.au writes: On Fri, May 24, 2013 at 08:47:58AM -0500, Anthony Liguori wrote: FWIW, I think what's more interesting is using vhost-net as a networking backend with virtio-net in QEMU being what's guest facing

Re: [PATCH] virtio_pci: fix capability format, comments

2013-05-29 Thread Rusty Russell
the device originally asked for. Signed-off-by: Rusty Russell ru...@rustcorp.com.au diff --git a/drivers/virtio/virtio_pci-common.h b/drivers/virtio/virtio_pci-common.h index ba1bf81..0e3143b 100644 --- a/drivers/virtio/virtio_pci-common.h +++ b/drivers/virtio/virtio_pci-common.h @@ -82,6 +82,9

Re: [PATCH RFC] virtio-pci: new config layout: using memory BAR

2013-05-29 Thread Rusty Russell
Anthony Liguori aligu...@us.ibm.com writes: Rusty Russell ru...@rustcorp.com.au writes: Anthony Liguori aligu...@us.ibm.com writes: Michael S. Tsirkin m...@redhat.com writes: +case offsetof(struct virtio_pci_common_cfg, device_feature_select): +return proxy-device_feature_select

Re: [Qemu-devel] [PATCH v2 00/11] qemu: use virtio linux headers in portable code

2013-05-28 Thread Rusty Russell
Anthony Liguori anth...@codemonkey.ws writes: Rusty Russell ru...@rustcorp.com.au writes: Anthony Liguori anth...@codemonkey.ws writes: Paolo Bonzini pbonz...@redhat.com writes: Il 26/05/2013 22:02, Michael S. Tsirkin ha scritto: My fault. I should have looked at linux/types.h (actually

Re: [PATCH RFC] virtio-pci: new config layout: using memory BAR

2013-05-28 Thread Rusty Russell
Paolo Bonzini pbonz...@redhat.com writes: Il 28/05/2013 19:32, Michael S. Tsirkin ha scritto: + +switch (addr) { +case offsetof(struct virtio_pci_common_cfg, device_feature_select): +return proxy-device_feature_select; Oh dear no... Please use defines like

Re: [PATCH RFC] virtio-pci: new config layout: using memory BAR

2013-05-28 Thread Rusty Russell
Anthony Liguori aligu...@us.ibm.com writes: Michael S. Tsirkin m...@redhat.com writes: +case offsetof(struct virtio_pci_common_cfg, device_feature_select): +return proxy-device_feature_select; Oh dear no... Please use defines like the rest of QEMU. It is pretty ugly. Yet the

Re: updated: kvm networking todo wiki

2013-05-28 Thread Rusty Russell
Michael S. Tsirkin m...@redhat.com writes: On Fri, May 24, 2013 at 08:47:58AM -0500, Anthony Liguori wrote: Michael S. Tsirkin m...@redhat.com writes: On Fri, May 24, 2013 at 05:41:11PM +0800, Jason Wang wrote: On 05/23/2013 04:50 PM, Michael S. Tsirkin wrote: Hey guys, I've updated

Re: [RFC 7/11] virtio_pci: new, capability-aware driver.

2013-05-28 Thread Rusty Russell
Michael S. Tsirkin m...@redhat.com writes: On Mon, Dec 12, 2011 at 01:49:13PM +0200, Michael S. Tsirkin wrote: On Mon, Dec 12, 2011 at 09:15:03AM +1030, Rusty Russell wrote: On Sun, 11 Dec 2011 11:42:56 +0200, Michael S. Tsirkin m...@redhat.com wrote: On Thu, Dec 08, 2011 at 09:09:33PM

Re: [Qemu-devel] [PATCH v2 00/11] qemu: use virtio linux headers in portable code

2013-05-28 Thread Rusty Russell
Anthony Liguori anth...@codemonkey.ws writes: The headers say they are BSD licensed... but they include a GPLv2+ header. Doesn't make a lot of sense, does it? It makes perfect sense: you're overthinking it. It just means that copying the BSD headers outside Linux is encouraged. And it's

Re: [Qemu-devel] [PATCH v2 00/11] qemu: use virtio linux headers in portable code

2013-05-27 Thread Rusty Russell
Anthony Liguori anth...@codemonkey.ws writes: Paolo Bonzini pbonz...@redhat.com writes: Il 26/05/2013 22:02, Michael S. Tsirkin ha scritto: My fault. I should have looked at linux/types.h (actually asm-generic/). Not really, __uX appear in the headers that were posted. Which is a

Re: [PATCH rusty/virtio-pci-new-layout] virtio: new layout minor header fixups

2013-05-27 Thread Rusty Russell
Michael S. Tsirkin m...@redhat.com writes: Fix issues observed with the new layout code, seen when implementing device in qemu: - use of uXX in uapi header - incorrect readonly tag on one field - unconditional warning breaks builds with -Werr Signed-off-by: Michael S.

Re: BUG_ON in virtio-ring.c

2013-05-26 Thread Rusty Russell
Dave Airlie airl...@gmail.com writes: Hi Rusty, current virtio-ring.c has a BUG_ON in virtqueue_add that checks total_sg vg-vring.num, however I'm not sure it really is 100% correct. If I have an indirect ring and I'm adding sgs to it and the host is delayed (say I've got a thread

Re: BUG_ON in virtio-ring.c

2013-05-26 Thread Rusty Russell
Dave Airlie airl...@gmail.com writes: correct. If I have an indirect ring and I'm adding sgs to it and the host is delayed (say I've got a thread consuming things from the vring and its off doing something interesting), I'd really like to get ENOSPC back from virtqueue_add. However if the

Re: [PATCH V2] virtio_net: enable napi for all possible queues during open

2013-05-22 Thread Rusty Russell
changing the number of queues. This patch fixes this by enabling napi for all possible queues during open. Cc: Sasha Levin sasha.le...@oracle.com Signed-off-by: Jason Wang jasow...@redhat.com Acked-by: Rusty Russell ru...@rustcorp.com.au Dave, please send to Linus (fixes master). Cheers

Re: [PATCH] virtio-spec: tweak wording for console control vq

2013-05-21 Thread Rusty Russell
Michael S. Tsirkin m...@redhat.com writes: control vq is only used if feature bit is negotiated - it's not enough that device supports it. Clarify this in the spec. Thanks, applied. Cheers, Rusty. Signed-off-by: Michael S. Tsirkin m...@redhat.com --- virtio-spec.lyx | 9 +++-- 1

Re: [PATCH 1/2 V4] virtio-spec: dynamic network offloads configuration

2013-05-21 Thread Rusty Russell
Michael S. Tsirkin m...@redhat.com writes: On Mon, May 20, 2013 at 03:43:51PM +0200, Paolo Bonzini wrote: Is there a story behind skipping virtio-net feature bits 2..4? Paolo Bits 3-4 now :) I'm curious too. Not a good one :) The year is 2007. virtio_net was the posterchild of free

Re: [PATCH] virtio_pci: fix macro exported in uapi

2013-05-19 Thread Rusty Russell
David Howells dhowe...@redhat.com writes: Rusty Russell ru...@rustcorp.com.au wrote: Macro still isn't usable, because userspace can't know whether it's the new or old. We need to either remove it from UAPI, or rename it to VIRTIO_PCI_CONFIG_OFF. Surely, if userspace is using

Re: [PATCHv2] virtio_pci: better macro exported in uapi

2013-05-19 Thread Rusty Russell
Michael S. Tsirkin m...@redhat.com writes: Macro VIRTIO_PCI_CONFIG assumes that userspace actually has a structure with a field named msix_enabled. Add VIRTIO_PCI_CONFIG_OFF that gets the msix_enabled by value instead, to make it useful for userspace. We still keep VIRTIO_PCI_CONFIG around

Re: [PATCH] virtio_pci: fix macro exported in uapi

2013-05-16 Thread Rusty Russell
Michael S. Tsirkin m...@redhat.com writes: macro VIRTIO_PCI_CONFIG except in the unlikely event userspace actually has a structure with a field named msix_enabled. Get the msix_enabled by value instead, to make it useful for userspace. Signed-off-by: Michael S. Tsirkin m...@redhat.com Macro

Re: [PATCH] vhost-scsi: Depend on NET for memcpy_fromiovec

2013-05-16 Thread Rusty Russell
Joe Perches j...@perches.com writes: On Thu, 2013-05-16 at 13:04 +0930, Rusty Russell wrote: Asias He as...@redhat.com writes: On Wed, May 15, 2013 at 02:47:53PM +0930, Rusty Russell wrote: [] Other users are using memcpy_fromiovec and friends outside net. It seems a good idea to put

Re: [PATCH] virtio_console: fix uapi header

2013-05-16 Thread Rusty Russell
Michael S. Tsirkin m...@redhat.com writes: uapi should use __u32 not u32. Fix a macro in virtio_console.h which uses u32. Signed-off-by: Michael S. Tsirkin m...@redhat.com Ouch. Added CC:stable, and put into fixes. Mainly because it's embarrassing :) Cheers, Rusty.

Re: [PATCH] vhost-scsi: Depend on NET for memcpy_fromiovec

2013-05-15 Thread Rusty Russell
Nicholas A. Bellinger n...@linux-iscsi.org writes: On Wed, 2013-05-15 at 14:47 +0930, Rusty Russell wrote: Asias He as...@redhat.com writes: scsi.c includes vhost.c which uses memcpy_fromiovec. This patch fixes this build failure. From Randy Dunlap: ''' on x86_64

Re: [PATCH] vhost-scsi: Depend on NET for memcpy_fromiovec

2013-05-15 Thread Rusty Russell
Asias He as...@redhat.com writes: On Wed, May 15, 2013 at 02:47:53PM +0930, Rusty Russell wrote: Asias He as...@redhat.com writes: scsi.c includes vhost.c which uses memcpy_fromiovec. This patch fixes this build failure. From Randy Dunlap: ''' on x86_64: ERROR

Re: [PATCH] vhost-scsi: Depend on NET for memcpy_fromiovec

2013-05-14 Thread Rusty Russell
Asias He as...@redhat.com writes: scsi.c includes vhost.c which uses memcpy_fromiovec. This patch fixes this build failure. From Randy Dunlap: ''' on x86_64: ERROR: memcpy_fromiovec [drivers/vhost/vhost_scsi.ko] undefined! It needs to depend on NET since net/core/

Re: [PATCH 0/3] vhost cleanups and separate module

2013-05-12 Thread Rusty Russell
Michael S. Tsirkin m...@redhat.com writes: On Tue, May 07, 2013 at 02:13:44PM +0930, Rusty Russell wrote: AFAICT we should always do zero copy. It seems not to be a win for small packets. I speculate the issue is that ring space isn't released as promptly. Further, we can't do it safely

Re: [PATCH 0/3] vhost cleanups and separate module

2013-05-07 Thread Rusty Russell
Michael S. Tsirkin m...@redhat.com writes: On Mon, May 06, 2013 at 03:41:36PM +0930, Rusty Russell wrote: Asias He as...@redhat.com writes: Asias He (3): vhost: Remove vhost_enable_zcopy in vhost.h vhost: Move VHOST_NET_FEATURES to net.c vhost: Make vhost a separate module I

Re: [PATCH 0/3] vhost cleanups and separate module

2013-05-06 Thread Rusty Russell
Asias He as...@redhat.com writes: Asias He (3): vhost: Remove vhost_enable_zcopy in vhost.h vhost: Move VHOST_NET_FEATURES to net.c vhost: Make vhost a separate module I like these cleanups, MST pleasee apply. I have some other cleanups which are on hold for the moment pending MST's

RE: [PATCH virtio-next] caif_virtio: Remove bouncing email addresses

2013-04-30 Thread Rusty Russell
Dmitry Tarnyagin dmitry.tarnya...@lockless.no writes: Hi Rusty,   I hope it will be sent in plain text, I'm not fully controlling IT environment at the moment :).   Acked-by: Dmity Tarnyagin dmitry.tarnya...@lockless.no   With best regards, Applied. Thanks, Rusty.

Re: suggesting wording fixes for virtio-spec 0.9.5

2013-04-28 Thread Rusty Russell
Laszlo Ersek ler...@redhat.com writes: On 04/23/13 06:05, Rusty Russell wrote: Laszlo Ersek ler...@redhat.com writes: Hi, (I'm not subscribed to either list,) using the word descriptor is misleading in the following sections: Yes, I like the use of 'descriptor chains

Re: [PATCH virtio-next] caif_virtio: Remove bouncing email addresses

2013-04-28 Thread Rusty Russell
Sjur Brændeland sjur.brandel...@stericsson.com writes: Remove our (soon to be) bouncing email addresses, and update Dmitri's address. Dmitry will take over as maintainer for CAIF from now on. Cc: Vikram Arv vikram@stericsson.com Cc: Dmitry Tarnyagin dmitry.tarnya...@stericsson.com Cc:

Re: [PATCHv2 virtio-next] remoteproc: Add support for host virtio rings (vringh)

2013-04-28 Thread Rusty Russell
Ohad Ben-Cohen o...@wizery.com writes: On Tue, Apr 23, 2013 at 6:46 AM, Rusty Russell ru...@rustcorp.com.au wrote: Oh, we can break everything :) I was concentrating purely on the mechanics of the virtqueue, mainly because vhost has special needs wrt tracking changes. vhost doesn't use

Re: suggesting wording fixes for virtio-spec 0.9.5

2013-04-22 Thread Rusty Russell
Laszlo Ersek ler...@redhat.com writes: Hi, (I'm not subscribed to either list,) using the word descriptor is misleading in the following sections: Yes, I like the use of 'descriptor chains'. This is a definite improvement. Here's the diff I ended up with (massaged to minimize it). Thanks!

Re: [PATCH v7 3/3] tcm_vhost: Add hotplug/hotunplug support

2013-04-22 Thread Rusty Russell
Asias He as...@redhat.com writes: On Mon, Apr 22, 2013 at 04:17:04PM +0300, Michael S. Tsirkin wrote: + evt = kzalloc(sizeof(*evt), GFP_KERNEL); I think kzalloc not needed here, you init all fields. Not really! evt-event.lun[4-7] is not initialized. It

Re: [PATCHv2 virtio-next] remoteproc: Add support for host virtio rings (vringh)

2013-04-22 Thread Rusty Russell
Ohad Ben-Cohen o...@wizery.com writes: Hi Sjur and Rusty, Stuff which will be nice to change along these lines: - maintain the vrh_callback_t pointer in struct vringh, similarly to what struct virtqueue does today for callbacks of regular rings - when kicked, just call vring_interrupt, and

Re: [PATCH] virtio-spec: document virtio-9p

2013-04-15 Thread Rusty Russell
Sasha Levin sasha.le...@oracle.com writes: Add basic documentation for virtio-9p. I can expand more on device operation, but I don't think there's anything significant enough for the spec to be mentioned there. Please let me know if I'm wrong. Signed-off-by: Sasha Levin sasha.le...@oracle.com

Re: [PATCH 1/1] virtio: console: replace EMFILE with EBUSY for already-open port

2013-04-14 Thread Rusty Russell
Amit Shah amit.s...@redhat.com writes: Returning EMFILE (process has too many open files) is incorrect to indicate a port is already open by another process. Use EBUSY for that. This does change what we report to userspace, but I believe userspace can look at it this way: it gets EBUSY, a

Re: [PATCH V7 0/5] virtio-scsi multiqueue

2013-04-08 Thread Rusty Russell
Asias He as...@redhat.com writes: On Sat, Apr 06, 2013 at 09:40:13AM +0100, James Bottomley wrote: Well, I haven't had time to look at anything other than the patch I commented on. I'm happy with your fix, so you can add my acked by to that one. Since it's going through the virtio tree,

Re: [PATCH -next] virtio_console: make local symbols static

2013-04-08 Thread Rusty Russell
Amit Shah amit.s...@redhat.com writes: On (Sat) 06 Apr 2013 [11:52:07], Wei Yongjun wrote: From: Wei Yongjun yongjun_...@trendmicro.com.cn Those symbols only used within this file, and should be static. Signed-off-by: Wei Yongjun yongjun_...@trendmicro.com.cn Acked-by: Amit Shah

Re: [PATCH 6/7] virtio: add support for 64 bit features.

2013-04-05 Thread Rusty Russell
Ohad Ben-Cohen o...@wizery.com writes: On Fri, Apr 5, 2013 at 6:37 AM, Rusty Russell ru...@rustcorp.com.au wrote: @@ -220,6 +223,7 @@ static void rproc_virtio_finalize_features(struct virtio_device *vdev) * extension of the virtio resource entries. */ rvdev

[PATCH 0/7] virtio cleanups

2013-04-04 Thread Rusty Russell
Aiming these for coming merge window. Nothing should change, but get ready for a non-guest-endian config transports, and 32 features bits. Final one is just an overdue consolidation. Cheers, Rusty. Rusty Russell (7): virtio_config: introduce size-based accessors. virtio: use size-based

Re: [PATCH 16/22] virtio_pci: use separate notification offsets for each vq.

2013-04-04 Thread Rusty Russell
Michael S. Tsirkin m...@redhat.com writes: By the way, Gleb pointed out that on older hosts MMIO will always be slower since we need to do a shadow page walk to translate virtual to physical address. Hopefully not a big concern, and after all we are still keeping PIO around for use by BIOS

[PATCH 3/7] virtio_config: helpers for non-converting accessors.

2013-04-04 Thread Rusty Russell
Simply redirect everything via the byte-at-a-time accessor. Slow, but simple and this is config reading, which mostly only happens at probe time. Signed-off-by: Rusty Russell ru...@rustcorp.com.au --- drivers/virtio/virtio.c | 69 + include/linux

[PATCH 1/7] virtio_config: introduce size-based accessors.

2013-04-04 Thread Rusty Russell
This lets the transport do endian conversion if necessary, and insulates the drivers from that change. Signed-off-by: Rusty Russell ru...@rustcorp.com.au --- include/linux/virtio_config.h | 161 ++--- 1 file changed, 134 insertions(+), 27 deletions(-) diff

[PATCH 2/7] virtio: use size-based config accessors.

2013-04-04 Thread Rusty Russell
This lets the transport do endian conversion if necessary, and insulates the drivers from the difference. Most drivers can use the simple helpers virtio_cread() and virtio_cwrite(). Signed-off-by: Rusty Russell ru...@rustcorp.com.au --- drivers/block/virtio_blk.c | 77

[PATCH 7/7] virtio: move vring structure into struct virtqueue.

2013-04-04 Thread Rusty Russell
already demonstrated that it's useful to be able to see the ring size, and the new virtio pci layout wants to know the location of each part of the ring. Signed-off-by: Rusty Russell ru...@rustcorp.com.au --- drivers/virtio/virtio_ring.c | 114 +- include

[PATCH 6/7] virtio: add support for 64 bit features.

2013-04-04 Thread Rusty Russell
Change the u32 to a u64, and make sure to use 1ULL everywhere! Cc: Ohad Ben-Cohen o...@wizery.com Cc: Brian Swetland swetl...@google.com Cc: Cornelia Huck cornelia.h...@de.ibm.com Cc: Christian Borntraeger borntrae...@de.ibm.com Signed-off-by: Rusty Russell ru...@rustcorp.com.au Acked-by: Pawel

[PATCH 5/7] virtio: use u32, not bitmap for struct virtio_device's features

2013-04-04 Thread Rusty Russell
Signed-off-by: Rusty Russell ru...@rustcorp.com.au Acked-by: Pawel Moll pawel.m...@arm.com --- drivers/char/virtio_console.c |2 +- drivers/lguest/lguest_device.c |8 drivers/remoteproc/remoteproc_virtio.c |2 +- drivers/s390/kvm/kvm_virtio.c |2

[PATCH 4/7] virtio_config: make transports implement accessors.

2013-04-04 Thread Rusty Russell
pawel.m...@arm.com Cc: Christian Borntraeger borntrae...@de.ibm.com Signed-off-by: Rusty Russell ru...@rustcorp.com.au --- drivers/lguest/lguest_device.c | 20 ++-- drivers/net/caif/caif_virtio.c |2 +- drivers/s390/kvm/kvm_virtio.c | 24 +++--- drivers/s390/kvm/virtio_ccw.c

Re: [PATCH 1/2 V3] virtio-spec: dynamic network offloads configuration

2013-04-03 Thread Rusty Russell
Dmitry Fleytman dmi...@daynix.com writes: From: Dmitry Fleytman dfley...@redhat.com Virtio-net driver currently negotiates network offloads on startup via features mechanism and have no ability to change offloads state later. This patch introduced a new control command that allows to

Re: [PATCH 16/22] virtio_pci: use separate notification offsets for each vq.

2013-04-03 Thread Rusty Russell
H. Peter Anvin h...@zytor.com writes: On 03/29/2013 08:19 PM, Rusty Russell wrote: Shift count? You can only have 2^16 vqs per device. Is it verboten to write 16-bit values to odd offsets? If so, we've just dropped it to 2^15 before you have to do some decoding to do. Hard to care

Re: [PATCH] MAINTAINERS: add missing entries for virtio

2013-04-02 Thread Rusty Russell
Amos Kong kongjian...@gmail.com writes: Some head files were split or moved to uapi/ without updating MAINTAINERS. Signed-off-by: Amos Kong kongjian...@gmail.com Thanks, applied. Cheers, Rusty. ___ Virtualization mailing list

Re: [PATCH v2 2/2] virtio: console: add locking around c_ovq operations

2013-04-01 Thread Rusty Russell
Amit Shah amit.s...@redhat.com writes: When multiple ovq operations are being performed (lots of open/close operations on virtio_console fds), the __send_control_msg() function can get confused without locking. A simple recipe to cause badness is: * create a QEMU VM with two virtio-serial

Re: [PATCH 16/22] virtio_pci: use separate notification offsets for each vq.

2013-04-01 Thread Rusty Russell
H. Peter Anvin h...@zytor.com writes: On 03/27/2013 04:25 AM, Michael S. Tsirkin wrote: Aha. Yes, good idea. As for how large the offsets are, I am guessing we should either just say offset is vqn * X and data is vqn, or give hypervisors full flexibility with 32 bit offset and arbitrary

Re: [PATCH V2 2/2] tcm_vhost: Use vq-private_data to indicate if the endpoint is setup

2013-04-01 Thread Rusty Russell
Michael S. Tsirkin m...@redhat.com writes: Rusty's currently doing some reorgs of -net let's delay cleanups there to avoid stepping on each other's toys. Let's focus on scsi here. E.g. any chance framing assumptions can be fixed in 3.10? I am waiting for your removal of the dma-compelete

Re: [PATCH 3/8] virtio: do not export u16 and u64 to userspace

2013-04-01 Thread Rusty Russell
Paul Bolle pebo...@tiscali.nl writes: virtio_balloon.h exports u16 and u64 to userspace. Use __u16 and __u64 instead. Signed-off-by: Paul Bolle pebo...@tiscali.nl --- 0) Tested with a kernel build. 1) Both types are used in this header for quite some time now. So is my patch flawed or

Re: [PATCH] drivers: virtio: Use PTR_RET function

2013-03-26 Thread Rusty Russell
Andru Gheorghiu gheorghiuan...@gmail.com writes: PTR_RET does return. It's perfectly equivalent to using IS_ERR and the returning PTR_ERR. The implementation is here [1]. Um, I read the implementation, thanks. The reason for using it is this: if you have a function that does something why

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