[Qemu-devel] [ RFC Patch v6 3/3] virtio-net rsc: add 2 new rsc information fields to 'virtio_net_hdr'

2016-05-28 Thread wexu
From: Wei Xu Field 'coalesced' is to indicate how many packets are coalesced and field 'dup_ack' is how many duplicate acks are merged, guest driver can use these information to notify what's the exact scene of original traffic over the networks. Signed-off-by: Wei Xu

[Qemu-devel] [ RFC Patch v6 1/3] virtio-net rsc: support coalescing ipv4 tcp traffic

2016-05-28 Thread wexu
From: Wei Xu All the data packets in a tcp connection will be cached to a big buffer in every receive interval, and will be sent out via a timer, the 'virtio_net_rsc_timeout' controls the interval, the value will influent the performance and response of tcp connection extremely,

[Qemu-devel] [ RFC Patch v6 2/3] virtio-net rsc: support coalescing ipv6 tcp traffic

2016-05-28 Thread wexu
From: Wei Xu Most stuffs are like ipv4 2 differences between ipv4 and ipv6. 1. Fragment length in ipv4 header includes itself, while it's not included for ipv6, thus means ipv6 can carry a real '65535' payload. 2. IPv6 header does not need calculate header checksum.

[Qemu-devel] [ RFC Patch v6 0/2] Support Receive-Segment-Offload(RSC) for WHQL

2016-05-28 Thread wexu
From: Wei Xu Changes in V6: - Sync upstream code - Split new fields in 'virtio_net_hdr' to a seperate patch - Remove feature bit code, replace it with a command line parameter 'guest_rsc' which is turned off by default. Changes in V5: - Passed all IPv4/6 test cases - Add new

[Qemu-devel] [RFC Patch v2 07/10] virtio-net rsc: Checking TCP flag and drain specific connection packets

2016-01-31 Thread wexu
From: Wei Xu Normally it includes 2 typical way to handle a TCP control flag, bypass and finalize, bypass means should be sent out directly, and finalize means the packets should also be bypassed, and this should be done after searching for the same connection packets in the

[Qemu-devel] [RFC Patch v2 05/10] virtio-net rsc: Create timer to drain the packets from the cache pool

2016-01-31 Thread wexu
From: Wei Xu The timer will only be triggered if the packets pool is not empty, and it'll drain off all the cached packets, this is to reduce the delay to upper layer protocol stack. Signed-off-by: Wei Xu --- hw/net/virtio-net.c | 38

[Qemu-devel] [RFC Patch v2 09/10] virtio-net rsc: Add IPv6 support

2016-01-31 Thread wexu
From: Wei Xu A few more stuffs should be included to support this 1. Corresponding chain lookup 2. Coalescing callback for the protocol chain 3. Filter & Sanity Check. Signed-off-by: Wei Xu --- hw/net/virtio-net.c | 104

[Qemu-devel] [RFC Patch v2 08/10] virtio-net rsc: Sanity check & More bypass cases check

2016-01-31 Thread wexu
From: Wei Xu More general exception cases check 1. Incorrect version in IP header 2. IP options & IP fragment 3. Not a TCP packets 4. Sanity size check to prevent buffer overflow attack. Signed-off-by: Wei Xu --- hw/net/virtio-net.c | 44

[Qemu-devel] [RFC Patch v2 06/10] virtio-net rsc: IPv4 checksum

2016-01-31 Thread wexu
From: Wei Xu If a field in the IPv4 header is modified, then the checksum have to be recalculated before sending it out. Signed-off-by: Wei Xu --- hw/net/virtio-net.c | 19 +++ 1 file changed, 19 insertions(+) diff --git

[Qemu-devel] [RFC Patch v2 04/10] virtio-net rsc: Detailed IPv4 and General TCP data coalescing

2016-01-31 Thread wexu
From: Wei Xu Since this feature also needs to support IPv6, and there are some protocol specific differences difference for IPv4/6 in the header, so try to make the interface to be general. IPv4/6 should set up both the new and old IP/TCP header before invoking

[Qemu-devel] [RFC Patch v2 02/10] virtio-net rsc: Initilize & Cleanup

2016-01-31 Thread wexu
From: Wei Xu The chain list is initialized when the device is getting realized, and the entry of the chain will be inserted dynamically according to protocol type of the network traffic. All the buffered packets and chain will be destroyed when the device is

[Qemu-devel] [RFC v2 0/10] Support Receive-Segment-Offload(RSC) for WHQL test of Window guest

2016-01-31 Thread wexu
From: Wei Xu Patch v2 add detailed commit log. This patch is to support WHQL test for Windows guest, while this feature also benifits other guest works as a kernel 'gro' like feature with userspace implementation. Feature information:

[Qemu-devel] [RFC Patch v2 03/10] virtio-net rsc: Chain Lookup, Packet Caching and Framework of IPv4

