[PATCHv4 0/2] virtio: find_vqs/del_vqs fixes

2009-07-26 Thread Michael S. Tsirkin
patches: [PATCHv3] virtio: recover from vector assignment failure [PATCHv2] virtio: fix double free_irq on device removal Michael S. Tsirkin (2): virtio: make del_vq delete vq from list virtio: refactor find_vqs drivers/virtio/virtio_pci.c | 218

Re: [PATCHv4 2/2] virtio: refactor find_vqs

2009-07-28 Thread Michael S. Tsirkin
On Tue, Jul 28, 2009 at 12:44:31PM +0930, Rusty Russell wrote: On Mon, 27 Jul 2009 01:17:09 am Michael S. Tsirkin wrote: This refactors find_vqs, making it more readable and robust, and fixing two regressions from 2.6.30: - double free_irq causing BUG_ON on device removal - probe failure

Re: [PATCHv4 2/2] virtio: refactor find_vqs

2009-07-28 Thread Michael S. Tsirkin
On Tue, Jul 28, 2009 at 08:00:52PM +0530, Amit Shah wrote: On (Tue) Jul 28 2009 [12:44:31], Rusty Russell wrote: On Mon, 27 Jul 2009 01:17:09 am Michael S. Tsirkin wrote: This refactors find_vqs, making it more readable and robust, and fixing two regressions from 2.6.30: - double

[PATCH 0/2] vhost: a kernel-level virtio server

2009-08-10 Thread Michael S. Tsirkin
will be posted to k...@vger shortly. Michael S. Tsirkin (2): export cpu_tlbstate to modules vhost_net: a kernel-level virtio server MAINTAINERS| 10 + arch/x86/kvm/Kconfig |1 + arch/x86/mm/tlb.c |1 + drivers/Makefile |1 + drivers/block/virtio_blk.c

[PATCH 2/2] vhost_net: a kernel-level virtio server

2009-08-10 Thread Michael S. Tsirkin
supported). Features that I plan to look at in the future: - TSO - interrupt mitigation - zero copy Signed-off-by: Michael S. Tsirkin m...@redhat.com --- MAINTAINERS| 10 + arch/x86/kvm/Kconfig |1 + drivers/Makefile |1 + drivers/block/virtio_blk.c

[PATCH 1/2] export cpu_tlbstate to modules

2009-08-10 Thread Michael S. Tsirkin
vhost net module wants to do copy to/from user from a kernel thread, which needs switch_mm (like what fs/aio has). export cpu_tlbstate to make this possible Signed-off-by: Michael S. Tsirkin m...@redhat.com --- arch/x86/mm/tlb.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff

[PATCH 0/3] qemu-kvm: vhost net support

2009-08-10 Thread Michael S. Tsirkin
This adds support for vhost-net virtio kernel backend. This is RFC, but works without issues for me. Still needs to be split up, tested and benchmarked properly, but posting it here in case people want to test drive the kernel bits I posted. Michael S. Tsirkin (3): qemu-kvm: move virtio-pci.o

[PATCH 1/3] qemu: move virtio-pci.o to near pci.o

2009-08-10 Thread Michael S. Tsirkin
virtio-pci depends, and will always depend, on pci.c so it makes sense to keep it in the same makefile, (unlike the rest of virtio files which should eventually be moved out to Makefile.hw). Signed-off-by: Michael S. Tsirkin m...@redhat.com --- Makefile.hw |2 +- Makefile.target |2

[PATCH 2/3] qemu/virtio: move features to an inline function

2009-08-10 Thread Michael S. Tsirkin
devices should have the final say over which virtio features they support. E.g. indirect entries may or may not make sense in the context of virtio-console. Move the common bits from virtio-pci to an inline function and let each device call it. No functional changes. Signed-off-by: Michael S

[PATCH 3/3] qemu-kvm: vhost-net implementation

2009-08-10 Thread Michael S. Tsirkin
without issues for me. It still needs to be split up, tested and benchmarked properly, but posting it here in case people want to test drive the kernel bits I posted. Signed-off-by: Michael S. Tsirkin m...@redhat.com --- Makefile.target |3 +- hw/vhost_net.c | 181

[PATCH] qemu/virtio: move features to an inline function

2009-08-10 Thread Michael S. Tsirkin
devices should have the final say over which virtio features they support. E.g. indirect entries may or may not make sense in the context of virtio-console. Move the common bits from virtio-pci to an inline function and let each device call it. No functional changes. Signed-off-by: Michael S

Re: [Qemu-devel] Re: [PATCH] qemu/virtio: move features to an inline function

2009-08-10 Thread Michael S. Tsirkin
On Mon, Aug 10, 2009 at 02:37:20PM -0500, Anthony Liguori wrote: Michael S. Tsirkin wrote: devices should have the final say over which virtio features they support. E.g. indirect entries may or may not make sense in the context of virtio-console. Move the common bits from virtio-pci

Re: [PATCH 2/2] vhost_net: a kernel-level virtio server

2009-08-10 Thread Michael S. Tsirkin
On Mon, Aug 10, 2009 at 09:51:18PM +0200, Arnd Bergmann wrote: On Monday 10 August 2009, Michael S. Tsirkin wrote: What it is: vhost net is a character device that can be used to reduce the number of system calls involved in virtio networking. Existing virtio net code is used in the guest

Re: [Qemu-devel] Re: [PATCH] qemu/virtio: move features to an inline function

