[RFC V2 0/7] Introduce VM Sockets virtio transport

2014-07-04 Thread Asias He
is used to control device. Currently, no control operation is defined. Asias He (7): VSOCK: Introduce vsock_find_unbound_socket and vsock_bind_dgram_generic VSOCK: Add dgram_skb to vsock_sock VSOCK: Introduce virtio-vsock-common.ko VSOCK: Introduce virtio-vsock.ko VSOCK: Introduce

[RFC V2 1/7] VSOCK: Introduce vsock_find_unbound_socket and vsock_bind_dgram_generic

2014-07-04 Thread Asias He
From: Asias He as...@redhat.com Signed-off-by: Asias He as...@redhat.com --- include/net/af_vsock.h | 2 ++ net/vmw_vsock/af_vsock.c | 70 2 files changed, 72 insertions(+) diff --git a/include/net/af_vsock.h b/include/net/af_vsock.h index

[RFC V2 2/7] VSOCK: Add dgram_skb to vsock_sock

2014-07-04 Thread Asias He
From: Asias He as...@redhat.com Signed-off-by: Asias He as...@redhat.com --- include/net/af_vsock.h | 1 + net/vmw_vsock/af_vsock.c | 1 + 2 files changed, 2 insertions(+) diff --git a/include/net/af_vsock.h b/include/net/af_vsock.h index 88f559a..ef668a0 100644 --- a/include/net/af_vsock.h

[RFC V2 7/7] Disable debug

2014-07-04 Thread Asias He
From: Asias He as...@redhat.com Signed-off-by: Asias He as...@redhat.com --- drivers/vhost/Makefile | 1 - net/vmw_vsock/Makefile | 2 -- 2 files changed, 3 deletions(-) diff --git a/drivers/vhost/Makefile b/drivers/vhost/Makefile index eccff51..6b012b9 100644 --- a/drivers/vhost/Makefile +++ b

[RFC V2 6/7] VSOCK: Add Makefile and Kconfig

2014-07-04 Thread Asias He
From: Asias He as...@redhat.com Enable virtio-vsock and vhost-vsock. Signed-off-by: Asias He as...@redhat.com --- drivers/vhost/Kconfig | 4 drivers/vhost/Kconfig.vsock | 7 +++ drivers/vhost/Makefile | 5 + net/vmw_vsock/Kconfig | 18 ++ net

[RFC V2 5/7] VSOCK: Introduce vhost-vsock.ko

2014-07-04 Thread Asias He
From: Asias He as...@redhat.com VM sockets vhost transport implementation. This module runs in host kernel. Signed-off-by: Asias He as...@redhat.com --- drivers/vhost/vsock.c | 572 ++ drivers/vhost/vsock.h | 4 + 2 files changed, 576 insertions

[RFC V2 4/7] VSOCK: Introduce virtio-vsock.ko

2014-07-04 Thread Asias He
From: Asias He as...@redhat.com VM sockets virtio transport implementation. This module runs in guest kernel. Signed-off-by: Asias He as...@redhat.com --- net/vmw_vsock/virtio_transport.c | 448 +++ 1 file changed, 448 insertions(+) create mode 100644 net

[PATCH] virtio-scsi: Fix hotcpu_notifier use-after-free with virtscsi_freeze

2013-10-28 Thread Asias He
vqs are freed in virtscsi_freeze but the hotcpu_notifier is not unregistered. We will have a use-after-free usage when the notifier callback is called after virtscsi_freeze. Signed-off-by: Asias He as...@redhat.com --- drivers/scsi/virtio_scsi.c | 15 ++- 1 file changed, 14

Re: [PATCH] vhost/scsi: Fix incorrect usage of get_user_pages_fast write parameter

2013-10-27 Thread Asias He
- WRITE payload case. This bug would manifest itself as random process segmentation faults on KVM host after repeated vhost starts + stops and/or with lots of vhost endpoints + LUNs. Cc: Stefan Hajnoczi stefa...@redhat.com Cc: Michael S. Tsirkin m...@redhat.com Cc: Asias He

Re: [PATCH] vhost/scsi: use vmalloc for order-10 allocation

2013-09-17 Thread Asias He
to do this fallback only when really needed. Reported-by: Dan Aloni alo...@stratoscale.com Signed-off-by: Michael S. Tsirkin m...@redhat.com Reviewed-by: Asias He as...@redhat.com --- I put this on my vhost fixes branch, intend to merge for 3.12. Dan, could you please confirm this works

Re: [PATCH] vhost: Drop linux/socket.h

2013-08-15 Thread Asias He
On Thu, Aug 15, 2013 at 02:07:40PM -0700, David Miller wrote: From: Asias He as...@redhat.com Date: Thu, 15 Aug 2013 11:20:16 +0800 memcpy_fromiovec is moved to lib/iovec.c. No need to include linux/socket.h for it. Signed-off-by: Asias He as...@redhat.com You can't do

[PATCH] vhost: Drop linux/socket.h

2013-08-14 Thread Asias He
memcpy_fromiovec is moved to lib/iovec.c. No need to include linux/socket.h for it. Signed-off-by: Asias He as...@redhat.com --- drivers/vhost/vhost.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index e58cf00..038c242 100644 --- a/drivers