2016-01-31 Thread wexu
From: Wei Xu Upon a packet is arriving, a corresponding chain will be selected or created, or be bypassed if it's not an IPv4 packets. The callback in the chain will be invoked to call the real coalescing. Since the coalescing is based on the TCP connection,

[Qemu-devel] [RFC Patch v2 01/10] virtio-net rsc: Data structure, 'Segment', 'Chain' and 'Status'

2016-01-31 Thread wexu
From: Wei Xu Segment is the coalesced packets in a connection. Status is to indicate the status while do coalescing, such as if a packet is bypassed or coalesced, etc. Chain is used to save the segments of different protocols in a VirtIONet instance. A timer

[Qemu-devel] [RFC Patch v2 10/10] virtio-net rsc: Add Receive Segment Coalesce statistics

2016-01-31 Thread wexu
From: Wei Xu Add statistics to log what happened during the process. Signed-off-by: Wei Xu --- hw/net/virtio-net.c| 49 +++--- include/hw/virtio/virtio.h | 33 +++ 2 files changed, 79

[Qemu-devel] [RFC Patch 07/10] TCP control packet handling.

2016-01-25 Thread wexu
From: Wei Xu All the 'SYN' packets will be bypassed, and flag with 'FIN/RST' set will signal all the cached packets in the same connection to be purged, this is to avoid out of data on the line. Signed-off-by: Wei Xu --- hw/net/virtio-net.c | 66

[Qemu-devel] [RFC Patch 08/10] Sanity check & More bypass cases check.

2016-01-25 Thread wexu
1. IP options & IP fragment should be bypassed. 2. Sanity size check to prevent buffer overflow attack. Signed-off-by: Wei Xu --- hw/net/virtio-net.c | 44 1 file changed, 44 insertions(+) diff --git a/hw/net/virtio-net.c

[Qemu-devel] [RFC Patch 04/10] Tcp general data coalescing, the parameters is a little bit horrible, it's complicated to read, should can be optimized later.

2016-01-25 Thread wexu
Signed-off-by: Wei Xu --- hw/net/virtio-net.c | 125 +++- 1 file changed, 124 insertions(+), 1 deletion(-) diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index 7a6cd4c..d005a56 100644 --- a/hw/net/virtio-net.c +++

[Qemu-devel] [RFC Patch 03/10] Chain lookup and packets caching.

2016-01-25 Thread wexu
Looking up chain by protocol and invoke coalescing callback, cache the packet if can't handle it. Signed-off-by: Wei Xu --- hw/net/virtio-net.c | 171 +++- 1 file changed, 170 insertions(+), 1 deletion(-) diff --git

[Qemu-devel] [RFC Patch 06/10] IPv4 checksum.

2016-01-25 Thread wexu
Signed-off-by: Wei Xu --- hw/net/virtio-net.c | 19 +++ 1 file changed, 19 insertions(+) diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index 8da2815..1ca3dd5 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c @@ -1630,6 +1630,18 @@ static int

[Qemu-devel] [RFC Patch 02/10] Initilize & Cleanup.

2016-01-25 Thread wexu
Signed-off-by: Wei Xu --- hw/net/virtio-net.c| 22 ++ include/hw/virtio/virtio-net.h | 1 + 2 files changed, 23 insertions(+) diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index a877614..4e9458e 100644 --- a/hw/net/virtio-net.c +++

[Qemu-devel] [RFC 0/10] Support Receive-Segment-Offload(RSC) for WHQL test of Window guest

2016-01-25 Thread wexu
From: Wei Xu This patch is to support WHQL test for Windows guest, while this feature also benifits other guest works as a kernel 'gro' like feature with userspace implementation. Feature information: http://msdn.microsoft.com/en-us/library/windows/hardware/jj853324 Both

[Qemu-devel] [RFC Patch 01/10] 'Segment', 'Chain' and 'Status' enumeration data structure.

2016-01-25 Thread wexu
Signed-off-by: Wei Xu --- include/hw/virtio/virtio.h | 32 1 file changed, 32 insertions(+) diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h index 205fadf..1383220 100644 --- a/include/hw/virtio/virtio.h +++

[Qemu-devel] [RFC Patch 05/10] The draining timer, create a timer to purge the packets from the cached pool.

2016-01-25 Thread wexu
Signed-off-by: Wei Xu --- hw/net/virtio-net.c | 38 ++ 1 file changed, 38 insertions(+) diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index d005a56..8da2815 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c @@ -48,12 +48,17

[Qemu-devel] [RFC Patch 09/10] IPv6 support.

2016-01-25 Thread wexu
1. Callback for IPv6 2. Filter & Sanity Check. Signed-off-by: Wei Xu --- hw/net/virtio-net.c | 104 +++- 1 file changed, 102 insertions(+), 2 deletions(-) diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index

[Qemu-devel] [RFC Patch 10/10] Statistics.