2009-08-10 Thread Michael S. Tsirkin
On Mon, Aug 10, 2009 at 03:33:59PM -0500, Anthony Liguori wrote: Michael S. Tsirkin wrote: Normally, the common features are transport features and the devices should have absolutely no knowledge of transport feature (since they're transport dependent). Good point. But 1. note

Re: [Qemu-devel] Re: [PATCH] qemu/virtio: move features to an inline function

2009-08-11 Thread Michael S. Tsirkin
On Mon, Aug 10, 2009 at 05:35:13PM -0500, Anthony Liguori wrote: Michael S. Tsirkin wrote: On Mon, Aug 10, 2009 at 03:33:59PM -0500, Anthony Liguori wrote: There ought to be a way to layer qdev properties that achieves this goal so that when you create a virtio-pci-block device, you have

Re: [PATCH 1/2] export cpu_tlbstate to modules

2009-08-11 Thread Michael S. Tsirkin
Subject: [PATCH] mm: export use_mm/unuse_mm to modules vhost net module wants to do copy to/from user from a kernel thread, which needs use_mm (like what fs/aio has). Move that into mm/ and export to modules. Signed-off-by: Michael S. Tsirkin m...@redhat.com --- On Mon, Aug 10, 2009 at 03:24

Re: [Qemu-devel] Re: [PATCH] qemu/virtio: move features to an inline function

2009-08-11 Thread Michael S. Tsirkin
On Tue, Aug 11, 2009 at 08:15:23AM -0500, Anthony Liguori wrote: Michael S. Tsirkin wrote: On Mon, Aug 10, 2009 at 05:35:13PM -0500, Anthony Liguori wrote: What I'm saying is that virtio-blk-pci, which is the qdev instantiation of virtio-pci + virtio-blk, should be able to have a set

Re: [Qemu-devel] Re: [PATCH] qemu/virtio: move features to an inline function

2009-08-11 Thread Michael S. Tsirkin
On Tue, Aug 11, 2009 at 11:08:32AM -0500, Anthony Liguori wrote: Michael S. Tsirkin wrote: Let's say we supported virtio-vbus along with virtio-pci. What does virtio_blk_get_features() do to mask out sg_indirect? For all virtio-blk knows, it could be on top of virtio-vbus. So

[PATCHv2 0/2] vhost: a kernel-level virtio server

2009-08-11 Thread Michael S. Tsirkin
fs/aio.c to mm instead of copying. - Reorder code to avoid need for forward declarations - Kill a couple of debugging printks Michael S. Tsirkin (2): mm: export use_mm/unuse_mm to modules vhost_net: a kernel-level virtio server MAINTAINERS | 10 + arch/x86/kvm/Kconfig

[PATCHv2 2/2] vhost_net: a kernel-level virtio server

2009-08-11 Thread Michael S. Tsirkin
are not supported). Features that I plan to look at in the future: - TSO - interrupt mitigation - zero copy Signed-off-by: Michael S. Tsirkin m...@redhat.com v2 --- MAINTAINERS| 10 + arch/x86/kvm/Kconfig |1 + drivers/Makefile |1 + drivers/vhost/Kconfig | 11

[PATCHv2 1/2] mm: export use_mm/unuse_mm to modules

2009-08-11 Thread Michael S. Tsirkin
vhost net module wants to do copy to/from user from a kernel thread, which needs use_mm (like what fs/aio has). Move that into mm/ and export to modules. Signed-off-by: Michael S. Tsirkin m...@redhat.com --- fs/aio.c| 47 +-- include/linux

Re: [PATCHv2 2/2] vhost_net: a kernel-level virtio server

2009-08-12 Thread Michael S. Tsirkin
On Tue, Aug 11, 2009 at 08:06:02PM -0400, Gregory Haskins wrote: Michael S. Tsirkin wrote: What it is: vhost net is a character device that can be used to reduce the number of system calls involved in virtio networking. Existing virtio net code is used in the guest without modification

Re: [PATCHv2 2/2] vhost_net: a kernel-level virtio server

2009-08-12 Thread Michael S. Tsirkin
On Tue, Aug 11, 2009 at 08:06:02PM -0400, Gregory Haskins wrote: diff --git a/include/linux/miscdevice.h b/include/linux/miscdevice.h index 0521177..781a8bb 100644 --- a/include/linux/miscdevice.h +++ b/include/linux/miscdevice.h @@ -30,6 +30,7 @@ #define HPET_MINOR 228

Re: [PATCHv2 0/2] vhost: a kernel-level virtio server

2009-08-12 Thread Michael S. Tsirkin
On Wed, Aug 12, 2009 at 07:56:05AM -0400, Gregory Haskins wrote: Michael S. Tsirkin wrote: On Tue, Aug 11, 2009 at 07:49:37PM -0400, Gregory Haskins wrote: Michael S. Tsirkin wrote: This implements vhost: a kernel-level backend for virtio, The main motivation for this work is to reduce

Re: [PATCHv2 0/2] vhost: a kernel-level virtio server

2009-08-12 Thread Michael S. Tsirkin
On Wed, Aug 12, 2009 at 08:41:31AM -0400, Gregory Haskins wrote: Michael S. Tsirkin wrote: On Wed, Aug 12, 2009 at 07:56:05AM -0400, Gregory Haskins wrote: Michael S. Tsirkin wrote: snip 1. use a dedicated network interface with SRIOV, program mac to match that of guest

Re: [PATCHv2 2/2] vhost_net: a kernel-level virtio server

2009-08-12 Thread Michael S. Tsirkin
On Wed, Aug 12, 2009 at 09:01:35AM -0400, Gregory Haskins wrote: I think I understand what your comment above meant: You don't need to do synchronize_rcu() because you can flush the workqueue instead to ensure that all readers have completed. Yes. But if thats true, to me, the

