qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [ Patch 0/2] Support Receive-Segment-Offload(RSC) for WHQL test of Window guest
@ 2016-03-15  9:17 wexu
  2016-03-15  9:17 ` [Qemu-devel] [ Patch 1/2] virtio-net rsc: support coalescing ipv4 tcp traffic wexu
                   ` (3 more replies)
  0 siblings, 4 replies; 32+ messages in thread
From: wexu @ 2016-03-15  9:17 UTC (permalink / raw)
  To: qemu-devel; +Cc: victork, mst, jasowang, yvugenfi, Wei Xu, marcel, dfleytma

From: Wei Xu <wexu@redhat.com>

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 

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 IPv4 and IPv6 are supported, though performance with userspace virtio
is slow than vhost-net, there is about 1x to 3x performance improvement to
userspace virtio, this is done by turning this feature on and disable
'tso/gso/gro' on corresponding tap interface and guest interface, while get
less improment with all these feature on.

Test steps:
Although this feature is mainly used for window guest, i used linux guest to help test
the feature, to make things simple, i used 3 steps to test the patch as i moved on.
1. With a tcp socket client/server pair running on 2 linux guest, thus i can control
the traffic and debugging the code as i want.
2. Netperf on linux guest test the throughput.
3. WHQL test with 2 Windows guests.

Current status:
IPv4 pass all the above tests.
IPv6 just passed test step 1 and 2 as described ahead, the virtio nic cannot
receive any packet in WHQL test, looks like the test traffic is not sent from
on the support machine, test device can access both host and another linux
guest, tried a lot of ways to work it out but failed, maybe debug from windows
guest driver side can help figuring it out.

Note:
A 'MessageDevice' nic chose as 'Realtek' will panic the system sometimes during setup,
this can be figured out by replacing it with an 'e1000' nic.

Todo:
More sanity check and tcp 'ecn' and 'window' scale test.

Wei Xu (2):
  virtio-net rsc: support coalescing ipv4 tcp traffic
  virtio-net rsc: support coalescing ipv6 tcp traffic

 hw/net/virtio-net.c            | 602 ++++++++++++++++++++++++++++++++++++++++-
 include/hw/virtio/virtio-net.h |   1 +
 include/hw/virtio/virtio.h     |  75 +++++
 3 files changed, 677 insertions(+), 1 deletion(-)

-- 
2.5.0