2016-01-25 Thread wexu
From: Wei Xu Signed-off-by: Wei Xu --- hw/net/virtio-net.c| 49 +++--- include/hw/virtio/virtio.h | 35 + 2 files changed, 81 insertions(+), 3 deletions(-) diff --git

[Qemu-devel] [ Patch 1/2] virtio-net rsc: support coalescing ipv4 tcp traffic

2016-03-15 Thread wexu
From: Wei Xu All the data packets in a tcp connection will be cached to a big buffer in every receive interval, and will be sent out via a timer, the 'virtio_net_rsc_timeout' controls the interval, the value will influent the performance and response of tcp connection extremely,

[Qemu-devel] [ Patch 0/2] Support Receive-Segment-Offload(RSC) for WHQL test of Window guest

2016-03-15 Thread wexu
From: Wei Xu Fixed issues based on rfc patch v2: 1. Removed big param list, replace it with 'NetRscUnit' 2. Different virtio header size 3. Modify callback function to direct call. 4. Needn't check the failure of g_malloc() 5. Other code format adjustment, macro naming, etc

[Qemu-devel] [ Patch 2/2] virtio-net rsc: support coalescing ipv6 tcp traffic

2016-03-15 Thread wexu
From: Wei Xu Most things like ipv4 except there is a significant difference between ipv4 and ipv6, the fragment lenght in ipv4 header includes itself, while it's not included for ipv6, thus means ipv6 can carry a real '65535' unit. Signed-off-by: Wei Xu ---

[Qemu-devel] [ RFC Patch v4 0/3] Support Receive-Segment-Offload(RSC) for WHQL

2016-04-03 Thread wexu
From: Wei Xu Changes in V4: - Add new host feature bit - Replace using fixed header lenght with dynamic header lenght in VirtIONet - Change ip/ip6 header union in NetRscUnit to void* pointer - Add macro prefix, adjust code indent, etc. Changes in V3: - Removed big param list,

[Qemu-devel] [ RFC Patch v4 2/3] virtio-net rsc: support coalescing ipv4 tcp traffic

2016-04-03 Thread wexu
From: Wei Xu All the data packets in a tcp connection will be cached to a big buffer in every receive interval, and will be sent out via a timer, the 'virtio_net_rsc_timeout' controls the interval, the value will influent the performance and response of tcp connection extremely,

[Qemu-devel] [ RFC Patch v4 1/3] virtio-net rsc: add a new host offload(rsc) feature bit

2016-04-03 Thread wexu
From: Wei Xu A new feature bit 'VIRTIO_NET_F_GUEST_RSC' is introduced to support WHQL Receive-Segment-Offload test, this feature will coalesce tcp packets in IPv4/6 for userspace virtio-net driver. This feature can be enabled either by 'ACK' the feature when loading the driver

[Qemu-devel] [ RFC Patch v4 3/3] virtio-net rsc: support coalescing ipv6 tcp traffic

2016-04-03 Thread wexu
From: Wei Xu Most things like ipv4 except there is a significant difference between ipv4 and ipv6, the fragment lenght in ipv4 header includes itself, while it's not included for ipv6, thus means ipv6 can carry a real '65535' payload. Signed-off-by: Wei Xu ---

[Qemu-devel] [ RFC Patch v5 1/2] virtio-net rsc: support coalescing ipv4 tcp traffic

2016-05-23 Thread wexu
From: Wei Xu All the data packets in a tcp connection will be cached to a big buffer in every receive interval, and will be sent out via a timer, the 'virtio_net_rsc_timeout' controls the interval, the value will influent the performance and response of tcp connection extremely,

[Qemu-devel] [ RFC Patch v5 0/2] Support Receive-Segment-Offload(RSC) for WHQL

2016-05-23 Thread wexu
From: Wei Xu Changes in V5: - Passed all IPv4/6 test cases - Add new fields in 'virtio_net_hdr' - Set 'gso_type' & 'coalesced packets' in new field. - Bypass all 'tcp option' packet - Bypass all 'pure ack' packet - Bypass all 'duplicate ack' packet - Change 'guest_rsc' feature

[Qemu-devel] [ RFC Patch v5 2/2] virtio-net rsc: support coalescing ipv6 tcp traffic

2016-05-23 Thread wexu
From: Wei Xu Most stuffs are like ipv4 2 differences between ipv4 and ipv6. 1. Fragment length in ipv4 header includes itself, while it's not included for ipv6, thus means ipv6 can carry a real '65535' payload. 2. IPv6 header does not need calculate header

[Qemu-devel] [ RFC Patch v7 0/2] Support Receive-Segment-Offload(RSC) for WHQL

2016-10-31 Thread wexu
From: Wei Xu This patch is to support WHQL test for Windows guest, while this feature also benifits other guest works as a kernel 'gro' like feature with userspace implementation. Feature information: http://msdn.microsoft.com/en-us/library/windows/hardware/jj853324 v6->v7