Re: [PATCHv2 0/2] vhost: a kernel-level virtio server

2009-08-12 Thread Michael S. Tsirkin
On Wed, Aug 12, 2009 at 03:40:44PM +0200, Arnd Bergmann wrote: On Wednesday 12 August 2009, Michael S. Tsirkin wrote: If I understand it correctly, you can at least connect a veth pair to a bridge, right? Something like veth0 - veth1 - vhost - guest 1 eth0 - br0

Re: [PATCHv2 2/2] vhost_net: a kernel-level virtio server

2009-08-12 Thread Michael S. Tsirkin
On Wed, Aug 12, 2009 at 09:41:35AM -0400, Gregory Haskins wrote: Michael S. Tsirkin wrote: On Wed, Aug 12, 2009 at 09:01:35AM -0400, Gregory Haskins wrote: I think I understand what your comment above meant: You don't need to do synchronize_rcu() because you can flush the workqueue instead

Re: [PATCHv2 0/2] vhost: a kernel-level virtio server

2009-08-12 Thread Michael S. Tsirkin
On Wed, Aug 12, 2009 at 09:51:45AM -0400, Gregory Haskins wrote: Arnd Bergmann wrote: On Wednesday 12 August 2009, Michael S. Tsirkin wrote: If I understand it correctly, you can at least connect a veth pair to a bridge, right? Something like veth0 - veth1 - vhost - guest 1

Re: [PATCHv2 2/2] vhost_net: a kernel-level virtio server

2009-08-12 Thread Michael S. Tsirkin
On Wed, Aug 12, 2009 at 07:11:07AM -0700, Paul E. McKenney wrote: On Wed, Aug 12, 2009 at 04:25:40PM +0300, Michael S. Tsirkin wrote: On Wed, Aug 12, 2009 at 09:01:35AM -0400, Gregory Haskins wrote: I think I understand what your comment above meant: You don't need to do synchronize_rcu

Re: [PATCHv2 2/2] vhost_net: a kernel-level virtio server

2009-08-12 Thread Michael S. Tsirkin
On Wed, Aug 12, 2009 at 08:26:39AM -0700, Paul E. McKenney wrote: On Wed, Aug 12, 2009 at 05:15:59PM +0300, Michael S. Tsirkin wrote: On Wed, Aug 12, 2009 at 07:11:07AM -0700, Paul E. McKenney wrote: On Wed, Aug 12, 2009 at 04:25:40PM +0300, Michael S. Tsirkin wrote: On Wed, Aug 12, 2009

Re: [PATCHv2 0/2] vhost: a kernel-level virtio server

2009-08-12 Thread Michael S. Tsirkin
On Wed, Aug 12, 2009 at 12:13:43PM -0400, Gregory Haskins wrote: Michael S. Tsirkin wrote: On Wed, Aug 12, 2009 at 09:51:45AM -0400, Gregory Haskins wrote: Arnd Bergmann wrote: On Wednesday 12 August 2009, Michael S. Tsirkin wrote: If I understand it correctly, you can at least connect

Re: [PATCH 2/2] vhost_net: a kernel-level virtio server