Re: [PATCH 0/5] Enable Drivers for Intel MIC X100 Coprocessors.

2013-08-01 Thread Asias He
Hello Sudeep Dutt, On Wed, Jul 31, 2013 at 06:46:08PM -0700, Greg Kroah-Hartman wrote: On Wed, Jul 24, 2013 at 08:31:31PM -0700, Sudeep Dutt wrote: An Intel MIC X100 device is a PCIe form factor add-in coprocessor card based on the Intel Many Integrated Core (MIC) architecture that runs a

[PATCH] virtio-scsi: Fix virtqueue affinity setup

2013-07-31 Thread Asias He
] __virtscsi_set_affinity+0x6f/0x120 RSP 88007bfe5a38 CR2: 0020 ---[ end trace 99679331a3775f48 ]--- CC: sta...@vger.kernel.org Signed-off-by: Asias He as...@redhat.com --- drivers/scsi/virtio_scsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/virtio_scsi.c b

Re: [PATCH v2 03/11] vhost: Make vhost a separate module

2013-07-09 Thread Asias He
On Sun, Jul 07, 2013 at 05:40:51PM +0300, Michael S. Tsirkin wrote: On Sun, Jul 07, 2013 at 02:37:10PM +0300, Michael S. Tsirkin wrote: On Mon, May 06, 2013 at 08:10:03PM +0800, Asias He wrote: On Mon, May 06, 2013 at 01:03:42PM +0300, Michael S. Tsirkin wrote: On Mon, May 06, 2013 at 04

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

2013-07-09 Thread Asias He
be able to get rid of a barrier here. Deferring this optimization until we do some benchmarking. Signed-off-by: Michael S. Tsirkin m...@redhat.com Acked-by: Asias He as...@redhat.com --- drivers/virtio/virtio_ring.c | 56 ++-- include/linux/virtio.h

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

2013-07-03 Thread Asias He
the serialization of refill. Cc: 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 Reviewed-by: Asias He as...@redhat.com --- drivers/net/virtio_net.c |5 + 1 files changed, 1

Re: [RFC 2/5] VSOCK: Introduce virtio-vsock-common.ko