[Qemu-devel] [PATCH 2/2] virtio-net rsc: support coalescing ipv6 tcp traffic

2016-10-31 Thread wexu
From: Wei Xu Most process flows work like ipv4, 2 differences between ipv4 and ipv6. 1. Fragment length in ipv4 header includes itself, while it's not included for ipv6, thus means ipv6 can carry a real '65535' payload. 2. IPv6 header does not need calculate header checksum.

[Qemu-devel] [PATCH 1/2] virtio-net rsc: support coalescing ipv4 tcp traffic

2016-10-31 Thread wexu
From: Wei Xu All the data packets in a tcp connection are cached to a single buffer in every receive interval, and will be sent out via a timer, the 'virtio_net_rsc_timeout' controls the interval, this value may impact the performance and response time of tcp connection,

[Qemu-devel] [Patch 0/3] vfio: reusing address space for the same iommu group devices

2017-09-11 Thread wexu
From: Wei Xu Recently I have been testing passing through 2 ixgbe(82599ES) nics which belong to the same iommu group to a guest with virtual iommu(vIOMMU) on my desktop, while vfio failed to realize the second device and prompted error message as 'group xxx used in multiple

[Qemu-devel] [Patch 1/3] vfio: reusing address space for the same IOMMU group devices

2017-09-11 Thread wexu
From: Wei Xu Currently address space of a vfio device is selected by directly looking up pci device IOMMU address space during realizing, this usually works for most none separate address space targeted cases since they are using the system address space, i.e. a q35 machine

[Qemu-devel] [Patch 2/3] vfio: invoke looking up address space.

2017-09-11 Thread wexu
From: Wei Xu Invoke looking up correct address space before getting an IOMMU group. Signed-off-by: Wei Xu --- hw/vfio/pci.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index 31e1edf..856cefd 100644

[Qemu-devel] [Patch 3/3] vfio: remove checking duplicated vfio device

2017-09-11 Thread wexu
From: Wei Xu This has been done when introducing 'vfio_lookup_as()' patch as a side work to reuse the loop. Signed-off-by: Wei Xu --- hw/vfio/pci.c | 9 - 1 file changed, 9 deletions(-) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index

[Qemu-devel] [RFC v2 1/8] virtio: feature bit, data structure, init for 1.1

2018-06-05 Thread wexu
From: Wei Xu New feature bit and members for packed ring. Signed-off-by: Wei Xu --- hw/net/vhost_net.c | 2 ++ hw/virtio/virtio.c | 27 -- include/hw/virtio/virtio.h | 4 +++-

[Qemu-devel] [RFC v2 3/8] virtio: empty check and desc read for packed ring

2018-06-05 Thread wexu
From: Wei Xu helper for ring empty check and descriptor read. Signed-off-by: Wei Xu --- hw/virtio/virtio.c | 62 +++--- 1 file changed, 59 insertions(+), 3 deletions(-) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index f6c0689..bd669a2

[Qemu-devel] [RFC v2 0/8] packed ring virtio-net userspace backend support

2018-06-05 Thread wexu
From: Wei Xu Todo: - address Rx slow performance - event index interrupt suppression test v1->v2 - sync to tiwei's v5 - reuse memory cache function with 1.0 - dropped detach patch and notification helper(04 & 05 in v1) - guest virtio-net driver unload/reload support - event suppression

[Qemu-devel] [RFC v2 2/8] virtio: memory cache for packed ring

2018-06-05 Thread wexu
From: Wei Xu Mostly reuse memory cache with 1.0 except for the offset calculation. Signed-off-by: Wei Xu --- hw/virtio/virtio.c | 29 - 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index e192a9a..f6c0689

[Qemu-devel] [RFC v2 7/8] virtio: event suppression for packed ring

2018-06-05 Thread wexu
From: Wei Xu Signed-off-by: Wei Xu Signed-off-by: Wei Xu --- hw/virtio/virtio.c | 115 +++-- include/standard-headers/linux/virtio_config.h | 13 +++ 2 files changed, 119 insertions(+), 9 deletions(-) diff --git a/hw/virtio/virtio.c

[Qemu-devel] [RFC v2 6/8] virtio: flush/push for packed ring

2018-06-05 Thread wexu
From: Wei Xu Signed-off-by: Wei Xu Signed-off-by: Wei Xu --- hw/virtio/virtio.c | 109 ++--- 1 file changed, 96 insertions(+), 13 deletions(-) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 0160d03..6f2da83 100644 ---

[Qemu-devel] [RFC v2 8/8] virtio: guest driver reload for vhost-net

2018-06-05 Thread wexu
From: Wei Xu last_avail, avail_wrap_count, used_idx and used_wrap_count are needed to support vhost-net backend, all these are either 16 or bool variables, since state.num is 64bit wide, so here it is possible to put them to the 'num' without introducing a new case while handling ioctl.