2009-08-12 Thread Michael S. Tsirkin
On Wed, Aug 12, 2009 at 07:03:22PM +0200, Arnd Bergmann wrote: On Monday 10 August 2009, Michael S. Tsirkin wrote: +struct workqueue_struct *vhost_workqueue; [nitpicking] This could be static. Good catch. Thanks! +/* The virtqueue structure describes a queue attached to a device

Re: [PATCH 0/3] qemu-kvm: vhost net support

2009-08-12 Thread Michael S. Tsirkin
On Mon, Aug 10, 2009 at 03:51:12PM -0500, Anthony Liguori wrote: Michael S. Tsirkin wrote: This adds support for vhost-net virtio kernel backend. This is RFC, but works without issues for me. Still needs to be split up, tested and benchmarked properly, but posting it here in case people

Re: [PATCH 2/2] vhost_net: a kernel-level virtio server

2009-08-12 Thread Michael S. Tsirkin
On Wed, Aug 12, 2009 at 10:19:22AM -0700, Ira W. Snyder wrote: On Wed, Aug 12, 2009 at 07:03:22PM +0200, Arnd Bergmann wrote: On Monday 10 August 2009, Michael S. Tsirkin wrote: +struct workqueue_struct *vhost_workqueue; [nitpicking] This could be static. +/* The virtqueue

Re: [PATCH 0/3] qemu-kvm: vhost net support

2009-08-13 Thread Michael S. Tsirkin
On Wed, Aug 12, 2009 at 04:27:44PM -0400, Gregory Haskins wrote: Michael S. Tsirkin wrote: This adds support for vhost-net virtio kernel backend. This is RFC, but works without issues for me. Still needs to be split up, tested and benchmarked properly, but posting it here in case

Re: [PATCH 2/2] vhost_net: a kernel-level virtio server

2009-08-13 Thread Michael S. Tsirkin
On Wed, Aug 12, 2009 at 10:48:21AM -0700, Ira W. Snyder wrote: On Wed, Aug 12, 2009 at 08:31:04PM +0300, Michael S. Tsirkin wrote: On Wed, Aug 12, 2009 at 10:19:22AM -0700, Ira W. Snyder wrote: [ snip out code ] We discussed this before, and I still think this could be directly

Re: [PATCH 2/2] vhost_net: a kernel-level virtio server

2009-08-13 Thread Michael S. Tsirkin
On Wed, Aug 12, 2009 at 07:59:47PM +0200, Arnd Bergmann wrote: The trick is to swap the virtqueues instead. virtio-net is actually mostly symmetric in just the same way that the physical wires on a twisted pair ethernet are symmetric (I like how that analogy fits). You need to really squint

Re: [Qemu-devel] Re: [PATCH] qemu/virtio: move features to an inline function

2009-08-13 Thread Michael S. Tsirkin
On Wed, Aug 12, 2009 at 02:18:20PM -0500, Anthony Liguori wrote: Michael S. Tsirkin wrote: On Why bother switching to userspace for migration? Can't you just have get/set ioctls for the state? I have these. But live migration requires dirty page logging. I do not want

Re: [PATCH 2/2] vhost_net: a kernel-level virtio server

2009-08-13 Thread Michael S. Tsirkin
On Wed, Aug 12, 2009 at 02:27:31PM -0500, Anthony Liguori wrote: Arnd Bergmann wrote: As I pointed out earlier, most code in virtio net is asymmetrical: guest provides buffers, host consumes them. Possibly, one could use virtio rings in a symmetrical way, but support of existing guest virtio

Re: [PATCH 2/2] vhost_net: a kernel-level virtio server

2009-08-13 Thread Michael S. Tsirkin
On Wed, Aug 12, 2009 at 02:22:38PM -0500, Anthony Liguori wrote: Michael S. Tsirkin wrote: We discussed this before, and I still think this could be directly derived from struct virtqueue, in the same way that vring_virtqueue is derived from struct virtqueue. I prefer keeping

[PATCHv2 0/3] qemu-kvm: vhost net support

2009-08-13 Thread Michael S. Tsirkin
of 9dc275d9d660fe1cd64d36102d600885f9fdb88a Michael S. Tsirkin (3): qemu-kvm: move virtio-pci.o to near pci.o virtio: move features to an inline function qemu-kvm: vhost-net implementation Makefile.hw |2 +- Makefile.target |3 +- hw/vhost_net.c | 181

[PATCHv2 1/3] qemu-kvm: move virtio-pci.o to near pci.o

2009-08-13 Thread Michael S. Tsirkin
virtio-pci depends, and will always depend, on pci.c so it makes sense to keep it in the same makefile, (unlike the rest of virtio files which should eventually be moved out to Makefile.hw). Signed-off-by: Michael S. Tsirkin m...@redhat.com --- Makefile.hw |2 +- Makefile.target |2

[PATCHv2 2/3] virtio: move features to an inline function

2009-08-13 Thread Michael S. Tsirkin
devices should have the final say over which virtio features they support. E.g. indirect entries may or may not make sense in the context of virtio-console. Move the common bits from virtio-pci to an inline function and let each device call it. No functional changes. Signed-off-by: Michael S

[PATCHv2 3/3] qemu-kvm: vhost-net implementation

2009-08-13 Thread Michael S. Tsirkin
without issues for me. It still needs to be split up, tested and benchmarked properly, but posting it here in case people want to test drive the kernel bits I posted. Signed-off-by: Michael S. Tsirkin m...@redhat.com --- Makefile.target |3 +- hw/vhost_net.c | 181

Re: [Qemu-devel] Re: [PATCH] qemu/virtio: move features to an inline function

2009-08-13 Thread Michael S. Tsirkin
On Thu, Aug 13, 2009 at 12:28:52PM +0300, Avi Kivity wrote: On 08/13/2009 09:15 AM, Michael S. Tsirkin wrote: I wonder though if mmu notifiers can be used to make it transparent... Maybe they can, but that decision belongs to KVM. Avi, what do you think? I don't see how mmu

Re: [PATCH 0/3] qemu-kvm: vhost net support

2009-08-13 Thread Michael S. Tsirkin
On Thu, Aug 13, 2009 at 07:35:52AM -0400, Gregory Haskins wrote: Michael S. Tsirkin wrote: On Wed, Aug 12, 2009 at 04:27:44PM -0400, Gregory Haskins wrote: Michael S. Tsirkin wrote: This adds support for vhost-net virtio kernel backend. This is RFC, but works without issues for me

Re: [PATCH 2/2] vhost_net: a kernel-level virtio server

2009-08-13 Thread Michael S. Tsirkin
On Thu, Aug 13, 2009 at 03:48:35PM +0200, Arnd Bergmann wrote: On Thursday 13 August 2009, Arnd Bergmann wrote: Unfortunately, this also implies that you could no longer simply use the packet socket interface as you do currently, as I realized only now. This obviously has a significant

Re: [PATCH 2/2] vhost_net: a kernel-level virtio server

2009-08-13 Thread Michael S. Tsirkin
On Thu, Aug 13, 2009 at 03:38:43PM +0200, Arnd Bergmann wrote: On Thursday 13 August 2009, Michael S. Tsirkin wrote: On Wed, Aug 12, 2009 at 07:59:47PM +0200, Arnd Bergmann wrote: The trick is to swap the virtqueues instead. virtio-net is actually mostly symmetric in just the same way

Re: [PATCH 2/2] vhost_net: a kernel-level virtio server

2009-08-13 Thread Michael S. Tsirkin
On Thu, Aug 13, 2009 at 04:58:06PM +0200, Arnd Bergmann wrote: On Thursday 13 August 2009, Michael S. Tsirkin wrote: Right now, the number of copy operations in your code is the same. You are doing the copy a little bit later in skb_copy_datagram_iovec(), which is indeed a very nice hack

[PATCHv3 0/2] vhost: a kernel-level virtio server

2009-08-13 Thread Michael S. Tsirkin
- Compat ioctl support - Make variable static - Copied more idiomatic english from Rusty Changes from v1: - Move use_mm/unuse_mm from fs/aio.c to mm instead of copying. - Reorder code to avoid need for forward declarations - Kill a couple of debugging printks Michael S. Tsirkin (2): mm: export

[PATCHv3 1/2] mm: export use_mm/unuse_mm to modules

2009-08-13 Thread Michael S. Tsirkin
vhost net module wants to do copy to/from user from a kernel thread, which needs use_mm (like what fs/aio has). Move that into mm/ and export to modules. Acked-by: Andrew Morton a...@linux-foundation.org Signed-off-by: Michael S. Tsirkin m...@redhat.com --- fs/aio.c| 47

[PATCHv3 2/2] vhost_net: a kernel-level virtio server

2009-08-13 Thread Michael S. Tsirkin
are not supported). Features that I plan to look at in the future: - TSO - interrupt mitigation - zero copy Signed-off-by: Michael S. Tsirkin m...@redhat.com --- MAINTAINERS| 10 + arch/x86/kvm/Kconfig |1 + drivers/Makefile |1 + drivers/vhost/Kconfig | 11

Re: [PATCHv3 2/2] vhost_net: a kernel-level virtio server

2009-08-16 Thread Michael S. Tsirkin
On Fri, Aug 14, 2009 at 01:40:36PM +0200, Arnd Bergmann wrote: On Thursday 13 August 2009, Michael S. Tsirkin wrote: What it is: vhost net is a character device that can be used to reduce the number of system calls involved in virtio networking. Existing virtio net code is used in the guest

[PATCHv3 0/4] qemu-kvm: vhost net support

2009-08-17 Thread Michael S. Tsirkin
to build on RHEL5.3 Changes since v1: - rebased on top of 9dc275d9d660fe1cd64d36102d600885f9fdb88a Michael S. Tsirkin (4): qemu-kvm: move virtio-pci.o to near pci.o virtio: move features to an inline function qemu-kvm: vhost-net implementation qemu-kvm: add compat eventfd Makefile.hw

[PATCHv3 1/4] qemu-kvm: move virtio-pci.o to near pci.o

2009-08-17 Thread Michael S. Tsirkin
virtio-pci depends, and will always depend, on pci.c so it makes sense to keep it in the same makefile, (unlike the rest of virtio files which should eventually be moved out to Makefile.hw). Signed-off-by: Michael S. Tsirkin m...@redhat.com --- Makefile.hw |2 +- Makefile.target |2

[PATCHv3 3/4] qemu-kvm: vhost-net implementation

2009-08-17 Thread Michael S. Tsirkin
to -net flag 4. run with CAP_NET_ADMIN priviledge (e.g. root) This patch is RFC, but works without issues for me. It still needs to be split up, tested and benchmarked properly, but posting it here in case people want to test drive the kernel bits I posted. Signed-off-by: Michael S. Tsirkin m

[PATCHv3 4/4] qemu-kvm: add compat eventfd

2009-08-17 Thread Michael S. Tsirkin
Support build on rhel 5.3 where we have syscall for eventfd but not userspace wrapper. Signed-off-by: Michael S. Tsirkin m...@redhat.com --- compat/sys/eventfd.h | 13 + configure|1 + 2 files changed, 14 insertions(+), 0 deletions(-) create mode 100644 compat/sys

[PATCHv3 2/4] virtio: move features to an inline function

2009-08-17 Thread Michael S. Tsirkin
devices should have the final say over which virtio features they support. E.g. indirect entries may or may not make sense in the context of virtio-console. Move the common bits from virtio-pci to an inline function and let each device call it. No functional changes. Signed-off-by: Michael S

Re: [PATCHv3 0/4] qemu-kvm: vhost net support

2009-08-18 Thread Michael S. Tsirkin
On Tue, Aug 18, 2009 at 02:54:23PM -0600, Alex Williamson wrote: On Mon, Aug 17, 2009 at 6:37 AM, Michael S. Tsirkinm...@redhat.com wrote: This adds support for vhost-net virtio kernel backend. This is RFC, but works without issues for me. I got this to build by syncing up some headers

Re: [PATCHv3 2/2] vhost_net: a kernel-level virtio server

2009-08-19 Thread Michael S. Tsirkin
On Wed, Aug 19, 2009 at 03:46:44PM +0200, Arnd Bergmann wrote: On Wednesday 19 August 2009, Michael S. Tsirkin wrote: Maybe we could instead extend the 'splice' system call to work on a vhost_net file descriptor. If we do that, we can put the access back into a user thread (or two

[PATCHv4 0/2] vhost: a kernel-level virtio server

2009-08-19 Thread Michael S. Tsirkin
printks Michael S. Tsirkin (2): mm: export use_mm/unuse_mm to modules vhost_net: a kernel-level virtio server MAINTAINERS | 10 + arch/x86/kvm/Kconfig|1 + drivers/Makefile|1 + drivers/vhost/Kconfig | 11 + drivers/vhost/Makefile |2

[PATCHv4 1/2] mm: export use_mm/unuse_mm to modules

2009-08-19 Thread Michael S. Tsirkin
vhost net module wants to do copy to/from user from a kernel thread, which needs use_mm (like what fs/aio has). Move that into mm/ and export to modules. Acked-by: Andrew Morton a...@linux-foundation.org Acked-by: Andrea Arcangeli aarca...@redhat.com Signed-off-by: Michael S. Tsirkin m

[PATCHv4 2/2] vhost_net: a kernel-level virtio server

2009-08-19 Thread Michael S. Tsirkin
are not supported). Features that I plan to look at in the future: - TSO - interrupt mitigation - zero copy Acked-by: Arnd Bergmann a...@arndb.de Signed-off-by: Michael S. Tsirkin m...@redhat.com --- MAINTAINERS| 10 + arch/x86/kvm/Kconfig |1 + drivers/Makefile |1

Re: [PATCHv3 0/4] qemu-kvm: vhost net support

2009-08-20 Thread Michael S. Tsirkin
On Tue, Aug 18, 2009 at 03:23:02PM -0600, Alex Williamson wrote: On Tue, Aug 18, 2009 at 3:11 PM, Alex Williamsonalex.william...@hp.com wrote: On Tue, Aug 18, 2009 at 3:04 PM, Michael S. Tsirkinm...@redhat.com wrote: Did you assign ip address in host by any chance? You don't want that.

Re: [PATCHv3 2/2] vhost_net: a kernel-level virtio server

2009-08-20 Thread Michael S. Tsirkin
On Wed, Aug 19, 2009 at 05:27:07PM +0200, Arnd Bergmann wrote: On Wednesday 19 August 2009, Michael S. Tsirkin wrote: On Wed, Aug 19, 2009 at 03:46:44PM +0200, Arnd Bergmann wrote: On Wednesday 19 August 2009, Michael S. Tsirkin wrote: Leaving that aside for now, you could replace

Re: [PATCHv3 2/2] vhost_net: a kernel-level virtio server

2009-08-20 Thread Michael S. Tsirkin
On Thu, Aug 20, 2009 at 03:10:54PM +0200, Arnd Bergmann wrote: On Thursday 20 August 2009, Michael S. Tsirkin wrote: On Wed, Aug 19, 2009 at 05:27:07PM +0200, Arnd Bergmann wrote: On Wednesday 19 August 2009, Michael S. Tsirkin wrote: On Wed, Aug 19, 2009 at 03:46:44PM +0200, Arnd

Re: [PATCH 0/3] qemu-kvm: vhost net support

2009-08-20 Thread Michael S. Tsirkin
On Thu, Aug 20, 2009 at 04:49:47PM +0930, Rusty Russell wrote: On Thu, 13 Aug 2009 03:05:48 am Michael S. Tsirkin wrote: On Mon, Aug 10, 2009 at 03:51:12PM -0500, Anthony Liguori wrote: Any rough idea on performance? Better or worse than userspace? Well, I definitely see some gain

Re: [PATCHv3 2/2] vhost_net: a kernel-level virtio server

2009-08-20 Thread Michael S. Tsirkin
On Thu, Aug 20, 2009 at 04:31:36PM +0200, Arnd Bergmann wrote: On Thursday 20 August 2009, Michael S. Tsirkin wrote: On Thu, Aug 20, 2009 at 03:10:54PM +0200, Arnd Bergmann wrote: On Thursday 20 August 2009, Michael S. Tsirkin wrote: It doesn't matter that I don't want this: allowing 1

Re: [PATCH 0/3] qemu-kvm: vhost net support

2009-08-20 Thread Michael S. Tsirkin
On Thu, Aug 20, 2009 at 04:49:47PM +0930, Rusty Russell wrote: On Thu, 13 Aug 2009 03:05:48 am Michael S. Tsirkin wrote: On Mon, Aug 10, 2009 at 03:51:12PM -0500, Anthony Liguori wrote: Any rough idea on performance? Better or worse than userspace? Well, I definitely see some gain

Re: [PATCH 0/3] qemu-kvm: vhost net support

2009-08-20 Thread Michael S. Tsirkin
On Thu, Aug 20, 2009 at 08:24:37PM +0300, Avi Kivity wrote: On 08/20/2009 08:00 PM, Michael S. Tsirkin wrote: Surprisingly, I seem to get better-than-userspace throughput with this benchmark as well. Here's a test run locally, host-to-guest, over a veth link: Bleh, I knew it's too good

Re: [PATCHv3 3/4] qemu-kvm: vhost-net implementation

2009-08-20 Thread Michael S. Tsirkin
is loaded it's just very convenient to load vhost too. See also the problems we've cause with needing mkinitrd/dracut hacks by not having KVM_GUEST require VIRTIO_PCI On Mon, 2009-08-17 at 15:37 +0300, Michael S. Tsirkin wrote: This adds support for vhost-net virtio kernel backend

Re: [PATCHv3 0/4] qemu-kvm: vhost net support

2009-08-23 Thread Michael S. Tsirkin
On Tue, Aug 18, 2009 at 03:11:04PM -0600, Alex Williamson wrote: On Tue, Aug 18, 2009 at 3:04 PM, Michael S. Tsirkinm...@redhat.com wrote: Did you assign ip address in host by any chance? You don't want that. Nope, just up on the host, no IP: eth10 Link encap:Ethernet HWaddr

Re: [PATCHv3 0/4] qemu-kvm: vhost net support

2009-08-23 Thread Michael S. Tsirkin
OK, there is a small issue with networking setup here, but otherwise it looks like we'll have to debug it in vhost ... Forgot to ask - dmesg does not show anything interesting, does it? On Thu, Aug 20, 2009 at 04:05:04PM -0600, Alex Williamson wrote: On Thu, Aug 20, 2009 at 1:03 AM, Michael S.

vhost net: performance with ping benchmark

2009-08-24 Thread Michael S. Tsirkin
At Rusty's suggestion, I tested vhost base performance with ping. Results below, and seem to be what you'd expect. I'm working on TSO support, expect results shortly. latency with ping (lower is better): native: [r...@virtlab17 ~]# ping -c 100 -f -q 21.1.50.4 PING 21.1.50.4 (21.1.50.4)

Re: vhost net: performance with ping benchmark

2009-08-24 Thread Michael S. Tsirkin
On Mon, Aug 24, 2009 at 11:12:41AM +0300, Michael S. Tsirkin wrote: At Rusty's suggestion, I tested vhost base performance with ping. Results below, and seem to be what you'd expect. Rusty, any chance you could look at the code? Is it in reasonable shape? I think it makes sense to merge

Re: vhost net: performance with ping benchmark

2009-08-25 Thread Michael S. Tsirkin
On Tue, Aug 25, 2009 at 07:14:29AM +0300, Avi Kivity wrote: On 08/25/2009 05:22 AM, Anthony Liguori wrote: I think 2.6.32 is pushing it. 2.6.32 is pushing it, but we need to push it. I think some time is needed to flush out the userspace interface. In particular, I don't think Mark's

Re: [PATCHv4 2/2] virtio: refactor find_vqs

2009-08-25 Thread Michael S. Tsirkin
Michael S. Tsirkin wrote: On Tue, Jul 28, 2009 at 12:44:31PM +0930, Rusty Russell wrote: On Mon, 27 Jul 2009 01:17:09 am Michael S. Tsirkin wrote: This refactors find_vqs, making it more readable and robust, and fixing two regressions from 2.6.30: - double free_irq causing BUG_ON

Re: [PATCHv4 2/2] vhost_net: a kernel-level virtio server

2009-08-25 Thread Michael S. Tsirkin
Thanks for the comments, I'll work on them ASAP. Answers to questions and more comments below. On Tue, Aug 25, 2009 at 09:40:40PM +0930, Rusty Russell wrote: On Thu, 20 Aug 2009 12:33:09 am Michael S. Tsirkin wrote: What it is: vhost net is a character device that can be used to reduce

Re: vhost net: performance with ping benchmark

2009-08-25 Thread Michael S. Tsirkin
On Tue, Aug 25, 2009 at 08:08:05AM -0500, Anthony Liguori wrote: Michael S. Tsirkin wrote: My preference is ring proxying. Not we'll need ring proxying (or at least event proxying) for non-MSI guests. Exactly, that's what I meant earlier. That's enough, isn't it, Anthony

Re: vhost net: performance with ping benchmark

2009-08-25 Thread Michael S. Tsirkin
On Tue, Aug 25, 2009 at 08:08:05AM -0500, Anthony Liguori wrote: Once it goes into the upstream kernel, we need to have backwards compatibility code in QEMU forever to support that kernel version. BTW, qemu can keep doing the userspace thing if some capability it needs is missing. It won't

Re: vhost net: performance with ping benchmark

2009-08-25 Thread Michael S. Tsirkin
On Tue, Aug 25, 2009 at 08:24:07AM -0500, Anthony Liguori wrote: Avi Kivity wrote: My preference is ring proxying. Not we'll need ring proxying (or at least event proxying) for non-MSI guests. Thinking about this more... How does the hand off work? Assuming you normally don't proxy ring

Re: vhost net: performance with ping benchmark

2009-08-25 Thread Michael S. Tsirkin
On Tue, Aug 25, 2009 at 08:06:39AM -0500, Anthony Liguori wrote: Avi Kivity wrote: I think this is likely going to be needed regardless. I also think the tap compatibility suggestion would simplify the consumption of this in userspace. What about veth pairs? Does veth support GSO and

Re: [PATCHv4 2/2] vhost_net: a kernel-level virtio server

2009-08-25 Thread Michael S. Tsirkin
On Tue, Aug 25, 2009 at 09:40:40PM +0930, Rusty Russell wrote: + u32 __user *featurep = argp; + int __user *fdp = argp; + u32 features; + int fd, r; + switch (ioctl) { + case VHOST_NET_SET_SOCKET: + r = get_user(fd, fdp); + if (r 0) +

Re: vhost net: performance with ping benchmark

2009-08-26 Thread Michael S. Tsirkin
On Wed, Aug 26, 2009 at 05:04:44PM +0930, Rusty Russell wrote: On Tue, 25 Aug 2009 10:04:41 pm Arnd Bergmann wrote: On Tuesday 25 August 2009, Avi Kivity wrote: On 08/25/2009 05:22 AM, Anthony Liguori wrote: I think 2.6.32 is pushing it. 2.6.32 is pushing it, but we need to

Re: [PATCHv4 2/2] vhost_net: a kernel-level virtio server

2009-08-26 Thread Michael S. Tsirkin
On Wed, Aug 26, 2009 at 03:40:59PM +0200, Arnd Bergmann wrote: On Tuesday 25 August 2009, Michael S. Tsirkin wrote: I'd like to avoid that here, though it's kind of ugly. We'd need VHOST_GET_FEATURES (and ACK) to take a struct like: u32 feature_size; u32

Re: [PATCHv4 2/2] vhost_net: a kernel-level virtio server

2009-08-26 Thread Michael S. Tsirkin
On Tue, Aug 25, 2009 at 04:16:34PM +0300, Michael S. Tsirkin wrote: + /* If they don't want an interrupt, don't send one, unless empty. */ + if ((flags VRING_AVAIL_F_NO_INTERRUPT) vq-inflight) + return; And I wouldn't support notify on empty at all, TBH. If I don't

