121 lines · plain
1.. SPDX-License-Identifier: GPL-2.02 3======================4Hyper-V network driver5======================6 7Compatibility8=============9 10This driver is compatible with Windows Server 2012 R2, 2016 and11Windows 10.12 13Features14========15 16Checksum offload17----------------18 The netvsc driver supports checksum offload as long as the19 Hyper-V host version does. Windows Server 2016 and Azure20 support checksum offload for TCP and UDP for both IPv4 and21 IPv6. Windows Server 2012 only supports checksum offload for TCP.22 23Receive Side Scaling24--------------------25 Hyper-V supports receive side scaling. For TCP & UDP, packets can26 be distributed among available queues based on IP address and port27 number.28 29 For TCP & UDP, we can switch hash level between L3 and L4 by ethtool30 command. TCP/UDP over IPv4 and v6 can be set differently. The default31 hash level is L4. We currently only allow switching TX hash level32 from within the guests.33 34 On Azure, fragmented UDP packets have high loss rate with L435 hashing. Using L3 hashing is recommended in this case.36 37 For example, for UDP over IPv4 on eth0:38 39 To include UDP port numbers in hashing::40 41 ethtool -N eth0 rx-flow-hash udp4 sdfn42 43 To exclude UDP port numbers in hashing::44 45 ethtool -N eth0 rx-flow-hash udp4 sd46 47 To show UDP hash level::48 49 ethtool -n eth0 rx-flow-hash udp450 51Generic Receive Offload, aka GRO52--------------------------------53 The driver supports GRO and it is enabled by default. GRO coalesces54 like packets and significantly reduces CPU usage under heavy Rx55 load.56 57Large Receive Offload (LRO), or Receive Side Coalescing (RSC)58-------------------------------------------------------------59 The driver supports LRO/RSC in the vSwitch feature. It reduces the per packet60 processing overhead by coalescing multiple TCP segments when possible. The61 feature is enabled by default on VMs running on Windows Server 2019 and62 later. It may be changed by ethtool command::63 64 ethtool -K eth0 lro on65 ethtool -K eth0 lro off66 67SR-IOV support68--------------69 Hyper-V supports SR-IOV as a hardware acceleration option. If SR-IOV70 is enabled in both the vSwitch and the guest configuration, then the71 Virtual Function (VF) device is passed to the guest as a PCI72 device. In this case, both a synthetic (netvsc) and VF device are73 visible in the guest OS and both NIC's have the same MAC address.74 75 The VF is enslaved by netvsc device. The netvsc driver will transparently76 switch the data path to the VF when it is available and up.77 Network state (addresses, firewall, etc) should be applied only to the78 netvsc device; the slave device should not be accessed directly in79 most cases. The exceptions are if some special queue discipline or80 flow direction is desired, these should be applied directly to the81 VF slave device.82 83Receive Buffer84--------------85 Packets are received into a receive area which is created when device86 is probed. The receive area is broken into MTU sized chunks and each may87 contain one or more packets. The number of receive sections may be changed88 via ethtool Rx ring parameters.89 90 There is a similar send buffer which is used to aggregate packets91 for sending. The send area is broken into chunks, typically of 614492 bytes, each of section may contain one or more packets. Small93 packets are usually transmitted via copy to the send buffer. However,94 if the buffer is temporarily exhausted, or the packet to be transmitted is95 an LSO packet, the driver will provide the host with pointers to the data96 from the SKB. This attempts to achieve a balance between the overhead of97 data copy and the impact of remapping VM memory to be accessible by the98 host.99 100XDP support101-----------102 XDP (eXpress Data Path) is a feature that runs eBPF bytecode at the early103 stage when packets arrive at a NIC card. The goal is to increase performance104 for packet processing, reducing the overhead of SKB allocation and other105 upper network layers.106 107 hv_netvsc supports XDP in native mode, and transparently sets the XDP108 program on the associated VF NIC as well.109 110 Setting / unsetting XDP program on synthetic NIC (netvsc) propagates to111 VF NIC automatically. Setting / unsetting XDP program on VF NIC directly112 is not recommended, also not propagated to synthetic NIC, and may be113 overwritten by setting of synthetic NIC.114 115 XDP program cannot run with LRO (RSC) enabled, so you need to disable LRO116 before running XDP::117 118 ethtool -K eth0 lro off119 120 XDP_REDIRECT action is not yet supported.121