[Qemu-devel] [RFC v2 5/8] virtio: queue pop for packed ring

2018-06-05 Thread wexu
From: Wei Xu Signed-off-by: Wei Xu --- hw/virtio/virtio.c | 145 - 1 file changed, 144 insertions(+), 1 deletion(-) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index cdbb5af..0160d03 100644 --- a/hw/virtio/virtio.c +++

[Qemu-devel] [RFC v2 4/8] virtio: get avail bytes check for packed ring

2018-06-05 Thread wexu
From: Wei Xu mostly as same as 1.0 except traversing all desc to feed headcount, need a refactor. Signed-off-by: Wei Xu --- hw/virtio/virtio.c | 148 +++-- 1 file changed, 145 insertions(+), 3 deletions(-) diff --git a/hw/virtio/virtio.c

[Qemu-devel] [PATCH 8/8] virtio: queue pop support for packed ring

2018-04-04 Thread wexu
From: Wei Xu cloned from split ring pop, a global static length array and the inside-element length array are introduced to easy prototype, this consumes more memory and it is valuable to move to dynamic allocation as the out/in sg does. Signed-off-by: Wei Xu

[Qemu-devel] [PATCH 4/8] virtio: add detach element for packed ring(1.1)

2018-04-04 Thread wexu
From: Wei Xu helper for packed ring Signed-off-by: Wei Xu --- hw/virtio/virtio.c | 21 +++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 478df3d..fdee40f 100644 ---

[Qemu-devel] [PATCH 3/8] virtio: add empty check for packed ring

2018-04-04 Thread wexu
From: Wei Xu helper for ring empty check. Signed-off-by: Wei Xu --- hw/virtio/virtio.c | 62 +++--- 1 file changed, 59 insertions(+), 3 deletions(-) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index

[Qemu-devel] [PATCH 5/8] virtio: notification tweak for packed ring

2018-04-04 Thread wexu
From: Wei Xu Always enable notify and bypass set notification before supporting driver and device area. Signed-off-by: Wei Xu --- hw/virtio/virtio.c | 9 + 1 file changed, 9 insertions(+) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index

[Qemu-devel] [PATCH 2/8] virtio: memory cache for packed ring

2018-04-04 Thread wexu
From: Wei Xu A new memory cache is introduced to for packed ring, the code looks pretty duplicated with split(1.0) ring, any refactor idea? Signed-off-by: Wei Xu --- hw/virtio/virtio.c | 79 +++--- 1 file

[Qemu-devel] [RFC PATCH 0/8] virtio-net 1.1 userspace backend support