Re: [PATCHv4 2/2] virtio: refactor find_vqs

2009-08-27 Thread Michael S. Tsirkin
On Thu, Aug 27, 2009 at 07:00:34PM +0930, Rusty Russell wrote: On Tue, 25 Aug 2009 09:34:34 pm Michael S. Tsirkin wrote: That's because we didn't do the request_irq's for the per_vector case, because we don't have the names. This is what prevented me from doing a nice encapsulation

Re: [PATCHv4 2/2] vhost_net: a kernel-level virtio server

2009-08-27 Thread Michael S. Tsirkin
On Wed, Aug 26, 2009 at 03:40:59PM +0200, Arnd Bergmann wrote: On Tuesday 25 August 2009, Michael S. Tsirkin wrote: I'd like to avoid that here, though it's kind of ugly. We'd need VHOST_GET_FEATURES (and ACK) to take a struct like: u32 feature_size; u32

Re: [PATCHv4 2/2] vhost_net: a kernel-level virtio server

2009-08-27 Thread Michael S. Tsirkin
On Tue, Aug 25, 2009 at 09:40:40PM +0930, Rusty Russell wrote: Also, see other fixes to the lguest launcher since then which might be relevant to this code: lguest: get more serious about wmb() in example Launcher code Heh, this just gets one step closer to a real wmb. I just used the

