Re: [Qemu-devel] [PATCH v11 6/6] virtio-balloon: VIRTIO_BALLOON_F_CMD_VQ

2017-06-13 Thread Wei Wang
On 06/12/2017 10:07 PM, Dave Hansen wrote: On 06/09/2017 03:41 AM, Wei Wang wrote: + for_each_populated_zone(zone) { + for (order = MAX_ORDER - 1; order > 0; order--) { + for (migratetype = 0; migratetype < MIGRATE

Re: [Qemu-devel] [virtio-dev] Re: [virtio-dev] Re: [PATCH v1] virtio-net: enable configurable tx queue size

2017-06-13 Thread Wei Wang
On 06/13/2017 05:04 PM, Jason Wang wrote: On 2017年06月13日 15:17, Wei Wang wrote: On 06/13/2017 02:29 PM, Jason Wang wrote: The issue is what if there's a mismatch of max #sgs between qemu and When the vhost backend is used, QEMU is not involved in the data path. The vhost backend dir

Re: [Qemu-devel] [virtio-dev] Re: [virtio-dev] Re: [PATCH v1] virtio-net: enable configurable tx queue size

2017-06-13 Thread Wei Wang
On 06/13/2017 02:31 PM, Jason Wang wrote: On 2017年06月13日 14:13, Wei Wang wrote: On 06/13/2017 11:59 AM, Jason Wang wrote: On 2017年06月13日 11:55, Jason Wang wrote: The issue is what if there's a mismatch of max #sgs between qemu and vhost? When the vhost backend is used, QEMU i

Re: [Qemu-devel] [virtio-dev] Re: [virtio-dev] Re: [PATCH v1] virtio-net: enable configurable tx queue size

2017-06-13 Thread Wei Wang
On 06/13/2017 02:29 PM, Jason Wang wrote: The issue is what if there's a mismatch of max #sgs between qemu and When the vhost backend is used, QEMU is not involved in the data path. The vhost backend directly gets what is offered by the guest from the vq. Why would there be a mismatch of max #sg

Re: [Qemu-devel] [virtio-dev] Re: [PATCH v1] virtio-net: enable configurable tx queue size

2017-06-12 Thread Wei Wang
On 06/13/2017 11:59 AM, Jason Wang wrote: On 2017年06月13日 11:55, Jason Wang wrote: The issue is what if there's a mismatch of max #sgs between qemu and vhost? When the vhost backend is used, QEMU is not involved in the data path. The vhost backend directly gets what is offered by the guest fro

Re: [Qemu-devel] [virtio-dev] Re: [PATCH v1] virtio-net: enable configurable tx queue size

2017-06-12 Thread Wei Wang
On 06/13/2017 11:55 AM, Jason Wang wrote: On 2017年06月13日 11:51, Wei Wang wrote: On 06/13/2017 11:19 AM, Jason Wang wrote: On 2017年06月13日 11:10, Wei Wang wrote: On 06/13/2017 04:43 AM, Michael S. Tsirkin wrote: On Mon, Jun 12, 2017 at 05:30:46PM +0800, Wei Wang wrote: Ping for comments

Re: [Qemu-devel] [virtio-dev] Re: [PATCH v1] virtio-net: enable configurable tx queue size

2017-06-12 Thread Wei Wang
On 06/13/2017 11:19 AM, Jason Wang wrote: On 2017年06月13日 11:10, Wei Wang wrote: On 06/13/2017 04:43 AM, Michael S. Tsirkin wrote: On Mon, Jun 12, 2017 at 05:30:46PM +0800, Wei Wang wrote: Ping for comments, thanks. This was only posted a week ago, might be a bit too short for some people

Re: [Qemu-devel] [virtio-dev] Re: [PATCH v1] virtio-net: enable configurable tx queue size

2017-06-12 Thread Wei Wang
On 06/13/2017 04:43 AM, Michael S. Tsirkin wrote: On Mon, Jun 12, 2017 at 05:30:46PM +0800, Wei Wang wrote: Ping for comments, thanks. This was only posted a week ago, might be a bit too short for some people. OK, sorry for the push. A couple of weeks is more reasonable before you ping

Re: [Qemu-devel] [PATCH v11 4/6] mm: function to offer a page block on the free list

2017-06-12 Thread Wei Wang
On 06/13/2017 04:54 AM, Dave Hansen wrote: On 06/12/2017 01:34 PM, Michael S. Tsirkin wrote: On Mon, Jun 12, 2017 at 09:42:36AM -0700, Dave Hansen wrote: On 06/12/2017 09:28 AM, Michael S. Tsirkin wrote: The hypervisor is going to throw away the contents of these pages, right? It should be ca

Re: [Qemu-devel] [virtio-dev] Re: [PATCH v1] virtio-net: enable configurable tx queue size

2017-06-12 Thread Wei Wang
Ping for comments, thanks. On 06/09/2017 11:00 AM, Wei Wang wrote: On 06/09/2017 03:01 AM, Michael S. Tsirkin wrote: On Wed, Jun 07, 2017 at 09:04:29AM +0800, Wei Wang wrote: On 06/05/2017 11:38 PM, Michael S. Tsirkin wrote: On Mon, Jun 05, 2017 at 04:57:29PM +0800, Wei Wang wrote: This

[Qemu-devel] [PATCH v11 6/6] virtio-balloon: VIRTIO_BALLOON_F_CMD_VQ

2017-06-09 Thread Wei Wang
used when the cmdq mechanism is enabled. 2) cmd VIRTIO_BALLOON_CMDQ_REPORT_UNUSED_PAGES: this command is used to report the guest unused pages to the host. Signed-off-by: Wei Wang --- drivers/virtio/virtio_balloon.c | 363 include/uapi/linux

[Qemu-devel] [PATCH v11 5/6] mm: export symbol of next_zone and first_online_pgdat

2017-06-09 Thread Wei Wang
This patch enables for_each_zone()/for_each_populated_zone() to be invoked by a kernel module. Signed-off-by: Wei Wang --- mm/mmzone.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mm/mmzone.c b/mm/mmzone.c index a51c0a6..08a2a3a 100644 --- a/mm/mmzone.c +++ b/mm/mmzone.c @@ -13,6 +13,7

[Qemu-devel] [PATCH v11 4/6] mm: function to offer a page block on the free list

2017-06-09 Thread Wei Wang
Add a function to find a page block on the free list specified by the caller. Pages from the page block may be used immediately after the function returns. The caller is responsible for detecting or preventing the use of such pages. Signed-off-by: Wei Wang Signed-off-by: Liang Li --- include

[Qemu-devel] [PATCH v11 2/6] virtio-balloon: coding format cleanup

2017-06-09 Thread Wei Wang
Clean up the comment format. Signed-off-by: Wei Wang --- drivers/virtio/virtio_balloon.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c index 4a9f307..ecb64e9 100644 --- a/drivers/virtio

[Qemu-devel] [PATCH v11 3/6] virtio-balloon: VIRTIO_BALLOON_F_PAGE_CHUNKS

2017-06-09 Thread Wei Wang
: Wei Wang Signed-off-by: Liang Li Suggested-by: Michael S. Tsirkin --- drivers/virtio/virtio_balloon.c | 418 +--- drivers/virtio/virtio_ring.c| 120 ++- include/linux/virtio.h | 7 + include/uapi/linux/virtio_balloon.h | 1

[Qemu-devel] [PATCH v11 1/6] virtio-balloon: deflate via a page list

2017-06-09 Thread Wei Wang
From: Liang Li This patch saves the deflated pages to a list, instead of the PFN array. Accordingly, the balloon_pfn_to_page() function is removed. Signed-off-by: Liang Li Signed-off-by: Michael S. Tsirkin Signed-off-by: Wei Wang --- drivers/virtio/virtio_balloon.c | 22

[Qemu-devel] [PATCH v11 0/6] Virtio-balloon Enhancement

2017-06-09 Thread Wei Wang
commands to report memory stats (replace the old statq mechanism) and report guest unused pages. Liang Li (1): virtio-balloon: deflate via a page list Wei Wang (5): virtio-balloon: coding format cleanup virtio-balloon: VIRTIO_BALLOON_F_PAGE_CHUNKS mm: function to offer a page block on the free

Re: [Qemu-devel] [PATCH v1] virtio-net: enable configurable tx queue size

2017-06-08 Thread Wei Wang
On 06/09/2017 03:01 AM, Michael S. Tsirkin wrote: On Wed, Jun 07, 2017 at 09:04:29AM +0800, Wei Wang wrote: On 06/05/2017 11:38 PM, Michael S. Tsirkin wrote: On Mon, Jun 05, 2017 at 04:57:29PM +0800, Wei Wang wrote: This patch enables the virtio-net tx queue size to be configurable between

Re: [Qemu-devel] [PATCH v1] virtio-net: enable configurable tx queue size

2017-06-06 Thread Wei Wang
On 06/05/2017 11:38 PM, Michael S. Tsirkin wrote: On Mon, Jun 05, 2017 at 04:57:29PM +0800, Wei Wang wrote: This patch enables the virtio-net tx queue size to be configurable between 256 and 1024 by the user. The queue size specified by the user should be power of 2. If "tx_queue_size&qu

Re: [Qemu-devel] [PATCH v1] virtio-net: enable configurable tx queue size

2017-06-05 Thread Wei Wang
On 06/05/2017 11:38 PM, Michael S. Tsirkin wrote: On Mon, Jun 05, 2017 at 04:57:29PM +0800, Wei Wang wrote: /* * Calculate the number of bytes up to and including the given 'field' of @@ -57,6 +62,8 @@ static VirtIOFeature feature_sizes[] = { .end = endof(struct virtio_

[Qemu-devel] [PATCH v1] virtio-net: enable configurable tx queue size

2017-06-05 Thread Wei Wang
24 and the VIRTIO_F_MAX_CHAIN_SIZE feature is not supported by the guest driver, the tx queue size will be reconfigured to be 512. Signed-off-by: Wei Wang RFC to v1 changes: 1) change VIRTIO_F_MAX_CHAIN_SIZE to be a common virtio feature (was virtio-net specific); 2) change the default tx queue

Re: [Qemu-devel] [virtio-dev] Re: [virtio-dev] Re: [virtio-dev] Re: [PATCH v2 00/16] Vhost-pci for inter-VM communication

2017-06-04 Thread Wei Wang
On 05/26/2017 01:57 AM, Michael S. Tsirkin wrote: I think that's a very valid point. Linux isn't currently optimized to handle packets in device BAR. There are several issues here and you do need to address them in the kernel, no way around that: 1. lots of drivers set protection to v

Re: [Qemu-devel] [virtio-dev] Re: [virtio-dev] Re: [PATCH v2 00/16] Vhost-pci for inter-VM communication

2017-05-25 Thread Wei Wang
On 05/25/2017 03:59 PM, Jason Wang wrote: On 2017年05月24日 16:31, Wei Wang wrote: On 05/24/2017 11:24 AM, Jason Wang wrote: On 2017年05月23日 18:48, Wei Wang wrote: On 05/23/2017 02:32 PM, Jason Wang wrote: On 2017年05月23日 13:47, Wei Wang wrote: On 05/23/2017 10:08 AM, Jason Wang wrote

Re: [Qemu-devel] [virtio-dev] Re: [PATCH RFC] virtio-net: enable configurable tx queue size

2017-05-25 Thread Wei Wang
On 05/25/2017 03:49 PM, Jason Wang wrote: On 2017年05月24日 16:18, Wei Wang wrote: On 05/24/2017 11:19 AM, Jason Wang wrote: On 2017年05月23日 18:36, Wei Wang wrote: On 05/23/2017 02:24 PM, Jason Wang wrote: On 2017年05月23日 13:15, Wei Wang wrote: On 05/23/2017 10:04 AM, Jason Wang wrote

Re: [Qemu-devel] [virtio-dev] Re: [virtio-dev] Re: [PATCH v2 00/16] Vhost-pci for inter-VM communication

2017-05-24 Thread Wei Wang
On 05/24/2017 11:24 AM, Jason Wang wrote: On 2017年05月23日 18:48, Wei Wang wrote: On 05/23/2017 02:32 PM, Jason Wang wrote: On 2017年05月23日 13:47, Wei Wang wrote: On 05/23/2017 10:08 AM, Jason Wang wrote: On 2017年05月22日 19:46, Wang, Wei W wrote: On Monday, May 22, 2017 10:28 AM, Jason

Re: [Qemu-devel] [virtio-dev] Re: [PATCH RFC] virtio-net: enable configurable tx queue size

2017-05-24 Thread Wei Wang
On 05/24/2017 11:19 AM, Jason Wang wrote: On 2017年05月23日 18:36, Wei Wang wrote: On 05/23/2017 02:24 PM, Jason Wang wrote: On 2017年05月23日 13:15, Wei Wang wrote: On 05/23/2017 10:04 AM, Jason Wang wrote: On 2017年05月22日 19:52, Wei Wang wrote: On 05/20/2017 04:42 AM, Michael S. Tsirkin

Re: [Qemu-devel] [virtio-dev] Re: [virtio-dev] Re: [PATCH v2 00/16] Vhost-pci for inter-VM communication

2017-05-23 Thread Wei Wang
On 05/20/2017 04:44 AM, Michael S. Tsirkin wrote: On Fri, May 19, 2017 at 05:00:37PM +0800, Wei Wang wrote: That being said, we compared to vhost-user, instead of vhost_net, because vhost-user is the one that is used in NFV, which we think is a major use case for vhost-pci. If this is true

Re: [Qemu-devel] [virtio-dev] Re: [virtio-dev] Re: [PATCH v2 00/16] Vhost-pci for inter-VM communication

2017-05-23 Thread Wei Wang
On 05/23/2017 02:32 PM, Jason Wang wrote: On 2017年05月23日 13:47, Wei Wang wrote: On 05/23/2017 10:08 AM, Jason Wang wrote: On 2017年05月22日 19:46, Wang, Wei W wrote: On Monday, May 22, 2017 10:28 AM, Jason Wang wrote: On 2017年05月19日 23:33, Stefan Hajnoczi wrote: On Fri, May 19, 2017 at 11

Re: [Qemu-devel] [virtio-dev] Re: [PATCH RFC] virtio-net: enable configurable tx queue size

2017-05-23 Thread Wei Wang
On 05/23/2017 02:24 PM, Jason Wang wrote: On 2017年05月23日 13:15, Wei Wang wrote: On 05/23/2017 10:04 AM, Jason Wang wrote: On 2017年05月22日 19:52, Wei Wang wrote: On 05/20/2017 04:42 AM, Michael S. Tsirkin wrote: On Fri, May 19, 2017 at 10:32:19AM +0800, Wei Wang wrote: This patch enables

Re: [Qemu-devel] [virtio-dev] Re: [virtio-dev] Re: [PATCH v2 00/16] Vhost-pci for inter-VM communication

2017-05-22 Thread Wei Wang
On 05/23/2017 10:08 AM, Jason Wang wrote: On 2017年05月22日 19:46, Wang, Wei W wrote: On Monday, May 22, 2017 10:28 AM, Jason Wang wrote: On 2017年05月19日 23:33, Stefan Hajnoczi wrote: On Fri, May 19, 2017 at 11:10:33AM +0800, Jason Wang wrote: On 2017年05月18日 11:03, Wei Wang wrote: On 05/17

Re: [Qemu-devel] [virtio-dev] Re: [PATCH RFC] virtio-net: enable configurable tx queue size

2017-05-22 Thread Wei Wang
On 05/23/2017 10:04 AM, Jason Wang wrote: On 2017年05月22日 19:52, Wei Wang wrote: On 05/20/2017 04:42 AM, Michael S. Tsirkin wrote: On Fri, May 19, 2017 at 10:32:19AM +0800, Wei Wang wrote: This patch enables the virtio-net tx queue size to be configurable between 256 (the default queue size

Re: [Qemu-devel] [virtio-dev] Re: [PATCH RFC] virtio-net: enable configurable tx queue size

2017-05-22 Thread Wei Wang
On 05/20/2017 04:42 AM, Michael S. Tsirkin wrote: On Fri, May 19, 2017 at 10:32:19AM +0800, Wei Wang wrote: This patch enables the virtio-net tx queue size to be configurable between 256 (the default queue size) and 1024 by the user. The queue size specified by the user should be power of 2

Re: [Qemu-devel] [virtio-dev] Re: [virtio-dev] Re: [PATCH v2 00/16] Vhost-pci for inter-VM communication

2017-05-19 Thread Wei Wang
On 05/19/2017 11:10 AM, Jason Wang wrote: On 2017年05月18日 11:03, Wei Wang wrote: On 05/17/2017 02:22 PM, Jason Wang wrote: On 2017年05月17日 14:16, Jason Wang wrote: On 2017年05月16日 15:12, Wei Wang wrote: Hi: Care to post the driver codes too? OK. It may take some time to clean up the

[Qemu-devel] [PATCH RFC] virtio-net: enable configurable tx queue size

2017-05-18 Thread Wei Wang
VIRTIO_NET_F_MAX_CHAIN_SIZE feature is not supported by the guest driver, the default tx queue size (256) will be used. Signed-off-by: Wei Wang --- hw/net/virtio-net.c | 71 +++-- include/hw/virtio/virtio-net.h | 1 + include/standard

Re: [Qemu-devel] [virtio-dev] Re: [PATCH v2 00/16] Vhost-pci for inter-VM communication

2017-05-17 Thread Wei Wang
On 05/17/2017 02:22 PM, Jason Wang wrote: On 2017年05月17日 14:16, Jason Wang wrote: On 2017年05月16日 15:12, Wei Wang wrote: Hi: Care to post the driver codes too? OK. It may take some time to clean up the driver code before post it out. You can first have a check of the draft at the

Re: [Qemu-devel] [virtio-dev] Re: [PATCH v2 00/16] Vhost-pci for inter-VM communication

2017-05-16 Thread Wei Wang
On 05/16/2017 02:46 PM, Jason Wang wrote: On 2017年05月12日 16:35, Wei Wang wrote: This patch series implements vhost-pci, which is a point-to-point based inter-vm communication solution. The QEMU side implementation includes the vhost-user extension, vhost-pci device emulation and management

Re: [Qemu-devel] [virtio-dev] Re: [PATCH] virtio-net: keep the packet layout intact

2017-05-15 Thread Wei Wang
On 05/16/2017 12:27 PM, Wei Wang wrote: On 05/15/2017 10:46 PM, Michael S. Tsirkin wrote: On Mon, May 15, 2017 at 05:29:15PM +0800, Wei Wang wrote: Ping for comments, thanks. On 05/11/2017 12:57 PM, Wei Wang wrote: The current implementation may change the packet layout when vnet_hdr needs

Re: [Qemu-devel] [virtio-dev] Re: [PATCH] virtio-net: keep the packet layout intact

2017-05-15 Thread Wei Wang
On 05/15/2017 10:46 PM, Michael S. Tsirkin wrote: On Mon, May 15, 2017 at 05:29:15PM +0800, Wei Wang wrote: Ping for comments, thanks. On 05/11/2017 12:57 PM, Wei Wang wrote: The current implementation may change the packet layout when vnet_hdr needs an endianness swap. The layout change

Re: [Qemu-devel] [PATCH] virtio-net: keep the packet layout intact

2017-05-15 Thread Wei Wang
Ping for comments, thanks. On 05/11/2017 12:57 PM, Wei Wang wrote: The current implementation may change the packet layout when vnet_hdr needs an endianness swap. The layout change causes one more iov to be added to the iov[] passed from the guest, which is a barrier to making the TX queue size

Re: [Qemu-devel] [virtio-dev] [PATCH v2 06/16] virtio: add inter-vm notification support

2017-05-14 Thread Wei Wang
On 05/12/2017 04:35 PM, Wei Wang wrote: This patch enables the assign of an already allocated eventfd to a notifier. In this case, QEMU creates a new eventfd for the notifier only when the notifier's fd equals to -1. Otherwise, it means that the notifier has been assigned a vaild fd. Signe

[Qemu-devel] [PATCH v2 13/16] vhost-pci-slave: add "reset_virtio"

2017-05-12 Thread Wei Wang
features supported by the remote virtio device. In this case, the remote virtio_device will be reset, and re-start the vhost-user protocol. Add the "reset_virtio" field as an indicator to the slave in this case. Signed-off-by: Wei Wang --- hw/net/vhost-pci-net.c

Re: [Qemu-devel] [PATCH v2 11/16] vhost-user: add asynchronous read for the vhost-user master

2017-05-12 Thread Wei Wang
On 05/12/2017 04:35 PM, Wei Wang wrote: Enable the vhost-user master to asynchronously receive messages from the slave. The vhost_user_asyn_read and vhost_user_can_read stub functions are defined for platforms that do not support the use of virtio. Signed-off-by: Wei Wang After the secondary

[Qemu-devel] [PATCH v2 12/16] vhost-user: handling VHOST_USER_SET_FEATURES

2017-05-12 Thread Wei Wang
If the featuer bits sent by the slave are not equal to the ones that were sent by the master, perform a reset of the master device. Signed-off-by: Wei Wang --- hw/net/vhost_net.c | 2 ++ hw/virtio/vhost-user.c | 24 hw/virtio/virtio-pci.c | 20

[Qemu-devel] [PATCH v2 16/16] vl: enable vhost-pci-slave

2017-05-12 Thread Wei Wang
Enable the use of vhost-pci. The init and cleanup stub functions are added for the platforms that do not support the use of virtio. Signed-off-by: Wei Wang --- hw/virtio/vhost-stub.c | 11 +++ vl.c | 24 2 files changed, 35 insertions(+) diff

[Qemu-devel] [PATCH v2 15/16] vhost-pci-net: tell the driver that it is ready to send packets

2017-05-12 Thread Wei Wang
If the remote device on the other side doesn't need to be reset, set bit 0 of the device status register to allow the driver to send out the packets. Signed-off-by: Wei Wang --- hw/net/vhost-pci-net.c | 20 1 file changed, 20 insertions(+) diff --git a/hw/net/vhos

[Qemu-devel] [PATCH v2 10/16] vhost-pci-net: send the negotiated feature bits to the master

2017-05-12 Thread Wei Wang
The slave device actively sends the negotiated feature bits to the master. Signed-off-by: Wei Wang --- hw/net/vhost-pci-net.c | 18 ++ hw/virtio/vhost-pci-slave.c | 22 ++ include/hw/virtio/vhost-pci-slave.h | 2 ++ 3 files changed, 42

[Qemu-devel] [PATCH v2 09/16] vhost-user: send VHOST_USER_SET_VHOST_PCI_START/STOP

2017-05-12 Thread Wei Wang
The master requests the slave to create or destroy a vhost-pci device. Signed-off-by: Wei Wang --- hw/net/vhost_net.c| 36 hw/virtio/vhost-user.c| 17 + include/hw/virtio/vhost-backend.h | 2 ++ include/net

[Qemu-devel] [PATCH v2 14/16] vhost-pci-slave: add support to delete a vhost-pci device

2017-05-12 Thread Wei Wang
Signed-off-by: Wei Wang --- hw/virtio/vhost-pci-slave.c | 41 + 1 file changed, 41 insertions(+) diff --git a/hw/virtio/vhost-pci-slave.c b/hw/virtio/vhost-pci-slave.c index a7d3c8d..cde122c 100644 --- a/hw/virtio/vhost-pci-slave.c +++ b/hw/virtio/vhost

[Qemu-devel] [PATCH v2 08/16] vhost-user: send guest physical address of virtqueues to the slave

2017-05-12 Thread Wei Wang
In the vhost-pci case, the slave needs the master side guest physical address, rather than the qemu virtual address. Signed-off-by: Wei Wang --- hw/virtio/vhost.c | 63 --- include/hw/virtio/vhost.h | 2 ++ 2 files changed, 45 insertions

[Qemu-devel] [PATCH v2 05/16] vhost-pci-net-pci: add vhost-pci-net-pci

2017-05-12 Thread Wei Wang
Signed-off-by: Wei Wang --- hw/net/Makefile.objs| 2 +- hw/net/vhost-pci-net.c | 6 hw/virtio/virtio-pci.c | 54 + hw/virtio/virtio-pci.h | 14 include/hw/pci/pci.h

[Qemu-devel] [PATCH v2 11/16] vhost-user: add asynchronous read for the vhost-user master

2017-05-12 Thread Wei Wang
Enable the vhost-user master to asynchronously receive messages from the slave. The vhost_user_asyn_read and vhost_user_can_read stub functions are defined for platforms that do not support the use of virtio. Signed-off-by: Wei Wang --- hw/virtio/Makefile.objs| 6 +++--- hw/virtio

[Qemu-devel] [PATCH v2 07/16] vhost-user: send device id to the slave

2017-05-12 Thread Wei Wang
Send virtio device id to the slave to indicate the device type. Signed-off-by: Wei Wang --- hw/net/vhost_net.c| 1 + hw/virtio/vhost-user.c| 20 include/hw/virtio/vhost.h | 1 + 3 files changed, 22 insertions(+) diff --git a/hw/net/vhost_net.c b/hw/net

[Qemu-devel] [PATCH v2 04/16] vhost-pci-net: add vhost-pci-net

2017-05-12 Thread Wei Wang
Add the vhost-pci-net device emulation. Signed-off-by: Wei Wang --- hw/net/vhost-pci-net.c | 248 + hw/virtio/vhost-pci-slave.c| 5 + include/hw/virtio/vhost-pci-net.h | 34 include/standard-headers/linux

[Qemu-devel] [PATCH v2 06/16] virtio: add inter-vm notification support

2017-05-12 Thread Wei Wang
This patch enables the assign of an already allocated eventfd to a notifier. In this case, QEMU creates a new eventfd for the notifier only when the notifier's fd equals to -1. Otherwise, it means that the notifier has been assigned a vaild fd. Signed-off-by: Wei Wang --- hw/net/vhost-pci-

[Qemu-devel] [PATCH v2 01/16] vhost-user: share the vhost-user protocol related structures

2017-05-12 Thread Wei Wang
Put the vhost-user protocol related data structures to vhost-user.h, so that they can be used in other implementations (e.g. a slave implementation). Signed-off-by: Wei Wang --- hw/virtio/vhost-user.c | 89 +--- include/hw/virtio/vhost-user.h | 93

[Qemu-devel] [PATCH v2 02/16] vl: add the vhost-pci-slave command line option

2017-05-12 Thread Wei Wang
=sock2,vhostforce -device virtio-net-pci,mac=52:54:00:00:00:02,netdev=net2 Signed-off-by: Wei Wang --- qemu-options.hx | 4 vl.c| 22 ++ 2 files changed, 26 insertions(+) diff --git a/qemu-options.hx b/qemu-options.hx index 99af8ed..a795850 100644 --- a/qemu

[Qemu-devel] [PATCH v2 03/16] vhost-pci-slave: create a vhost-user slave to support vhost-pci

2017-05-12 Thread Wei Wang
Signed-off-by: Wei Wang --- hw/virtio/Makefile.objs | 1 + hw/virtio/vhost-pci-slave.c | 597 include/hw/virtio/vhost-pci-slave.h | 61 include/hw/virtio/vhost-user.h | 13 + 4 files changed, 672 insertions(+) create mode

[Qemu-devel] [PATCH v2 00/16] Vhost-pci for inter-VM communication

2017-05-12 Thread Wei Wang
ost-pci-net ctrlq message format change; 3) patch re-org and code cleanup. Wei Wang (16): vhost-user: share the vhost-user protocol related structures vl: add the vhost-pci-slave command line option vhost-pci-slave: create a vhost-user slave to support vhost-pci vhost-pci-net: add vhost-

Re: [Qemu-devel] [virtio-dev] RE: virtio-net: configurable TX queue size

2017-05-10 Thread Wei Wang
On 05/11/2017 04:07 AM, Michael S. Tsirkin wrote: On Wed, May 10, 2017 at 05:52:23PM +0800, Wei Wang wrote: On 05/07/2017 12:39 PM, Wang, Wei W wrote: On 05/06/2017 04:37 AM, Michael S. Tsirkin wrote: On Fri, May 05, 2017 at 10:27:13AM +0800, Jason Wang wrote: On 2017年05月04日 18:58, Wang, Wei

[Qemu-devel] [PATCH] virtio-net: keep the packet layout intact

2017-05-10 Thread Wei Wang
implementation to remain the packet layout intact. In this case, the number of iov[] passed to writev will be equal to the number obtained from the guest. Signed-off-by: Wei Wang --- hw/net/virtio-net.c | 29 ++--- 1 file changed, 14 insertions(+), 15 deletions(-) diff

Re: [Qemu-devel] virtio-net: configurable TX queue size

2017-05-10 Thread Wei Wang
On 05/10/2017 05:00 PM, Jason Wang wrote: On 2017年05月07日 12:39, Wang, Wei W wrote: On 05/06/2017 04:37 AM, Michael S. Tsirkin wrote: On Fri, May 05, 2017 at 10:27:13AM +0800, Jason Wang wrote: On 2017年05月04日 18:58, Wang, Wei W wrote: Hi, I want to re-open the discussion left long time ago

Re: [Qemu-devel] [virtio-dev] RE: virtio-net: configurable TX queue size

2017-05-10 Thread Wei Wang
On 05/07/2017 12:39 PM, Wang, Wei W wrote: On 05/06/2017 04:37 AM, Michael S. Tsirkin wrote: On Fri, May 05, 2017 at 10:27:13AM +0800, Jason Wang wrote: On 2017年05月04日 18:58, Wang, Wei W wrote: Hi, I want to re-open the discussion left long time ago: https://lists.gnu.org/archive/html/qemu-d

Re: [Qemu-devel] [virtio-dev] Re: [PATCH v9 2/5] virtio-balloon: VIRTIO_BALLOON_F_BALLOON_CHUNKS

2017-05-08 Thread Wei Wang
On 05/09/2017 01:40 AM, Michael S. Tsirkin wrote: On Sun, May 07, 2017 at 04:19:28AM +, Wang, Wei W wrote: On 05/06/2017 06:26 AM, Michael S. Tsirkin wrote: On Thu, Apr 27, 2017 at 02:31:49PM +0800, Wei Wang wrote: On 04/27/2017 07:20 AM, Michael S. Tsirkin wrote: On Wed, Apr 26, 2017 at

Re: [Qemu-devel] [virtio-dev] Vhost-pci RFC2.0

2017-05-07 Thread Wei Wang
On 05/05/2017 05:18 PM, Jason Wang wrote: On 2017年05月05日 14:18, Wei Wang wrote: On 05/05/2017 12:05 PM, Jason Wang wrote: On 2017年04月19日 14:38, Wang, Wei W wrote: Hi, We made some design changes to the original vhost-pci design, and want to open a discussion about the latest design

Re: [Qemu-devel] [virtio-dev] virtio-net: configurable TX queue size

2017-05-07 Thread Wei Wang
On 05/07/2017 08:02 PM, Yan Vugenfirer wrote: On 5 May 2017, at 12:20, Jason Wang wrote: On 2017年05月05日 13:53, Wei Wang wrote: On 05/05/2017 10:27 AM, Jason Wang wrote: On 2017年05月04日 18:58, Wang, Wei W wrote: Hi, I want to re-open the discussion left long time ago: https

Re: [Qemu-devel] [virtio-dev] Vhost-pci RFC2.0

2017-05-04 Thread Wei Wang
On 05/05/2017 12:05 PM, Jason Wang wrote: On 2017年04月19日 14:38, Wang, Wei W wrote: Hi, We made some design changes to the original vhost-pci design, and want to open a discussion about the latest design (labelled 2.0) and its extension (2.1). 2.0 design: One VM shares the entire memory of a

Re: [Qemu-devel] [virtio-dev] Re: virtio-net: configurable TX queue size

2017-05-04 Thread Wei Wang
On 05/05/2017 10:27 AM, Jason Wang wrote: On 2017年05月04日 18:58, Wang, Wei W wrote: Hi, I want to re-open the discussion left long time ago: https://lists.gnu.org/archive/html/qemu-devel/2015-11/msg06194.html , and discuss the possibility of changing the hardcoded (256) TX queue size to be co

[Qemu-devel] [PATCH v10 6/6] virtio-balloon: VIRTIO_BALLOON_F_MISC_VQ

2017-05-04 Thread Wei Wang
offers to the device the guest unused pages. Tests have shown that skipping the transfer of unused pages of a 32G idle guest can get the live migration time reduced to 1/8. Signed-off-by: Wei Wang Signed-off-by: Liang Li --- drivers/virtio/virtio_balloon.c | 299

[Qemu-devel] [PATCH v10 3/6] virtio-balloon: VIRTIO_BALLOON_F_PAGE_CHUNKS

2017-05-04 Thread Wei Wang
address translation and madvise() in chunks rather than page by page. With this new feature, the above ballooning process takes ~590ms resulting in an improvement of ~85%. TODO: optimize stage 1) by allocating/freeing a chunk of pages instead of a single page each time. Signed-off-by: Wei Wang Signed

[Qemu-devel] [PATCH v10 4/6] mm: function to offer a page block on the free list

2017-05-04 Thread Wei Wang
Add a function to find a page block on the free list specified by the caller. Pages from the page block may be used immediately after the function returns. The caller is responsible for detecting or preventing the use of such pages. Signed-off-by: Wei Wang Signed-off-by: Liang Li --- include

[Qemu-devel] [PATCH v10 5/6] mm: export symbol of next_zone and first_online_pgdat

2017-05-04 Thread Wei Wang
This patch enables for_each_zone()/for_each_populated_zone() to be invoked by a kernel module. Signed-off-by: Wei Wang --- mm/mmzone.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mm/mmzone.c b/mm/mmzone.c index a51c0a6..08a2a3a 100644 --- a/mm/mmzone.c +++ b/mm/mmzone.c @@ -13,6 +13,7

[Qemu-devel] [PATCH v10 0/6] Extend virtio-balloon for fast (de)inflating & fast live migration

2017-05-04 Thread Wei Wang
her in the previous implementation; 2) Simpler function to get the free page block. v7->v8: 1) Use only one chunk format, instead of two. 2) re-write the virtio-balloon implementation patch. 3) commit changes 4) patch re-org Liang Li (1): virtio-balloon: deflate via a page list Wei Wang (5):

[Qemu-devel] [PATCH v10 1/6] virtio-balloon: deflate via a page list

2017-05-04 Thread Wei Wang
From: Liang Li This patch saves the deflated pages to a list, instead of the PFN array. Accordingly, the balloon_pfn_to_page() function is removed. Signed-off-by: Liang Li Signed-off-by: Michael S. Tsirkin Signed-off-by: Wei Wang --- drivers/virtio/virtio_balloon.c | 22

[Qemu-devel] [PATCH v10 2/6] virtio-balloon: coding format cleanup

2017-05-04 Thread Wei Wang
Clean up the comment format. Signed-off-by: Wei Wang --- drivers/virtio/virtio_balloon.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c index 4a9f307..ecb64e9 100644 --- a/drivers/virtio

Re: [Qemu-devel] [virtio-dev] Vhost-pci RFC2.0

2017-05-02 Thread Wei Wang
On 05/02/2017 08:48 PM, Stefan Hajnoczi wrote: On Thu, Apr 20, 2017 at 01:51:24PM +0800, Wei Wang wrote: On 04/19/2017 11:24 PM, Stefan Hajnoczi wrote: On Wed, Apr 19, 2017 at 11:42 AM, Wei Wang wrote: On 04/19/2017 05:57 PM, Stefan Hajnoczi wrote: On Wed, Apr 19, 2017 at 06:38:11AM +

Re: [Qemu-devel] [PATCH v9 5/5] virtio-balloon: VIRTIO_BALLOON_F_MISC_VQ

2017-04-26 Thread Wei Wang
On 04/14/2017 01:08 AM, Michael S. Tsirkin wrote: On Thu, Apr 13, 2017 at 05:35:08PM +0800, Wei Wang wrote: Add a new vq, miscq, to handle miscellaneous requests between the device and the driver. This patch implemnts the VIRTIO_BALLOON_MISCQ_INQUIRE_UNUSED_PAGES implements request sent

Re: [Qemu-devel] [virtio-dev] Re: [PATCH v9 2/5] virtio-balloon: VIRTIO_BALLOON_F_BALLOON_CHUNKS

2017-04-26 Thread Wei Wang
On 04/27/2017 07:20 AM, Michael S. Tsirkin wrote: On Wed, Apr 26, 2017 at 11:03:34AM +, Wang, Wei W wrote: Hi Michael, could you please give some feedback? I'm sorry, I'm not sure feedback on what you are requesting. Oh, just some trivial things (e.g. use a field in the header, hdr->chunks

Re: [Qemu-devel] [virtio-comment] Re: [RFC 1/2] spec/vhost-user: Introduce secondary channel for slave initiated requests

2017-04-26 Thread Wei Wang
On 04/25/2017 07:55 PM, Maxime Coquelin wrote: Hi Wei, On 04/24/2017 10:05 AM, Wei Wang wrote: On 04/14/2017 05:03 PM, Marc-André Lureau wrote: Hi On Tue, Apr 11, 2017 at 5:53 PM Maxime Coquelin mailto:maxime.coque...@redhat.com>> wrote: Hi Marc-André, On 04/11/2017 03

Re: [Qemu-devel] [virtio-comment] Re: [RFC 1/2] spec/vhost-user: Introduce secondary channel for slave initiated requests

2017-04-24 Thread Wei Wang
On 04/14/2017 05:03 PM, Marc-André Lureau wrote: Hi On Tue, Apr 11, 2017 at 5:53 PM Maxime Coquelin mailto:maxime.coque...@redhat.com>> wrote: Hi Marc-André, On 04/11/2017 03:06 PM, Marc-André Lureau wrote: > Hi > > On Tue, Apr 11, 2017 at 12:10 PM Maxime Coquelin > m

Re: [Qemu-devel] [virtio-dev] Re: Vhost-pci RFC2.0

2017-04-20 Thread Wei Wang
On 04/20/2017 03:05 PM, Jan Kiszka wrote: On 2017-04-20 08:51, Wei Wang wrote: On 04/19/2017 10:52 PM, Jan Kiszka wrote: On 2017-04-19 16:33, Wang, Wei W wrote: On 04/19/2017 07:21 PM, Jan Kiszka wrote: On 2017-04-19 13:11, Wei Wang wrote: On 04/19/2017 06:36 PM, Jan Kiszka wrote: On 2017

Re: [Qemu-devel] [virtio-dev] Re: Vhost-pci RFC2.0

2017-04-19 Thread Wei Wang
On 04/19/2017 10:52 PM, Jan Kiszka wrote: On 2017-04-19 16:33, Wang, Wei W wrote: On 04/19/2017 07:21 PM, Jan Kiszka wrote: On 2017-04-19 13:11, Wei Wang wrote: On 04/19/2017 06:36 PM, Jan Kiszka wrote: On 2017-04-19 12:02, Wei Wang wrote: The design presented here intends to use only one

Re: [Qemu-devel] [virtio-dev] Vhost-pci RFC2.0

2017-04-19 Thread Wei Wang
On 04/19/2017 11:24 PM, Stefan Hajnoczi wrote: On Wed, Apr 19, 2017 at 11:42 AM, Wei Wang wrote: On 04/19/2017 05:57 PM, Stefan Hajnoczi wrote: On Wed, Apr 19, 2017 at 06:38:11AM +, Wang, Wei W wrote: We made some design changes to the original vhost-pci design, and want to open a

Re: [Qemu-devel] [virtio-dev] Re: Vhost-pci RFC2.0

2017-04-19 Thread Wei Wang
On 04/19/2017 06:36 PM, Jan Kiszka wrote: On 2017-04-19 12:02, Wei Wang wrote: The design presented here intends to use only one BAR to expose both TX and RX. The two VMs share an intermediate memory here, why couldn't we give the same permission to TX and RX? For security and/or s

Re: [Qemu-devel] [virtio-dev] Vhost-pci RFC2.0

2017-04-19 Thread Wei Wang
On 04/19/2017 05:57 PM, Stefan Hajnoczi wrote: On Wed, Apr 19, 2017 at 06:38:11AM +, Wang, Wei W wrote: We made some design changes to the original vhost-pci design, and want to open a discussion about the latest design (labelled 2.0) and its extension (2.1). 2.0 design: One VM shares the en

Re: [Qemu-devel] [virtio-dev] Re: Vhost-pci RFC2.0

2017-04-19 Thread Wei Wang
On 04/19/2017 05:31 PM, Jan Kiszka wrote: On 2017-04-19 11:09, Wei Wang wrote: On 04/19/2017 04:49 PM, Jan Kiszka wrote: On 2017-04-19 10:42, Wei Wang wrote: On 04/19/2017 03:35 PM, Jan Kiszka wrote: On 2017-04-19 08:38, Wang, Wei W wrote: Hi, We made some design changes to the original

Re: [Qemu-devel] [virtio-dev] Re: Vhost-pci RFC2.0

2017-04-19 Thread Wei Wang
On 04/19/2017 04:49 PM, Jan Kiszka wrote: On 2017-04-19 10:42, Wei Wang wrote: On 04/19/2017 03:35 PM, Jan Kiszka wrote: On 2017-04-19 08:38, Wang, Wei W wrote: Hi, We made some design changes to the original vhost-pci design, and want to open a discussion about the latest design (labelled

Re: [Qemu-devel] Vhost-pci RFC2.0

2017-04-19 Thread Wei Wang
On 04/19/2017 03:35 PM, Jan Kiszka wrote: On 2017-04-19 08:38, Wang, Wei W wrote: Hi, We made some design changes to the original vhost-pci design, and want to open a discussion about the latest design (labelled 2.0) and its extension (2.1). 2.0 design: One VM shares the entire memory of ano

Re: [Qemu-devel] Vhost-pci RFC2.0

2017-04-19 Thread Wei Wang
On 04/19/2017 03:31 PM, Marc-André Lureau wrote: Hi On Wed, Apr 19, 2017 at 10:38 AM Wang, Wei W > wrote: Hi, We made some design changes to the original vhost-pci design, and want to open a discussion about the latest design (labelled 2.0) and its

Re: [Qemu-devel] [virtio-dev] Re: [PATCH v9 2/5] virtio-balloon: VIRTIO_BALLOON_F_BALLOON_CHUNKS

2017-04-16 Thread Wei Wang
On 04/15/2017 05:38 AM, Michael S. Tsirkin wrote: On Fri, Apr 14, 2017 at 04:37:52PM +0800, Wei Wang wrote: On 04/14/2017 12:34 AM, Michael S. Tsirkin wrote: On Thu, Apr 13, 2017 at 05:35:05PM +0800, Wei Wang wrote: So we don't need the bitmap to talk to host, it is just a data structu

Re: [Qemu-devel] [PATCH v9 3/5] mm: function to offer a page block on the free list

2017-04-14 Thread Wei Wang
On 04/14/2017 10:58 AM, Matthew Wilcox wrote: On Fri, Apr 14, 2017 at 10:30:27AM +0800, Wei Wang wrote: OK. What do you think if we add this: #if defined(CONFIG_VIRTIO_BALLOON) || defined(CONFIG_VIRTIO_BALLOON_MODULE) That's spelled "IS_ENABLED(CONFIG_VIRTIO_BALLOON)", FYI.

Re: [Qemu-devel] [virtio-dev] Re: [PATCH v9 2/5] virtio-balloon: VIRTIO_BALLOON_F_BALLOON_CHUNKS

2017-04-14 Thread Wei Wang
On 04/14/2017 12:34 AM, Michael S. Tsirkin wrote: On Thu, Apr 13, 2017 at 05:35:05PM +0800, Wei Wang wrote: So we don't need the bitmap to talk to host, it is just a data structure we chose to maintain lists of pages, right? Right. bitmap is the way to gather pages to chunk. It's o

Re: [Qemu-devel] [PATCH v9 3/5] mm: function to offer a page block on the free list

2017-04-13 Thread Wei Wang
On 04/14/2017 04:02 AM, Andrew Morton wrote: On Thu, 13 Apr 2017 17:35:06 +0800 Wei Wang wrote: Add a function to find a page block on the free list specified by the caller. Pages from the page block may be used immediately after the function returns. The caller is responsible for detecting

Re: [Qemu-devel] [PATCH v9 0/5] Extend virtio-balloon for fast (de)inflating & fast live migration

2017-04-13 Thread Wei Wang
On 04/14/2017 09:50 AM, Michael S. Tsirkin wrote: On Thu, Apr 13, 2017 at 01:44:11PM -0700, Matthew Wilcox wrote: On Thu, Apr 13, 2017 at 05:35:03PM +0800, Wei Wang wrote: 2) transfer the guest unused pages to the host so that they can be skipped to migrate in live migration. I don&#

Re: [Qemu-devel] [PATCH kernel v8 3/4] mm: add inerface to offer info about unused pages

2017-04-13 Thread Wei Wang
On 03/17/2017 05:28 AM, Andrew Morton wrote: On Thu, 16 Mar 2017 15:08:46 +0800 Wei Wang wrote: From: Liang Li This patch adds a function to provides a snapshot of the present system unused pages. An important usage of this function is to provide the unsused pages to the Live migration

[Qemu-devel] [PATCH v9 5/5] virtio-balloon: VIRTIO_BALLOON_F_MISC_VQ

2017-04-13 Thread Wei Wang
shown that skipping the transfer of unused pages of a 32G guest can get the live migration time reduced to 1/8. Signed-off-by: Wei Wang Signed-off-by: Liang Li --- drivers/virtio/virtio_balloon.c | 209 +--- include/uapi/linux/virtio_balloon.h | 8 ++ 2

[Qemu-devel] [PATCH v9 3/5] mm: function to offer a page block on the free list

2017-04-13 Thread Wei Wang
Add a function to find a page block on the free list specified by the caller. Pages from the page block may be used immediately after the function returns. The caller is responsible for detecting or preventing the use of such pages. Signed-off-by: Wei Wang Signed-off-by: Liang Li --- include

[Qemu-devel] [PATCH v9 1/5] virtio-balloon: deflate via a page list

2017-04-13 Thread Wei Wang
From: Liang Li This patch saves the deflated pages to a list, instead of the PFN array. Accordingly, the balloon_pfn_to_page() function is removed. Signed-off-by: Liang Li Signed-off-by: Michael S. Tsirkin Signed-off-by: Wei Wang --- drivers/virtio/virtio_balloon.c | 22

[Qemu-devel] [PATCH v9 4/5] mm: export symbol of next_zone and first_online_pgdat

2017-04-13 Thread Wei Wang
This patch enables for_each_zone()/for_each_populated_zone() to be invoked by a kernel module. Signed-off-by: Wei Wang --- mm/mmzone.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mm/mmzone.c b/mm/mmzone.c index 5652be8..e14b7ec 100644 --- a/mm/mmzone.c +++ b/mm/mmzone.c @@ -13,6 +13,7

[Qemu-devel] [PATCH v9 2/5] virtio-balloon: VIRTIO_BALLOON_F_BALLOON_CHUNKS

2017-04-13 Thread Wei Wang
process takes ~590ms resulting in an improvement of ~85%. TODO: optimize stage 1) by allocating/freeing a chunk of pages instead of a single page each time. Signed-off-by: Wei Wang Signed-off-by: Liang Li Suggested-by: Michael S. Tsirkin --- drivers/virtio/virtio_balloon.c | 384

[Qemu-devel] [PATCH v9 0/5] Extend virtio-balloon for fast (de)inflating & fast live migration

2017-04-13 Thread Wei Wang
virtio-balloon: deflate via a page list Wei Wang (4): virtio-balloon: VIRTIO_BALLOON_F_BALLOON_CHUNKS mm: function to offer a page block on the free list mm: export symbol of next_zone and first_online_pgdat virtio-balloon: VIRTIO_BALLOON_F_MISC_VQ drivers/virtio/virtio_balloon.c

<    1   2   3   4   5   6   7   >