qemu-e2k/include/hw
Yuri Benditovich 2974e916df virtio-net: support RSC v4/v6 tcp traffic for Windows HCK
This commit adds implementation of RX packets
coalescing, compatible with requirements of Windows
Hardware compatibility kit.

The device enables feature VIRTIO_NET_F_RSC_EXT in
host features if it supports extended RSC functionality
as defined in the specification.
This feature requires at least one of VIRTIO_NET_F_GUEST_TSO4,
VIRTIO_NET_F_GUEST_TSO6. Windows guest driver acks
this feature only if VIRTIO_NET_F_CTRL_GUEST_OFFLOADS
is also present.

If the guest driver acks VIRTIO_NET_F_RSC_EXT feature,
the device coalesces TCPv4 and TCPv6 packets (if
respective VIRTIO_NET_F_GUEST_TSO feature is on,
populates extended RSC information in virtio header
and sets VIRTIO_NET_HDR_F_RSC_INFO bit in header flags.
The device does not recalculate checksums in the coalesced
packet, so they are not valid.

In this case:
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,
50000(50us) is an experience value to gain a performance
improvement, since the whql test sends packets every 100us,
so '300000(300us)' passes the test case, it is the default
value as well, tune it via the command line parameter
'rsc_interval' within 'virtio-net-pci' device, for example,
to launch a guest with interval set as '500000':

'virtio-net-pci,netdev=hostnet1,bus=pci.0,id=net1,mac=00,
guest_rsc_ext=on,rsc_interval=500000'

The timer will only be triggered if the packets pool is not empty,
and it'll drain off all the cached packets.

'NetRscChain' is used to save the segments of IPv4/6 in a
VirtIONet device.

A new segment becomes a 'Candidate' as well as it passed sanity check,
the main handler of TCP includes TCP window update, duplicated
ACK check and the real data coalescing.

An 'Candidate' segment means:
1. Segment is within current window and the sequence is the expected one.
2. 'ACK' of the segment is in the valid window.

Sanity check includes:
1. Incorrect version in IP header
2. An IP options or IP fragment
3. Not a TCP packet
4. Sanity size check to prevent buffer overflow attack.
5. An ECN packet

Even though, there might more cases should be considered such as
ip identification other flags, while it breaks the test because
windows set it to the same even it's not a fragment.

Normally it includes 2 typical ways to handle a TCP control flag,
'bypass' and 'finalize', 'bypass' means should be sent out directly,
while 'finalize' means the packets should also be bypassed, but this
should be done after search for the same connection packets in the
pool and drain all of them out, this is to avoid out of order fragment.

All the 'SYN' packets will be bypassed since this always begin a new'
connection, other flags such 'URG/FIN/RST/CWR/ECE' will trigger a
finalization, because this normally happens upon a connection is going
to be closed, an 'URG' packet also finalize current coalescing unit.

Statistics can be used to monitor the basic coalescing status, the
'out of order' and 'out of window' means how many retransmitting packets,
thus describe the performance intuitively.

Difference between ip v4 and v6 processing:
 Fragment length in ipv4 header includes itself, while it's not
 included for ipv6, thus means ipv6 can carry a real 65535 payload.

Note that main goal of implementing this feature in software
is to create reference setup for certification tests. In such
setups guest migration is not required, so the coalesced packets
not yet delivered to the guest will be lost in case of migration.

Signed-off-by: Wei Xu <wexu@redhat.com>
Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2019-01-17 21:10:57 -05:00
..
acpi avoid TABs in files that only contain a few 2019-01-11 15:46:56 +01:00
adc STM32F2xx: Add the ADC device 2016-10-04 13:28:07 +01:00
arm arm: Add Clock peripheral stub to NRF51 SOC 2019-01-07 15:23:47 +00:00
audio audio: use TYPE_MV88W8618_AUDIO instead of hardcoded string 2018-10-29 13:50:15 +01:00
block block: Remove deprecated -drive option serial 2018-08-15 12:50:39 +02:00
char arm: Add header to host common definition for nRF51 SOC peripherals 2019-01-07 15:23:47 +00:00
core hw/core/split-irq: Device that splits IRQ lines 2018-03-02 11:03:45 +00:00
cpu hw/cpu: introduce CPU clusters 2019-01-07 15:23:45 +00:00
cris char: rename CharDriverState Chardev 2017-01-27 18:07:59 +01:00
display edid: fix vendor default 2018-10-05 11:26:56 +02:00
dma hw/dma/pl080: Don't use CPU address space for DMA accesses 2018-08-20 11:24:33 +01:00
firmware hw/smbios: Move to the hw/firmware/ subdirectory 2018-12-19 16:48:16 -05:00
gpio hw/gpio/nrf51_gpio: Add nRF51 GPIO peripheral 2019-01-07 15:23:47 +00:00
hyperv hyperv: process POST_MESSAGE hypercall 2018-10-19 13:44:14 +02:00
i2c i2c: Move typedef of bitbang_i2c_interface to i2c.h 2018-12-12 10:01:13 +01:00
i386 Machine queue, 2019-01-10 2019-01-11 13:35:48 +00:00
ide avoid TABs in files that only contain a few 2019-01-11 15:46:56 +01:00
input adb: add property to disable direct reg 3 writes 2018-06-16 16:32:33 +10:00
intc qom: make interface types abstract 2018-12-11 15:45:22 -02:00
ipack ipack: Update e-mail address 2016-05-18 15:04:27 +03:00
ipmi qom: make interface types abstract 2018-12-11 15:45:22 -02:00
isa qom: make interface types abstract 2018-12-11 15:45:22 -02:00
kvm hw: move headers to include/ 2013-04-08 18:13:10 +02:00
lm32 intc: make HMP 'info irq' and 'info pic' commands use InterruptStatsProvider interface 2016-10-04 10:00:25 +02:00
m68k hw/char/mcf_uart: QOMify the ColdFire UART 2017-02-16 14:06:56 +01:00
mem qom: make interface types abstract 2018-12-11 15:45:22 -02:00
mips hw/mips: Use the IEC binary prefix definitions 2018-07-02 15:41:16 +02:00
misc hw/misc/nrf51_rng: Add NRF51 random number generator peripheral 2019-01-07 15:23:47 +00:00
net net: cadence_gem: Add support for selecting the DMA MemoryRegion 2018-10-16 17:13:49 +01:00
nvram fw_cfg: import & use linux/qemu_fw_cfg.h 2018-08-23 18:46:25 +02:00
pci pci/pcie: stop plug/unplug if the slot is locked 2019-01-14 19:31:04 -05:00
pci-bridge Clean up includes 2018-02-09 05:05:11 +01:00
pci-host spapr: Eliminate SPAPR_PCI_2_7_MMIO_WIN_SIZE macro 2019-01-09 22:10:00 -02:00
ppc spapr: enable XIVE MMIOs at reset 2019-01-09 09:28:14 +11:00
riscv sifive_uart: Implement interrupt pending register 2018-12-20 12:08:43 -08:00
s390x hw/s390x: Fix bad mask in time2tod() 2018-12-20 17:07:24 +01:00
scsi scsi: esp: Defer command completion until previous interrupts have been handled 2019-01-11 13:57:24 +01:00
sd sdcard: Reflect when the Spec v3 is supported in the Config Register (SCR) 2018-06-08 13:15:34 +01:00
sh4 avoid TABs in files that only contain a few 2019-01-11 15:46:56 +01:00
sparc sun4u_iommu: update to reflect IOMMU is no longer part of the APB device 2018-01-09 21:48:20 +00:00
ssi hw/ssi/pl022: Allow use as embedded-struct device 2018-08-24 13:17:44 +01:00
timer hw/timer/nrf51_timer: Add nRF51 Timer peripheral 2019-01-07 15:23:47 +00:00
tricore Clean up header guards that don't match their file name 2016-07-12 16:19:16 +02:00
unicore32 hw/unicore32: restrict hw addr defines to source file 2017-12-18 17:07:02 +03:00
usb usb: Add basic code to emulate Chipidea USB IP 2018-02-09 10:40:30 +00:00
vfio qemu/queue.h: typedef QTAILQ heads 2019-01-11 15:46:55 +01:00
virtio virtio-net: support RSC v4/v6 tcp traffic for Windows HCK 2019-01-17 21:10:57 -05:00
watchdog hw/watchdog/cmsdk_apb_watchdog: Implement CMSDK APB watchdog module 2018-08-20 11:24:33 +01:00
xen xen: Replace few mentions of xend by libxl 2019-01-14 13:45:40 +00:00
xtensa Clean up includes 2018-02-09 05:05:11 +01:00
boards.h compat: replace PC_COMPAT_2_1 & HW_COMPAT_2_1 macros 2019-01-07 16:18:42 +04:00
bt.h char: rename CharDriverState Chardev 2017-01-27 18:07:59 +01:00
devices.h hw: Clean "hw/devices.h" includes 2018-06-01 14:15:10 +02:00
elf_ops.h avoid TABs in files that only contain a few 2019-01-11 15:46:56 +01:00
empty_slot.h Clean up decorations and whitespace around header guards 2016-07-12 16:20:46 +02:00
fw-path-provider.h qom: make interface types abstract 2018-12-11 15:45:22 -02:00
hotplug.h qom: make interface types abstract 2018-12-11 15:45:22 -02:00
hw.h migration: Split qemu-file.h 2017-06-01 18:49:22 +02:00
ide.h xen-platform: add missing disk unplug option 2017-01-27 15:23:29 -08:00
irq.h hw/core/split-irq: Device that splits IRQ lines 2018-03-02 11:03:45 +00:00
loader-fit.h Use #include "..." for our own headers, <...> for others 2018-02-09 05:05:11 +01:00
loader.h Support u-boot noload images for arm as used by, NetBSD/evbarm GENERIC kernel. 2019-01-07 15:46:20 +00:00
nmi.h qom: make interface types abstract 2018-12-11 15:45:22 -02:00
or-irq.h hw/core/or-irq: Support more than 16 inputs to an OR gate 2018-06-15 15:23:34 +01:00
pcmcia.h Clean up decorations and whitespace around header guards 2016-07-12 16:20:46 +02:00
platform-bus.h platform-bus-device: use device plug callback instead of machine_done notifier 2018-05-10 18:10:56 +01:00
ptimer.h ptimer: Add TRIGGER_ONLY_ON_DECREMENT policy option 2018-07-09 14:51:34 +01:00
qdev-core.h qemu/queue.h: simplify reverse access to QTAILQ 2019-01-11 15:46:55 +01:00
qdev-dma.h qdev: Remove hex8/32/64 property types 2014-02-14 21:12:04 +01:00
qdev-properties.h qapi: Define PCIe link speed and width properties 2018-12-19 16:48:16 -05:00
qdev.h hw: move headers to include/ 2013-04-08 18:13:10 +02:00
register.h hw: register: Run post_write hook on reset 2018-03-01 11:05:43 +00:00
registerfields.h Use #include "..." for our own headers, <...> for others 2018-02-09 05:05:11 +01:00
stream.h qom: make interface types abstract 2018-12-11 15:45:22 -02:00
sysbus.h core/sysbus: remove the SysBusDeviceClass::init path 2018-12-13 13:48:03 +00:00
usb.h qemu/queue.h: simplify reverse access to QTAILQ 2019-01-11 15:46:55 +01:00