Re: [PATCHv4 2/2] vhost_net: a kernel-level virtio server

2009-08-27 Thread Michael S. Tsirkin
On Thu, Aug 27, 2009 at 08:40:02PM +0930, Rusty Russell wrote: On Thu, 27 Aug 2009 08:15:18 pm Michael S. Tsirkin wrote: On Tue, Aug 25, 2009 at 09:40:40PM +0930, Rusty Russell wrote: Also, see other fixes to the lguest launcher since then which might be relevant to this code: lguest

Re: [PATCHv4 2/2] virtio: refactor find_vqs

2009-08-27 Thread Michael S. Tsirkin
On Thu, Aug 27, 2009 at 08:32:24PM +0930, Rusty Russell wrote: On Thu, 27 Aug 2009 07:19:26 pm Michael S. Tsirkin wrote: On Thu, Aug 27, 2009 at 07:00:34PM +0930, Rusty Russell wrote: On Tue, 25 Aug 2009 09:34:34 pm Michael S. Tsirkin wrote: That's because we didn't do the request_irq's

Re: vhost net: performance with ping benchmark

2009-08-27 Thread Michael S. Tsirkin
On Wed, Aug 26, 2009 at 05:04:44PM +0930, Rusty Russell wrote: On Tue, 25 Aug 2009 10:04:41 pm Arnd Bergmann wrote: On Tuesday 25 August 2009, Avi Kivity wrote: On 08/25/2009 05:22 AM, Anthony Liguori wrote: I think 2.6.32 is pushing it. 2.6.32 is pushing it, but we need to