2018-04-04 Thread wexu
From: Wei Xu This is a prototype for virtio-net 1.1 support in userspace backend, only minimum part are included in this RFC(roughly synced to v8 as Jason and Tiwei's RFC). Test has been done together with Tiwei's RFC guest virtio-net driver patch, ping and a quick iperf test

[Qemu-devel] [PATCH 1/8] virtio: feature bit, data structure for packed ring

2018-04-04 Thread wexu
From: Wei Xu Only minimum definitions from the spec are included for prototype. Signed-off-by: Wei Xu --- hw/virtio/virtio.c | 47 +++--- include/hw/virtio/virtio.h | 12 ++-

[Qemu-devel] [PATCH 7/8] virtio: get avail bytes check for packed ring

2018-04-04 Thread wexu
From: Wei Xu mostly as same as 1.0, copy it separately for prototype, need a refactoring. Signed-off-by: Wei Xu --- hw/virtio/virtio.c | 142 +++-- 1 file changed, 139 insertions(+), 3 deletions(-) diff --git

[Qemu-devel] [PATCH 6/8] virtio: flush/push support for packed ring

2018-04-04 Thread wexu
From: Wei Xu Signed-off-by: Wei Xu --- hw/virtio/virtio.c | 104 + 1 file changed, 90 insertions(+), 14 deletions(-) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 95a4681..def07c6 100644 ---

[Qemu-devel] [RFC v3 00/12] packed ring virtio-net userspace backend support

2018-10-11 Thread wexu
From: Wei Xu code base: https://github.com/Whishay/qemu.git Todo: - migration has not been support yet v2->v3 - addressed performance issue - fixed feedback from v2 v1->v2 - sync to tiwei's v5 - reuse memory cache function with 1.0 - dropped detach patch and notification helper(04 & 05 in v1)

[Qemu-devel] [[RFC v3 05/12] virtio: init and desc empty check for packed ring

2018-10-11 Thread wexu
From: Wei Xu Basic initialization and helpers for packed ring. Signed-off-by: Wei Xu --- hw/virtio/virtio.c | 57 +- 1 file changed, 56 insertions(+), 1 deletion(-) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 9185efb..86f88da

[Qemu-devel] [[RFC v3 03/12] virtio: init memory cache for packed ring

2018-10-11 Thread wexu
From: Wei Xu Expand 1.0 by adding offset calculation accordingly. Signed-off-by: Wei Xu --- hw/virtio/vhost.c | 16 hw/virtio/virtio.c | 35 +++ include/hw/virtio/virtio.h | 4 ++-- 3 files changed, 33 insertions(+), 22

[Qemu-devel] [[RFC v3 01/12] virtio: introduce packed ring definitions

2018-10-11 Thread wexu
From: Wei Xu sync from 1.1 spec Signed-off-by: Wei Xu --- include/standard-headers/linux/virtio_config.h | 15 + include/standard-headers/linux/virtio_ring.h | 43 ++ 2 files changed, 58 insertions(+) diff --git

[Qemu-devel] [[RFC v3 07/12] virtio: fill/flush/pop for packed ring

2018-10-11 Thread wexu
From: Wei Xu Signed-off-by: Wei Xu --- hw/virtio/virtio.c | 258 ++--- 1 file changed, 244 insertions(+), 14 deletions(-) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 13c6c98..d12a7e3 100644 --- a/hw/virtio/virtio.c +++

[Qemu-devel] [[RFC v3 02/12] virtio: redefine structure & memory cache for packed ring

2018-10-11 Thread wexu
From: Wei Xu Redefine packed ring structure according to qemu nomenclature, also supported data(event index, wrap counter, etc) are introduced. Signed-off-by: Wei Xu --- hw/virtio/virtio.c | 26 -- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git

[Qemu-devel] [[RFC v3 11/12] virtio: enable packed ring via a new command line

2018-10-11 Thread wexu
From: Wei Xu only userspace virtio net backend has been supported by the CLI so far. (cherry picked from commit 0b3ec96f4a9402cca467c40353066e57608ac6b6) Signed-off-by: Wei Xu (cherry picked from commit a1a3b85f00299ccc6f4bc819abe470da88059fb7) Signed-off-by: Wei Xu ---

[Qemu-devel] [[RFC v3 04/12] virtio: init wrap counter for packed ring

2018-10-11 Thread wexu
From: Wei Xu Signed-off-by: Wei Xu --- hw/virtio/virtio.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index bfb3364..9185efb 100644 --- a/hw/virtio/virtio.c +++ b/hw/virtio/virtio.c @@ -1243,6 +1243,9 @@ void virtio_reset(void *opaque)

[Qemu-devel] [[RFC v3 08/12] virtio: event suppression support for packed ring

2018-10-11 Thread wexu
From: Wei Xu Signed-off-by: Wei Xu --- hw/virtio/virtio.c | 126 +++-- 1 file changed, 123 insertions(+), 3 deletions(-) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index d12a7e3..1d25776 100644 --- a/hw/virtio/virtio.c +++

[Qemu-devel] [[RFC v3 06/12] virtio: get avail bytes check for packed ring

2018-10-11 Thread wexu
From: Wei Xu Same thought as 1.0 except a bit confused when trying to reuse 'shadow_avail_idx', so the interrelated new event_idx and the wrap counter for notifications has been introduced in previous patch. Signed-off-by: Wei Xu --- hw/virtio/virtio.c | 176

[Qemu-devel] [[RFC v3 12/12] virtio: feature vhost-net support for packed ring

2018-10-11 Thread wexu
From: Wei Xu (cherry picked from commit 305a2c4640c15c5717245067ab937fd10f478ee6) Signed-off-by: Wei Xu (cherry picked from commit 46476dae6f44c6fef8802a4a0ac7d0d79fe399e3) Signed-off-by: Wei Xu --- hw/virtio/vhost.c | 3 +++ hw/virtio/virtio.c | 4

[Qemu-devel] [[RFC v3 10/12] virtio: packed ring feature bit for userspace backend

2018-10-11 Thread wexu
From: Wei Xu Signed-off-by: Wei Xu --- hw/net/vhost_net.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c index e037db6..fb4b18f 100644 --- a/hw/net/vhost_net.c +++ b/hw/net/vhost_net.c @@ -78,6 +78,7 @@ static const int user_feature_bits[] = {

[Qemu-devel] [[RFC v3 09/12] virtio-net: fill head desc after done all in a chain

2018-10-11 Thread wexu
From: Wei Xu With the support of marking a descriptor used/unused in 'flags' field for 1.1, the current way of filling a chained descriptors does not work since driver side may get the wrong 'num_buffer' information in case of the head descriptor has been filled in while the subsequent ones are

[Qemu-devel] [PATCH v2 01/15] virtio: introduce packed ring definitions

2019-01-16 Thread wexu
From: Wei Xu >From 1.1 spec. Signed-off-by: Wei Xu --- include/standard-headers/linux/virtio_config.h | 15 + include/standard-headers/linux/virtio_ring.h | 43 ++ 2 files changed, 58 insertions(+) diff --git a/include/standard-headers/linux/virtio_config.h

[Qemu-devel] [PATCH v2 02/15] virtio: redefine structure & memory cache for packed ring

2019-01-16 Thread wexu
From: Wei Xu Redefine packed ring structure according to Qemu nomenclature, field data(wrap counter, etc) are introduced also. Signed-off-by: Wei Xu --- hw/virtio/virtio.c | 16 1 file changed, 16 insertions(+) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index

[Qemu-devel] [PATCH v2 04/15] virtio: add memory region init for packed ring

2019-01-16 Thread wexu
From: Wei Xu Signed-off-by: Wei Xu --- hw/virtio/virtio.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 112845c..454da3d 100644 --- a/hw/virtio/virtio.c +++ b/hw/virtio/virtio.c @@ -156,10 +156,8 @@ static void

[Qemu-devel] [PATCH v2 08/15] virtio: fill/flush/pop for packed ring

2019-01-16 Thread wexu
From: Wei Xu Signed-off-by: Wei Xu --- hw/virtio/virtio.c | 295 ++--- 1 file changed, 278 insertions(+), 17 deletions(-) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index cb599e9..5562ecd 100644 --- a/hw/virtio/virtio.c +++

[Qemu-devel] [PATCH v2 06/15] virtio: init and desc empty check for packed ring

2019-01-16 Thread wexu
From: Wei Xu ring check and other basical helpers for packed ring. Signed-off-by: Wei Xu --- hw/virtio/virtio.c | 59 +- 1 file changed, 58 insertions(+), 1 deletion(-) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index

[Qemu-devel] [PATCH v2 00/15] packed ring virtio-net backends support

2019-01-16 Thread wexu
From: Wei Xu v1->v2: - fix patchew complaint - only set/get last_avail_idx/wrap_counter for vhost migration(Maxime) - replace 'out_num' and 'in_num' with 'elem_entries'in packed_pop()(Maxime) - set last used idx/wrap_counter to last avail ones when flushing(Maxime) - replace

[Qemu-devel] [PATCH v2 03/15] virtio: expand offset calculation for packed ring

2019-01-16 Thread wexu
From: Wei Xu Expand 1.0 to 1.1 by adding offset calculation accordingly. Signed-off-by: Wei Xu --- hw/virtio/virtio.c | 22 ++ 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 827e745..112845c 100644 ---

[Qemu-devel] [PATCH v2 10/15] virtio-net: fill head desc after done all in a chain

2019-01-16 Thread wexu
From: Wei Xu With the support of marking a descriptor used/unused in 'flags' field for 1.1, the current way of filling a chained descriptors does not work since driver side may get the wrong 'num_buffer' information in case of the head descriptor has been filled in while the subsequent ones are

[Qemu-devel] [PATCH v2 05/15] virtio: init wrap counter for packed ring

2019-01-16 Thread wexu
From: Wei Xu Signed-off-by: Wei Xu --- hw/virtio/virtio.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 454da3d..833289e 100644 --- a/hw/virtio/virtio.c +++ b/hw/virtio/virtio.c @@ -1239,6 +1239,9 @@ void virtio_reset(void *opaque)

[Qemu-devel] [PATCH v2 07/15] virtio: get avail bytes check for packed ring

2019-01-16 Thread wexu
From: Wei Xu Signed-off-by: Wei Xu --- hw/virtio/virtio.c | 180 + 1 file changed, 167 insertions(+), 13 deletions(-) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index e728201..cb599e9 100644 --- a/hw/virtio/virtio.c +++

[Qemu-devel] [PATCH v2 09/15] virtio: event suppression support for packed ring

2019-01-16 Thread wexu
From: Wei Xu Signed-off-by: Wei Xu --- hw/virtio/virtio.c | 121 +++-- 1 file changed, 118 insertions(+), 3 deletions(-) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 5562ecd..0bcf8a5 100644 --- a/hw/virtio/virtio.c +++

[Qemu-devel] [PATCH v2 11/15] virtio: add userspace migration for packed ring

2019-01-16 Thread wexu
From: Wei Xu Signed-off-by: Wei Xu --- hw/virtio/virtio.c | 39 +++ 1 file changed, 39 insertions(+) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 0bcf8a5..722a4fd 100644 --- a/hw/virtio/virtio.c +++ b/hw/virtio/virtio.c @@ -2346,6 +2346,13 @@

[Qemu-devel] [PATCH v2 14/15] vhost: enable packed ring

2019-01-16 Thread wexu
From: Wei Xu Signed-off-by: Wei Xu --- hw/net/vhost_net.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c index fb4b18f..f593086 100644 --- a/hw/net/vhost_net.c +++ b/hw/net/vhost_net.c @@ -53,6 +53,7 @@ static const int kernel_feature_bits[] = {

[Qemu-devel] [PATCH v2 12/15] virtio: add vhost-net migration for packed ring

2019-01-16 Thread wexu
From: Wei Xu Signed-off-by: Wei Xu --- hw/virtio/virtio.c | 27 --- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 722a4fd..0cb912e 100644 --- a/hw/virtio/virtio.c +++ b/hw/virtio/virtio.c @@ -2991,17

[Qemu-devel] [PATCH v2 13/15] virtio: packed ring feature bit for userspace backend

2019-01-16 Thread wexu
From: Wei Xu Signed-off-by: Wei Xu --- hw/net/vhost_net.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c index e037db6..fb4b18f 100644 --- a/hw/net/vhost_net.c +++ b/hw/net/vhost_net.c @@ -78,6 +78,7 @@ static const int user_feature_bits[] = {

[Qemu-devel] [PATCH v2 15/15] virtio: enable packed ring via a new command line

2019-01-16 Thread wexu
From: Wei Xu Signed-off-by: Wei Xu --- include/hw/virtio/virtio.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h index 9c1fa07..cb286bb 100644 --- a/include/hw/virtio/virtio.h +++ b/include/hw/virtio/virtio.h @@

[Qemu-devel] [PATCH v1 02/16] virtio: introduce packed ring definitions

2018-11-22 Thread wexu
From: Wei Xu >From 1.1 spec. Signed-off-by: Wei Xu --- include/standard-headers/linux/virtio_config.h | 15 + include/standard-headers/linux/virtio_ring.h | 43 ++ 2 files changed, 58 insertions(+) diff --git a/include/standard-headers/linux/virtio_config.h

[Qemu-devel] [PATCH v1 00/16] packed ring virtio-net backend support

2018-11-22 Thread wexu
From: Wei Xu Code base: https://github.com/Whishay/qemu.git rfc v3 -> v1 - migration support for both userspace and vhost-net, need tweak vhost ioctl() to make it work(the code is pasted in the commit message of vhost migration patch #13). Note: the high 32-bit guest feature bit is

[Qemu-devel] [PATCH v1 03/16] virtio: redefine structure & memory cache for packed ring

2018-11-22 Thread wexu
From: Wei Xu Redefine packed ring structure according to Qemu nomenclature, field data(wrap counter, etc) are introduced also. Signed-off-by: Wei Xu --- hw/virtio/virtio.c | 16 1 file changed, 16 insertions(+) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index

[Qemu-devel] [PATCH v1 05/16] virtio: add memory region init for packed ring

2018-11-22 Thread wexu
From: Wei Xu Signed-off-by: Wei Xu --- hw/virtio/virtio.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index a41c2d3..99565c6 100644 --- a/hw/virtio/virtio.c +++ b/hw/virtio/virtio.c @@ -156,10 +156,8 @@ static void

[Qemu-devel] [PATCH v1 04/16] virtio: expand offset calculation for packed ring

2018-11-22 Thread wexu
From: Wei Xu Expand 1.0 to 1.1 by adding offset calculation accordingly. Signed-off-by: Wei Xu --- hw/virtio/virtio.c | 22 ++ 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index a8e737c..a41c2d3 100644 ---

[Qemu-devel] [PATCH v1 01/16] Update version for v3.1.0-rc2 release

2018-11-22 Thread wexu
From: Peter Maydell Signed-off-by: Peter Maydell --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 3af1c22..bbcce69 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.0.91 +3.0.92 -- 1.8.3.1

[Qemu-devel] [PATCH v1 08/16] virtio: get avail bytes check for packed ring

2018-11-22 Thread wexu
From: Wei Xu Signed-off-by: Wei Xu --- hw/virtio/virtio.c | 180 + 1 file changed, 167 insertions(+), 13 deletions(-) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 9d485e4..13265e3 100644 --- a/hw/virtio/virtio.c +++

[Qemu-devel] [PATCH v1 06/16] virtio: init wrap counter for packed ring

2018-11-22 Thread wexu
From: Wei Xu Signed-off-by: Wei Xu --- hw/virtio/virtio.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 99565c6..74d9710 100644 --- a/hw/virtio/virtio.c +++ b/hw/virtio/virtio.c @@ -1239,6 +1239,9 @@ void virtio_reset(void *opaque)

[Qemu-devel] [PATCH v1 11/16] virtio-net: fill head desc after done all in a chain

2018-11-22 Thread wexu
From: Wei Xu With the support of marking a descriptor used/unused in 'flags' field for 1.1, the current way of filling a chained descriptors does not work since driver side may get the wrong 'num_buffer' information in case of the head descriptor has been filled in while the subsequent ones are

[Qemu-devel] [PATCH v1 09/16] virtio: fill/flush/pop for packed ring

2018-11-22 Thread wexu
From: Wei Xu Signed-off-by: Wei Xu --- hw/virtio/virtio.c | 290 + 1 file changed, 273 insertions(+), 17 deletions(-) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 13265e3..99a6601 100644 --- a/hw/virtio/virtio.c +++

  1   2   >