^ permalink raw reply	[flat|nested] 32+ messages in thread
* [Qemu-devel] [ RFC Patch v7 0/2] Support Receive-Segment-Offload(RSC) for WHQL
@ 2016-10-31 17:41 wexu
  2016-10-31 17:41 ` [Qemu-devel] [PATCH 1/2] virtio-net rsc: support coalescing ipv4 tcp traffic wexu
  0 siblings, 1 reply; 32+ messages in thread
From: wexu @ 2016-10-31 17:41 UTC (permalink / raw)
  To: qemu-devel; +Cc: jasowang, mst, dfleytma, yvugenfi, Wei Xu

From: Wei Xu <wexu@redhat.com>

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
- Change the drain timer from 'virtual' to 'host' since it invisible
  to guest.
- Move the buffer list empty check to virtio_net_rsc_do_coalesc().
- The header comparision is a bit odd for ipv4 in this patch, it
  should be simpler with equal check, but this is also a helper for ipv6
  in next patch, and ipv6 used a different size address fields, so i used
  an 'address + size' byte comparision for address, and change comparing
  the tcp port with 'int' equal check.
- Add count for packets whose size less than a normal tcp packet in
  sanity check.
- Move constant value comparison to the right side of the equal symbol.
- Use host header length in stead of guest header length to verify a
  packet in virtio_net_rsc_receive(), in case of the different header
  length for guest and host.
- Check whether the packet size is enough to hold a legal packet before
  extract ip unit.
- Bypass ip/tcp ECN packets.
- Expand the feature bit definition from 32 to 64 bits.

Other notes:
- About tcp windows scale, we don't have connection tracking about all
  tcp connections, so we don't know what the exact window size is using,
  thus this feature may get negative influence to it, have to turn this
  feature off for such a user case currently.
- There are 2 new fields in the virtio net header, it's not in either
  kernel tree or maintainer's tree right now, I just put it directly here.
- The statistics is kept in this version since it's helpful for
  troubleshooting.


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 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 bit to 'false' by default
- Feedbacks from v4, typo, etc.

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, replace it with 'NetRscUnit'
- Different virtio header size
- Modify callback function to direct call.
- Needn't check the failure of g_malloc()
- Other code format adjustment, macro naming, etc

Changes in V2:
- Add detailed commit log

Wei Xu (2):
  virtio-net rsc: support coalescing ipv4 tcp traffic
  virtio-net rsc: support coalescing ipv6 tcp traffic

 hw/net/virtio-net.c                         | 742 ++++++++++++++++++++++++++--
 include/hw/virtio/virtio-net.h              |   5 +-
 include/hw/virtio/virtio.h                  |  76 +++
 include/net/eth.h                           |   2 +
 include/standard-headers/linux/virtio_net.h |  18 +
 net/tap.c                                   |   3 +-
 6 files changed, 814 insertions(+), 32 deletions(-)

-- 
2.7.1

^ permalink raw reply	[flat|nested] 32+ messages in thread

end of thread, other threads:[~2016-11-30 11:13 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-15  9:17 [Qemu-devel] [ Patch 0/2] Support Receive-Segment-Offload(RSC) for WHQL test of Window guest wexu
2016-03-15  9:17 ` [Qemu-devel] [ Patch 1/2] virtio-net rsc: support coalescing ipv4 tcp traffic wexu
2016-03-15 10:00   ` Michael S. Tsirkin
2016-03-16  3:23     ` Wei Xu
2016-03-17  8:42   ` Jason Wang
2016-03-17 16:45     ` Wei Xu
2016-03-18  2:03       ` Jason Wang
2016-03-18  4:17         ` Wei Xu
2016-03-18  5:20           ` Jason Wang
2016-03-18  6:38             ` Wei Xu
2016-03-18  6:56               ` Jason Wang
2016-03-18 14:52                 ` Wei Xu
2016-03-15  9:17 ` [Qemu-devel] [ Patch 2/2] virtio-net rsc: support coalescing ipv6 " wexu
2016-03-17  8:50   ` Jason Wang
2016-03-17 16:50     ` Wei Xu
2016-03-15 10:01 ` [Qemu-devel] [ Patch 0/2] Support Receive-Segment-Offload(RSC) for WHQL test of Window guest Michael S. Tsirkin
2016-03-16  3:08   ` Wei Xu
2016-03-17  6:47 ` Jason Wang
2016-03-17 15:21   ` Wei Xu
2016-03-17 15:44     ` Michael S. Tsirkin
2016-03-17 16:57       ` Wei Xu
2016-03-18  2:22         ` Jason Wang
2016-03-18  4:24           ` Wei Xu
2016-03-18  5:21             ` Jason Wang
2016-03-18  6:30               ` Wei Xu
  -- strict thread matches above, loose matches on Subject: below --
2016-10-31 17:41 [Qemu-devel] [ RFC Patch v7 0/2] Support Receive-Segment-Offload(RSC) for WHQL wexu
2016-10-31 17:41 ` [Qemu-devel] [PATCH 1/2] virtio-net rsc: support coalescing ipv4 tcp traffic wexu
2016-11-24  4:17   ` Jason Wang
2016-11-24  4:26     ` Michael S. Tsirkin
2016-11-24  4:31       ` Jason Wang
2016-11-24  5:09         ` Michael S. Tsirkin
2016-11-30  8:55     ` Wei Xu
2016-11-30 11:12       ` Jason Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).