[PATCHv5 2/3] mm: reduce atomic use on use_mm fast path

2009-08-27 Thread Michael S. Tsirkin
When mm switched to matches that of active mm, we don't need to increment and then drop the mm count. Making that conditional reduces contention on that cache line on SMP systems. Acked-by: Andrea Arcangeli aarca...@redhat.com Signed-off-by: Michael S. Tsirkin m...@redhat.com --- mm

[PATCHv5 3/3] vhost_net: a kernel-level virtio server

2009-08-27 Thread Michael S. Tsirkin
are not supported). For ping benchmark (where there's no TSO) troughput is also improved. Features that I plan to look at in the future: - tap support - TSO - interrupt mitigation - zero copy Acked-by: Arnd Bergmann a...@arndb.de Signed-off-by: Michael S. Tsirkin m...@redhat.com --- MAINTAINERS

[PATCHv5 1/3] mm: export use_mm/unuse_mm to modules

2009-08-27 Thread Michael S. Tsirkin
vhost net module wants to do copy to/from user from a kernel thread, which needs use_mm (like what fs/aio has). Move that into mm/ and export to modules. Acked-by: Andrew Morton a...@linux-foundation.org Acked-by: Andrea Arcangeli aarca...@redhat.com Signed-off-by: Michael S. Tsirkin m

[PATCHv5 0/3] vhost: a kernel-level virtio server

2009-08-27 Thread Michael S. Tsirkin
usage - Compat ioctl support - Make variable static - Copied more idiomatic english from Rusty Changes from v1: - Move use_mm/unuse_mm from fs/aio.c to mm instead of copying. - Reorder code to avoid need for forward declarations - Kill a couple of debugging printks Michael S. Tsirkin (3): mm

Re: [PATCHv5 3/3] vhost_net: a kernel-level virtio server

2009-09-07 Thread Michael S. Tsirkin
On Thu, Sep 03, 2009 at 11:39:45AM -0700, Ira W. Snyder wrote: On Thu, Aug 27, 2009 at 07:07:50PM +0300, Michael S. Tsirkin wrote: What it is: vhost net is a character device that can be used to reduce the number of system calls involved in virtio networking. Existing virtio net code

Re: [PATCHv5 3/3] vhost_net: a kernel-level virtio server

2009-09-08 Thread Michael S. Tsirkin
On Tue, Sep 08, 2009 at 10:20:35AM -0700, Ira W. Snyder wrote: On Mon, Sep 07, 2009 at 01:15:37PM +0300, Michael S. Tsirkin wrote: On Thu, Sep 03, 2009 at 11:39:45AM -0700, Ira W. Snyder wrote: On Thu, Aug 27, 2009 at 07:07:50PM +0300, Michael S. Tsirkin wrote: What it is: vhost net

Re: [PATCHv5 3/3] vhost_net: a kernel-level virtio server

2009-09-12 Thread Michael S. Tsirkin
On Fri, Sep 11, 2009 at 11:17:33PM +0800, Xin, Xiaohui wrote: Michael, We are very interested in your patch and want to have a try with it. I have collected your 3 patches in kernel side and 4 patches in queue side. The patches are listed here:

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