New upstream version 18.08
[deb_dpdk.git] / doc / guides / nics / netvsc.rst
1 ..  SPDX-License-Identifier: BSD-3-Clause
2     Copyright(c) Microsoft Corporation.
3
4 Netvsc poll mode driver
5 =======================
6
7 The Netvsc Poll Mode driver (PMD) provides support for the paravirtualized
8 network device for Microsoft Hyper-V. It can be used with
9 Window Server 2008/2012/2016, Windows 10.
10 The device offers multi-queue support (if kernel and host support it),
11 checksum and segmentation offloads.
12
13
14 Features and Limitations of Hyper-V PMD
15 ---------------------------------------
16
17 In this release, the hyper PMD driver provides the basic functionality of packet reception and transmission.
18
19 *   It supports merge-able buffers per packet when receiving packets and scattered buffer per packet
20     when transmitting packets. The packet size supported is from 64 to 65536.
21
22 *   The PMD supports multicast packets and promiscuous mode subject to restrictions on the host.
23     In order to this to work, the guest network configuration on Hyper-V must be configured to allow MAC address
24     spoofing.
25
26 *   The device has only a single MAC address.
27     Hyper-V driver does not support MAC or VLAN filtering because the Hyper-V host does not support it.
28
29 *   VLAN tags are always stripped and presented in mbuf tci field.
30
31 *   The Hyper-V driver does not use or support Link State or Rx interrupt.
32
33 *   The maximum number of queues is limited by the host (currently 64).
34     When used with 4.16 kernel only a single queue is available.
35
36 .. note::
37    This driver is intended for use with **Hyper-V only** and is
38    not recommended for use on Azure because accelerated Networking
39    (SR-IOV) is not supported.
40
41    On Azure, use the :doc:`vdev_netvsc` which
42    automatically configures the necessary TAP and failsave drivers.
43
44
45 Installation
46 ------------
47
48 The Netvsc PMD is a standalone driver, similar to virtio and vmxnet3.
49 Using Netvsc PMD requires that the associated VMBUS device be bound to the userspace
50 I/O device driver for Hyper-V (uio_hv_generic). By default, all netvsc devices
51 will be bound to the Linux kernel driver; in order to use netvsc PMD the
52 device must first be overridden.
53
54 The first step is to identify the network device to override.
55 VMBUS uses Universal Unique Identifiers
56 (`UUID`_) to identify devices on the bus similar to how PCI uses Domain:Bus:Function.
57 The UUID associated with a Linux kernel network device can be determined
58 by looking at the sysfs information. To find the UUID for eth1 and
59 store it in a shell variable:
60
61     .. code-block:: console
62
63         DEV_UUID=$(basename $(readlink /sys/class/net/eth1/device))
64
65
66 .. _`UUID`: https://en.wikipedia.org/wiki/Universally_unique_identifier
67
68 There are several possible ways to assign the uio device driver for a device.
69 The easiest way (but only on 4.18 or later)
70 is to use the `driverctl Device Driver control utility`_ to override
71 the normal kernel device.
72
73     .. code-block:: console
74
75         driverctl -b vmbus set-override $DEV_UUID uio_hv_generic
76
77 .. _`driverctl Device Driver control utility`: https://gitlab.com/driverctl/driverctl
78
79 Any settings done with driverctl are by default persistent and will be reapplied
80 on reboot.
81
82 On older kernels, the same effect can be had by manual sysfs bind and unbind
83 operations:
84
85     .. code-block:: console
86
87         NET_UUID="f8615163-df3e-46c5-913f-f2d2f965ed0e"
88         modprobe uio_hv_generic
89         echo $NET_UUID > /sys/bus/vmbus/drivers/uio_hv_generic/new_id
90         echo $DEV_UUID > /sys/bus/vmbus/drivers/hv_netvsc/unbind
91         echo $DEV_UUID > /sys/bus/vmbus/drivers/uio_hv_generic/bind
92
93 .. Note::
94
95    The dpkd-devbind.py script can not be used since it only handles PCI devices.
96
97
98 Prerequisites
99 -------------
100
101 The following prerequisites apply:
102
103 *   Linux kernel support for UIO on vmbus is done with the uio_hv_generic driver.
104     Full support of multiple queues requires the 4.17 kernel. It is possible
105     to use the netvsc PMD with 4.16 kernel but it is limited to a single queue.