2013-06-29 Thread Asias He
Hi David, On Fri, Jun 28, 2013 at 09:32:25PM -0700, David Miller wrote: From: Asias He as...@redhat.com Date: Thu, 27 Jun 2013 16:00:01 +0800 +static void +virtio_transport_recv_dgram(struct sock *sk, + struct virtio_vsock_pkt *pkt) ... + memcpy(skb-data, pkt

Re: [RFC 0/5] Introduce VM Sockets virtio transport

2013-06-28 Thread Asias He
On Thu, Jun 27, 2013 at 01:23:24PM +0300, Michael S. Tsirkin wrote: On Thu, Jun 27, 2013 at 03:59:59PM +0800, Asias He wrote: Hello guys, In commit d021c344051af91 (VSOCK: Introduce VM Sockets), VMware added VM Sockets support. VM Sockets allows communication between virtual machines

Re: [RFC 2/5] VSOCK: Introduce virtio-vsock-common.ko

2013-06-28 Thread Asias He
On Thu, Jun 27, 2013 at 01:34:30PM +0300, Michael S. Tsirkin wrote: On Thu, Jun 27, 2013 at 04:00:01PM +0800, Asias He wrote: This module contains the common code and header files for the following virtio-vsock and virtio-vhost kernel modules. Signed-off-by: Asias He as...@redhat.com

Re: [RFC 4/5] VSOCK: Introduce vhost-vsock.ko

2013-06-28 Thread Asias He
On Thu, Jun 27, 2013 at 01:42:46PM +0300, Michael S. Tsirkin wrote: On Thu, Jun 27, 2013 at 04:00:03PM +0800, Asias He wrote: VM sockets vhost transport implementation. This module runs in host kernel. Signed-off-by: Asias He as...@redhat.com Has any thought been given to how

[RFC 0/5] Introduce VM Sockets virtio transport

2013-06-27 Thread Asias He
, the performance will suffer. The controlq is used to control device. Currently, no control operation is defined. Asias He (5): VSOCK: Introduce vsock_find_unbound_socket and vsock_bind_dgram_generic VSOCK: Introduce virtio-vsock-common.ko VSOCK: Introduce virtio-vsock.ko VSOCK: Introduce

[RFC 1/5] VSOCK: Introduce vsock_find_unbound_socket and vsock_bind_dgram_generic

2013-06-27 Thread Asias He
Signed-off-by: Asias He as...@redhat.com --- net/vmw_vsock/af_vsock.c | 70 net/vmw_vsock/af_vsock.h | 2 ++ 2 files changed, 72 insertions(+) diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c index 593071d..bc76ddb 100644

[RFC 2/5] VSOCK: Introduce virtio-vsock-common.ko

2013-06-27 Thread Asias He
This module contains the common code and header files for the following virtio-vsock and virtio-vhost kernel modules. Signed-off-by: Asias He as...@redhat.com --- include/linux/virtio_vsock.h| 200 +++ include/uapi/linux/virtio_ids.h | 1 + include/uapi/linux

[RFC 3/5] VSOCK: Introduce virtio-vsock.ko

2013-06-27 Thread Asias He
VM sockets virtio transport implementation. This module runs in guest kernel. Signed-off-by: Asias He as...@redhat.com --- net/vmw_vsock/virtio_transport.c | 424 +++ 1 file changed, 424 insertions(+) create mode 100644 net/vmw_vsock/virtio_transport.c diff

[RFC 4/5] VSOCK: Introduce vhost-vsock.ko

2013-06-27 Thread Asias He
VM sockets vhost transport implementation. This module runs in host kernel. Signed-off-by: Asias He as...@redhat.com --- drivers/vhost/vsock.c | 534 ++ drivers/vhost/vsock.h | 4 + 2 files changed, 538 insertions(+) create mode 100644 drivers

[RFC 5/5] VSOCK: Add Makefile and Kconfig

2013-06-27 Thread Asias He
Enable virtio-vsock and vhost-vsock. Signed-off-by: Asias He as...@redhat.com --- drivers/vhost/Kconfig | 4 drivers/vhost/Kconfig.vsock | 7 +++ drivers/vhost/Makefile | 5 + net/vmw_vsock/Kconfig | 18 ++ net/vmw_vsock/Makefile | 4 5

Re: [RFC 0/5] Introduce VM Sockets virtio transport

2013-06-27 Thread Asias He
On Thu, Jun 27, 2013 at 07:25:40PM -0700, Andy King wrote: Hi Michael, __u32 guest_cid; Given that cid is like an IP address, 32 bit seems too limiting. I would go for a 64 bit one or maybe even 128 bit, so that e.g. GUIDs can be used there. That's likely based on what

Re: [PATCH net] vhost-net: fix use-after-free in vhost_net_flush

2013-06-21 Thread Asias He
it to vhost_net_ubuf_put_and_wait, this results in use after free. To fix, don't free the argument in vhost_net_ubuf_put_and_wait, add an new API for callers that want to free ubufs. Signed-off-by: Michael S. Tsirkin m...@redhat.com Acked-by: Asias He as...@redhat.com --- Dave, this is needed for stable

Re: [PATCH] vhost-scsi: return -ENOENT when no matching tcm_vhost_tpg found

2013-05-28 Thread Asias He
...@gmail.com Acked-by: Asias He as...@redhat.com BTW, It would be nice to print more informative info in qemu when wwpn is not available as well. --- drivers/vhost/scsi.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c

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

2013-05-15 Thread Asias He
On Wed, May 15, 2013 at 03:37:30PM -0700, Nicholas A. Bellinger wrote: 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

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

2013-05-15 Thread Asias He
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: memcpy_fromiovec [drivers/vhost

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

2013-05-15 Thread Asias He
On Thu, May 16, 2013 at 09:05:38AM +0930, Rusty Russell wrote: 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

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

2013-05-15 Thread Asias He
On Thu, May 16, 2013 at 01:04:58PM +0930, Rusty Russell wrote: 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

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

2013-05-14 Thread Asias He
-by: Randy Dunlap rdun...@infradead.org Signed-off-by: Asias He as...@redhat.com --- drivers/vhost/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/vhost/Kconfig b/drivers/vhost/Kconfig index 8b9226d..0403323 100644 --- a/drivers/vhost/Kconfig +++ b/drivers/vhost/Kconfig

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

2013-05-14 Thread Asias He
On Tue, May 14, 2013 at 08:10:20PM -0700, Nicholas A. Bellinger wrote: On Wed, 2013-05-15 at 08:59 +0800, Asias He wrote: scsi.c includes vhost.c which uses memcpy_fromiovec. This patch fixes this build failure. From Randy Dunlap: ''' on x86_64: ERROR

[PATCH v2] vhost-test: Make vhost/test.c work

2013-05-08 Thread Asias He
Fix it by switching to use the new device specific fields per vq Signed-off-by: Asias He as...@redhat.com --- This is for 3.10. drivers/vhost/test.c | 35 --- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/drivers/vhost/test.c b/drivers/vhost

Re: [PATCH] vhost-test: Make vhost/test.c work

2013-05-08 Thread Asias He
On Wed, May 08, 2013 at 10:59:03AM +0300, Michael S. Tsirkin wrote: On Wed, May 08, 2013 at 03:14:58PM +0800, Asias He wrote: On Tue, May 07, 2013 at 02:22:32PM +0300, Michael S. Tsirkin wrote: On Tue, May 07, 2013 at 02:52:45PM +0800, Asias He wrote: Fix it by: 1) switching to use

Re: [PATCH v2] vhost-test: Make vhost/test.c work

2013-05-08 Thread Asias He
On Wed, May 08, 2013 at 10:56:19AM +0300, Michael S. Tsirkin wrote: On Wed, May 08, 2013 at 03:24:33PM +0800, Asias He wrote: Fix it by switching to use the new device specific fields per vq Signed-off-by: Asias He as...@redhat.com --- This is for 3.10. drivers/vhost/test.c

[PATCH] vhost-scsi: Enable VIRTIO_RING_F_EVENT_IDX

2013-05-07 Thread Asias He
It is disabled as a workaround. Now userspace bits works fine with it. So, let's enable it. Signed-off-by: Asias He as...@redhat.com --- drivers/vhost/scsi.c | 8 +--- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c index d860b58

[PATCH] vhost-test: Make vhost/test.c work

2013-05-07 Thread Asias He
Fix it by: 1) switching to use the new device specific fields per vq 2) not including vhost.c, instead make vhost-test.ko depend on vhost.ko. --- drivers/vhost/test.c | 37 + 1 file changed, 25 insertions(+), 12 deletions(-) diff --git a/drivers/vhost/test.c

[PATCH 0/4] vhost private_data rcu removal

2013-05-07 Thread Asias He
Asias He (4): vhost-net: Always access vq-private_data under vq mutex vhost-test: Always access vq-private_data under vq mutex vhost-scsi: Always access vq-private_data under vq mutex vhost: Remove custom vhost rcu usage drivers/vhost/net.c | 37

[PATCH 1/4] vhost-net: Always access vq-private_data under vq mutex

2013-05-07 Thread Asias He
Signed-off-by: Asias He as...@redhat.com --- drivers/vhost/net.c | 21 ++--- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index 2b51e23..b616d9a 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c @@ -349,12

[PATCH 3/4] vhost-scsi: Always access vq-private_data under vq mutex

2013-05-07 Thread Asias He
Signed-off-by: Asias He as...@redhat.com --- drivers/vhost/scsi.c | 11 --- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c index 5531ebc..d78768b 100644 --- a/drivers/vhost/scsi.c +++ b/drivers/vhost/scsi.c @@ -896,19 +896,15

[PATCH 4/4] vhost: Remove custom vhost rcu usage

2013-05-07 Thread Asias He
Now, vq-private_data is always accessed under vq mutex. No need to play the vhost rcu trick. Signed-off-by: Asias He as...@redhat.com --- drivers/vhost/net.c | 16 ++-- drivers/vhost/scsi.c | 6 ++ drivers/vhost/test.c | 11 --- drivers/vhost/vhost.h | 10

[PATCH] KVM: Fix kvm_irqfd_init initialization

2013-05-07 Thread Asias He
66 90 b8 00 01 00 00 f0 66 0f c1 07 89 c2 66 c1 ea 08 38 c2 74 0c 0f 1f 00 f3 90 0f RIP [81c0721e] _raw_spin_lock+0xe/0x30 RSP 880221721cc8 CR2: ---[ end trace 13fb1e4b6e5ab21f ]--- Signed-off-by: Asias He as...@redhat.com --- virt/kvm/kvm_main.c | 11 ++- 1

Re: [PATCH] KVM: Fix kvm_irqfd_init initialization

2013-05-07 Thread Asias He
On Tue, May 07, 2013 at 05:59:38PM +0300, Michael S. Tsirkin wrote: On Tue, May 07, 2013 at 10:54:16PM +0800, Asias He wrote: In commit a0f155e96 'KVM: Initialize irqfd from kvm_init()', when kvm_init() is called the second time (e.g kvm-amd.ko and kvm-intel.ko), kvm_arch_init() will fail

[PATCH v2] KVM: Fix kvm_irqfd_init initialization

2013-05-07 Thread Asias He
66 90 b8 00 01 00 00 f0 66 0f c1 07 89 c2 66 c1 ea 08 38 c2 74 0c 0f 1f 00 f3 90 0f RIP [81c0721e] _raw_spin_lock+0xe/0x30 RSP 880221721cc8 CR2: ---[ end trace 13fb1e4b6e5ab21f ]--- Signed-off-by: Asias He as...@redhat.com --- virt/kvm/kvm_main.c | 18

Re: [PATCH 4/4] vhost-net: Cleanup vhost_ubuf adn vhost_zcopy

2013-05-06 Thread Asias He
On Mon, May 6, 2013 at 4:17 PM, Michael S. Tsirkin m...@redhat.com wrote: Typo a/adn/and/ Yes. Catched this up and and fixed already. On Fri, May 03, 2013 at 02:25:18PM +0800, Asias He wrote: - Rename vhost_ubuf to vhost_net_ubuf - Rename vhost_zcopy_mask to vhost_net_zcopy_mask - Make

[PATCH v2 00/11] vhost cleanups

2013-05-06 Thread Asias He
MST, This is on top of [PATCH 0/2] vhost-net fix ubuf. Asias He (11): vhost: Remove vhost_enable_zcopy in vhost.h vhost: Move VHOST_NET_FEATURES to net.c vhost: Make vhost a separate module vhost: Remove comments for hdr in vhost.h vhost: Simplify dev-vqs[i] access vhost-net: Cleanup

[PATCH v2 01/11] vhost: Remove vhost_enable_zcopy in vhost.h

2013-05-06 Thread Asias He
It is net.c specific. Signed-off-by: Asias He as...@redhat.com --- drivers/vhost/vhost.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h index cc23bc4..076c9ac 100644 --- a/drivers/vhost/vhost.h +++ b/drivers/vhost/vhost.h @@ -192,7 +192,4

[PATCH v2 02/11] vhost: Move VHOST_NET_FEATURES to net.c

2013-05-06 Thread Asias He
vhost.h should not depend on device specific marcos like VHOST_NET_F_VIRTIO_NET_HDR and VIRTIO_NET_F_MRG_RXBUF. Signed-off-by: Asias He as...@redhat.com --- drivers/vhost/net.c | 6 ++ drivers/vhost/vhost.h | 3 --- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers

[PATCH v2 03/11] vhost: Make vhost a separate module

2013-05-06 Thread Asias He
Currently, vhost-net and vhost-scsi are sharing the vhost core code. However, vhost-scsi shares the code by including the vhost.c file directly. Making vhost a separate module makes it is easier to share code with other vhost devices. Signed-off-by: Asias He as...@redhat.com --- drivers/vhost

[PATCH v2 04/11] vhost: Remove comments for hdr in vhost.h

2013-05-06 Thread Asias He
It is supposed to be removed when hdr is moved into vhost_net_virtqueue. Signed-off-by: Asias He as...@redhat.com --- drivers/vhost/vhost.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h index 94a80eb..51aeb5f 100644 --- a/drivers/vhost

[PATCH v2 05/11] vhost: Simplify dev-vqs[i] access

2013-05-06 Thread Asias He
Signed-off-by: Asias He as...@redhat.com --- drivers/vhost/vhost.c | 35 ++- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index e406d5f..74bc779 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost

[PATCH v2 07/11] vhost-scsi: Remove unnecessary forward struct vhost_scsi declaration

2013-05-06 Thread Asias He
It was needed when struct tcm_vhost_tpg is in tcm_vhost.h Signed-off-by: Asias He as...@redhat.com --- drivers/vhost/scsi.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c index 2dcb94a..02ddedd 100644 --- a/drivers/vhost/scsi.c +++ b/drivers/vhost

[PATCH v2 08/11] vhost-scsi: Rename struct vhost_scsi *s to *vs

2013-05-06 Thread Asias He
vs is used everywhere, make the naming more consistent. Signed-off-by: Asias He as...@redhat.com --- drivers/vhost/scsi.c | 56 ++-- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c index

[PATCH v2 09/11] vhost-scsi: Make func indention more consistent

2013-05-06 Thread Asias He
Signed-off-by: Asias He as...@redhat.com --- drivers/vhost/scsi.c | 154 +-- 1 file changed, 88 insertions(+), 66 deletions(-) diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c index d4798e1..d9781ed 100644 --- a/drivers/vhost/scsi.c +++ b

[PATCH v2 10/11] vhost-scsi: Rename struct tcm_vhost_tpg *tv_tpg to *tpg

2013-05-06 Thread Asias He
Signed-off-by: Asias He as...@redhat.com --- drivers/vhost/scsi.c | 122 +-- 1 file changed, 61 insertions(+), 61 deletions(-) diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c index d9781ed..353145f 100644 --- a/drivers/vhost/scsi.c +++ b

Re: [PATCH v2 00/11] vhost cleanups

2013-05-06 Thread Asias He
On Mon, May 06, 2013 at 01:07:46PM +0300, Michael S. Tsirkin wrote: On Mon, May 06, 2013 at 04:38:18PM +0800, Asias He wrote: MST, This is on top of [PATCH 0/2] vhost-net fix ubuf. Okay, how about making EVENT_IDX work for virtio-scsi? I'm guessing it's some messup with feature negotiation

Re: [PATCH] vhost: drop virtio_net.h dependency

2013-05-06 Thread Asias He
On Mon, May 06, 2013 at 01:37:34PM +0300, Michael S. Tsirkin wrote: There's no net specific code in vhost.c anymore, don't include the virtio_net.h header. Signed-off-by: Michael S. Tsirkin m...@redhat.com Reviewed-by: Asias He as...@redhat.com --- This is on top of Asias' patches

Re: [PATCH v2 03/11] vhost: Make vhost a separate module

2013-05-06 Thread Asias He
On Mon, May 06, 2013 at 01:03:42PM +0300, Michael S. Tsirkin wrote: On Mon, May 06, 2013 at 04:38:21PM +0800, Asias He wrote: Currently, vhost-net and vhost-scsi are sharing the vhost core code. However, vhost-scsi shares the code by including the vhost.c file directly. Making vhost

Re: [PATCH v2 00/11] vhost cleanups

2013-05-06 Thread Asias He
On Mon, May 06, 2013 at 04:15:35PM +0300, Michael S. Tsirkin wrote: On Mon, May 06, 2013 at 08:05:26PM +0800, Asias He wrote: On Mon, May 06, 2013 at 01:07:46PM +0300, Michael S. Tsirkin wrote: On Mon, May 06, 2013 at 04:38:18PM +0800, Asias He wrote: MST, This is on top of [PATCH 0/2

Re: [PATCH] vhost: drop virtio_net.h dependency

2013-05-06 Thread Asias He
On Mon, May 06, 2013 at 01:37:34PM +0300, Michael S. Tsirkin wrote: There's no net specific code in vhost.c anymore, don't include the virtio_net.h header. Did you push the it to your tree. I am not seeing it. Signed-off-by: Michael S. Tsirkin m...@redhat.com --- This is on top of Asias'

[PATCH 0/2] vhost-net fix ubuf

2013-05-05 Thread Asias He
Asias He (2): vhost: Export vhost_dev_set_owner vhost-net: Free ubuf when vhost_dev_set_owner fails drivers/vhost/net.c | 38 -- drivers/vhost/vhost.c | 2 +- drivers/vhost/vhost.h | 1 + 3 files changed, 34 insertions(+), 7 deletions(-) -- 1.8.1.4

[PATCH 1/2] vhost: Export vhost_dev_set_owner

2013-05-05 Thread Asias He
Signed-off-by: Asias He as...@redhat.com --- drivers/vhost/vhost.c | 2 +- drivers/vhost/vhost.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index 749b5ab..de9441a 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c

[PATCH 2/2] vhost-net: Free ubuf when vhost_dev_set_owner fails

2013-05-05 Thread Asias He
Signed-off-by: Asias He as...@redhat.com --- drivers/vhost/net.c | 38 -- 1 file changed, 32 insertions(+), 6 deletions(-) diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index a3645bd..354665a 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c

[PATCH 0/4] vhost and vhost-net cleanups

2013-05-03 Thread Asias He
Asias He (4): vhost: Remove comments for hdr in vhost.h vhost: Simplify dev-vqs[i] access vhost-net: Free ubuf when vhost_dev_ioctl fails vhost-net: Cleanup vhost_ubuf adn vhost_zcopy drivers/vhost/net.c | 76 +++ drivers/vhost/vhost.c

[PATCH 1/4] vhost: Remove comments for hdr in vhost.h

2013-05-03 Thread Asias He
It is supposed to be removed when hdr is moved into vhost_net_virtqueue. Signed-off-by: Asias He as...@redhat.com --- drivers/vhost/vhost.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h index 6fefebf..f9045b4 100644 --- a/drivers/vhost

[PATCH 2/4] vhost: Simplify dev-vqs[i] access

2013-05-03 Thread Asias He
Signed-off-by: Asias He as...@redhat.com --- drivers/vhost/vhost.c | 35 ++- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index 73100fe..0003bab 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost

[PATCH 3/4] vhost-net: Free ubuf when vhost_dev_ioctl fails

2013-05-03 Thread Asias He
Free ubuf when vhost_dev_ioctl for VHOST_SET_OWNER fails. Signed-off-by: Asias He as...@redhat.com --- drivers/vhost/net.c | 20 ++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index b2f6b41..eb73217 100644

[PATCH 4/4] vhost-net: Cleanup vhost_ubuf adn vhost_zcopy

2013-05-03 Thread Asias He
- Rename vhost_ubuf to vhost_net_ubuf - Rename vhost_zcopy_mask to vhost_net_zcopy_mask - Make funcs static Signed-off-by: Asias He as...@redhat.com --- drivers/vhost/net.c | 58 +++-- 1 file changed, 30 insertions(+), 28 deletions(-) diff --git

[PATCH 0/5] vhost-scsi cleanup

2013-05-03 Thread Asias He
Asias He (5): vhost-scsi: Remove unnecessary forward struct vhost_scsi declaration vhost-scsi: Rename struct vhost_scsi *s to *vs vhost-scsi: Make func indention more consistent vhost-scsi: Rename struct tcm_vhost_tpg *tv_tpg to *tpg vhost-scsi: Rename struct tcm_vhost_cmd *tv_cmd

[PATCH 1/5] vhost-scsi: Remove unnecessary forward struct vhost_scsi declaration

2013-05-03 Thread Asias He
It was needed when struct tcm_vhost_tpg is in tcm_vhost.h Signed-off-by: Asias He as...@redhat.com --- drivers/vhost/scsi.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c index 2dcb94a..02ddedd 100644 --- a/drivers/vhost/scsi.c +++ b/drivers/vhost

[PATCH 2/5] vhost-scsi: Rename struct vhost_scsi *s to *vs

2013-05-03 Thread Asias He
vs is used everywhere, make the naming more consistent. Signed-off-by: Asias He as...@redhat.com --- drivers/vhost/scsi.c | 56 ++-- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c index

[PATCH 3/5] vhost-scsi: Make func indention more consistent

2013-05-03 Thread Asias He
Signed-off-by: Asias He as...@redhat.com --- drivers/vhost/scsi.c | 154 +-- 1 file changed, 88 insertions(+), 66 deletions(-) diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c index d4798e1..d9781ed 100644 --- a/drivers/vhost/scsi.c +++ b

[PATCH 4/5] vhost-scsi: Rename struct tcm_vhost_tpg *tv_tpg to *tpg

2013-05-03 Thread Asias He
Signed-off-by: Asias He as...@redhat.com --- drivers/vhost/scsi.c | 122 +-- 1 file changed, 61 insertions(+), 61 deletions(-) diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c index d9781ed..353145f 100644 --- a/drivers/vhost/scsi.c +++ b

[PATCH 0/3] vhost cleanups and separate module

2013-05-02 Thread Asias He
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 drivers/vhost/Kconfig | 8 drivers/vhost/Makefile | 3 ++- drivers/vhost/net.c| 6 ++ drivers/vhost/scsi.c | 1 - drivers/vhost

[PATCH 1/3] vhost: Remove vhost_enable_zcopy in vhost.h

2013-05-02 Thread Asias He
It is net.c specific. Signed-off-by: Asias He as...@redhat.com --- drivers/vhost/vhost.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h index b58f4ae..4330209 100644 --- a/drivers/vhost/vhost.h +++ b/drivers/vhost/vhost.h @@ -191,7 +191,4

[PATCH 2/3] vhost: Move VHOST_NET_FEATURES to net.c

2013-05-02 Thread Asias He
vhost.h should not depend on device specific marcos like VHOST_NET_F_VIRTIO_NET_HDR and VIRTIO_NET_F_MRG_RXBUF. Signed-off-by: Asias He as...@redhat.com --- drivers/vhost/net.c | 6 ++ drivers/vhost/vhost.h | 3 --- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers

[PATCH 3/3] vhost: Make vhost a separate module

2013-05-02 Thread Asias He
Currently, vhost-net and vhost-scsi are sharing the vhost core code. However, vhost-scsi shares the code by including the vhost.c file directly. Making vhost a separate module makes it is easier to share code with other vhost devices. Signed-off-by: Asias He as...@redhat.com --- drivers/vhost

Re: [PATCH] tcm_vhost: Add vhost_scsi as an alias for tcm_vhost

2013-05-01 Thread Asias He
On Wed, May 01, 2013 at 09:42:22AM +0300, Michael S. Tsirkin wrote: On Sat, Apr 27, 2013 at 11:42:09AM +0800, Asias He wrote: Signed-off-by: Asias He as...@redhat.com Nicholas, thoughts? How about we move tcm_vhost.c to scsi.c call module vhost_scsi and add tcm_vhost as an alias

Re: [PATCH v6 2/2] tcm_vhost: Wait for pending requests in vhost_scsi_flush()

2013-04-28 Thread Asias He
On Sat, Apr 27, 2013 at 10:40:41PM +0300, Michael S. Tsirkin wrote: On Sat, Apr 27, 2013 at 11:16:49AM +0800, Asias He wrote: Unlike tcm_vhost_evt requests, tcm_vhost_cmd requests are passed to the target core system, we can not make sure all the pending requests will be finished

Re: [PATCH v6 2/2] tcm_vhost: Wait for pending requests in vhost_scsi_flush()

2013-04-28 Thread Asias He
On Sun, Apr 28, 2013 at 11:24:00AM +0300, Michael S. Tsirkin wrote: On Sun, Apr 28, 2013 at 03:48:23PM +0800, Asias He wrote: On Sat, Apr 27, 2013 at 10:40:41PM +0300, Michael S. Tsirkin wrote: On Sat, Apr 27, 2013 at 11:16:49AM +0800, Asias He wrote: Unlike tcm_vhost_evt requests

Re: [PATCH v6 2/2] tcm_vhost: Wait for pending requests in vhost_scsi_flush()

2013-04-28 Thread Asias He
On Sun, Apr 28, 2013 at 12:27:15PM +0300, Michael S. Tsirkin wrote: On Sun, Apr 28, 2013 at 04:52:08PM +0800, Asias He wrote: On Sun, Apr 28, 2013 at 11:24:00AM +0300, Michael S. Tsirkin wrote: On Sun, Apr 28, 2013 at 03:48:23PM +0800, Asias He wrote: On Sat, Apr 27, 2013 at 10:40:41PM

[PATCH] vhost: Move vhost-net zerocopy support fields to net.c

2013-04-27 Thread Asias He
On top of 'vhost: Allow device specific fields per vq', we can move device specific fields to device virt queue from vhost virt queue. Signed-off-by: Asias He as...@redhat.com --- drivers/vhost/net.c | 164 +++--- drivers/vhost/vhost.c | 57

[PATCH v6 0/2] tcm_vhost flush

2013-04-26 Thread Asias He
Changes in v6: - Allow device specific fields per vq - Track cmd per vq - Do not track evt - Switch to static array for inflight allocation, completely get rid of the pain to handle inflight allocation failure. Asias He (2): vhost: Allow device specific fields per vq tcm_vhost: Wait

[PATCH v6 1/2] vhost: Allow device specific fields per vq

2013-04-26 Thread Asias He
...@redhat.com Signed-off-by: Asias He as...@redhat.com --- drivers/vhost/net.c | 60 +++- drivers/vhost/tcm_vhost.c | 55 +++-- drivers/vhost/vhost.c | 88 +++ drivers/vhost/vhost.h | 4 +-- 4

[PATCH v6 2/2] tcm_vhost: Wait for pending requests in vhost_scsi_flush()

2013-04-26 Thread Asias He
no requests will be leaked and existing requests will be completed. Signed-off-by: Asias He as...@redhat.com --- drivers/vhost/tcm_vhost.c | 90 ++- drivers/vhost/tcm_vhost.h | 3 ++ 2 files changed, 92 insertions(+), 1 deletion(-) diff --git a/drivers

[PATCH] tcm_vhost: Add vhost_scsi as an alias for tcm_vhost

2013-04-26 Thread Asias He
Signed-off-by: Asias He as...@redhat.com --- drivers/vhost/tcm_vhost.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/vhost/tcm_vhost.c b/drivers/vhost/tcm_vhost.c index 1677238..bddc39a 100644 --- a/drivers/vhost/tcm_vhost.c +++ b/drivers/vhost/tcm_vhost.c @@ -1928,5 +1928,6

[PATCH v10 0/4] tcm_vhost hotplug

2013-04-25 Thread Asias He
Asias He (4): tcm_vhost: Refactor the lock nesting rule tcm_vhost: Add hotplug/hotunplug support tcm_vhost: Add ioctl to get and set events missed flag tcm_vhost: Enable VIRTIO_SCSI_F_HOTPLUG drivers/vhost/tcm_vhost.c | 262 +++--- drivers/vhost

[PATCH v10 1/4] tcm_vhost: Refactor the lock nesting rule

2013-04-25 Thread Asias He
We want to use tcm_vhost_mutex to make sure hotplug/hotunplug will not happen when set_endpoint/clear_endpoint is in process. Signed-off-by: Asias He as...@redhat.com --- drivers/vhost/tcm_vhost.c | 32 +++- 1 file changed, 19 insertions(+), 13 deletions(-) diff

[PATCH v10 3/4] tcm_vhost: Add ioctl to get and set events missed flag

2013-04-25 Thread Asias He
Signed-off-by: Asias He as...@redhat.com --- drivers/vhost/tcm_vhost.c | 17 + drivers/vhost/tcm_vhost.h | 3 +++ 2 files changed, 20 insertions(+) diff --git a/drivers/vhost/tcm_vhost.c b/drivers/vhost/tcm_vhost.c index 5340fd7..07217d8 100644 --- a/drivers/vhost/tcm_vhost.c

[PATCH v10 4/4] tcm_vhost: Enable VIRTIO_SCSI_F_HOTPLUG

2013-04-25 Thread Asias He
Everything for hotplug is ready. Let's enable the feature bit. Signed-off-by: Asias He as...@redhat.com --- drivers/vhost/tcm_vhost.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/vhost/tcm_vhost.c b/drivers/vhost/tcm_vhost.c index 07217d8..1677238 100644

Re: [PATCH v10 2/4] tcm_vhost: Add hotplug/hotunplug support

2013-04-25 Thread Asias He
MST wants one without change history in commit log. From 8996c9464fae1f28d0bd729677a3917d204990ec Mon Sep 17 00:00:00 2001 From: Asias He as...@redhat.com Date: Thu, 25 Apr 2013 09:51:26 +0800 Subject: [PATCH v10 2/4] tcm_vhost: Add hotplug/hotunplug support In commit 365a7150094 ([SCSI] virtio

[PATCH v11 0/4] tcm_vhost hotplug

2013-04-25 Thread Asias He
Changes in v11 - Drop change log histroy in commit log Changes in v10 - Drop comments about lun - Add Enable VIRTIO_SCSI_F_HOTPLUG to this series Changes in v9 - Drop tcm_vhost_check_feature - Add Refactor the lock nesting rule to this sereis Asias He (4): tcm_vhost: Refactor the lock nesting

[PATCH v11 1/4] tcm_vhost: Refactor the lock nesting rule

2013-04-25 Thread Asias He
We want to use tcm_vhost_mutex to make sure hotplug/hotunplug will not happen when set_endpoint/clear_endpoint is in process. Signed-off-by: Asias He as...@redhat.com --- drivers/vhost/tcm_vhost.c | 32 +++- 1 file changed, 19 insertions(+), 13 deletions(-) diff

[PATCH v11 2/4] tcm_vhost: Add hotplug/hotunplug support

2013-04-25 Thread Asias He
In commit 365a7150094 ([SCSI] virtio-scsi: hotplug support for virtio-scsi), hotplug support is added to virtio-scsi. This patch adds hotplug and hotunplug support to tcm_vhost. You can create or delete a LUN in targetcli to hotplug or hotunplug a LUN in guest. Signed-off-by: Asias He

[PATCH v11 3/4] tcm_vhost: Add ioctl to get and set events missed flag

2013-04-25 Thread Asias He
Signed-off-by: Asias He as...@redhat.com --- drivers/vhost/tcm_vhost.c | 17 + drivers/vhost/tcm_vhost.h | 3 +++ 2 files changed, 20 insertions(+) diff --git a/drivers/vhost/tcm_vhost.c b/drivers/vhost/tcm_vhost.c index 5340fd7..07217d8 100644 --- a/drivers/vhost/tcm_vhost.c

[PATCH v11 4/4] tcm_vhost: Enable VIRTIO_SCSI_F_HOTPLUG

2013-04-25 Thread Asias He
Everything for hotplug is ready. Let's enable the feature bit. Signed-off-by: Asias He as...@redhat.com --- drivers/vhost/tcm_vhost.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/vhost/tcm_vhost.c b/drivers/vhost/tcm_vhost.c index 07217d8..1677238 100644

  1   2   3   4   5   >