xref: /dpdk/doc/guides/nics/vdev_netvsc.rst (revision b583b9a1bb49e86aa0937d55415713282000c536)
16086ab3bSMatan Azrad..  SPDX-License-Identifier: BSD-3-Clause
26086ab3bSMatan Azrad    Copyright 2017 6WIND S.A.
35feecc57SShahaf Shuler    Copyright 2017 Mellanox Technologies, Ltd
46086ab3bSMatan Azrad
56086ab3bSMatan AzradVDEV_NETVSC driver
66086ab3bSMatan Azrad==================
76086ab3bSMatan Azrad
88809f78cSBruce RichardsonThe VDEV_NETVSC driver (**librte_net_vdev_netvsc**) provides support for NetVSC
96086ab3bSMatan Azradinterfaces and associated SR-IOV virtual function (VF) devices found in
106086ab3bSMatan AzradLinux virtual machines running on Microsoft Hyper-V_ (including Azure)
116086ab3bSMatan Azradplatforms.
126086ab3bSMatan Azrad
136086ab3bSMatan Azrad.. _Hyper-V: https://docs.microsoft.com/en-us/windows-hardware/drivers/network/overview-of-hyper-v
146086ab3bSMatan Azrad
15e7dc5d7bSMatan AzradImplementation details
16e7dc5d7bSMatan Azrad----------------------
17e7dc5d7bSMatan Azrad
18e7dc5d7bSMatan AzradEach instance of this driver effectively needs to drive two devices: the
19e7dc5d7bSMatan AzradNetVSC interface proper and its SR-IOV VF (referred to as "physical" from
20e7dc5d7bSMatan Azradthis point on) counterpart sharing the same MAC address.
21e7dc5d7bSMatan Azrad
22e7dc5d7bSMatan AzradPhysical devices are part of the host system and cannot be maintained during
23e7dc5d7bSMatan AzradVM migration. From a VM standpoint they appear as hot-plug devices that come
24e7dc5d7bSMatan Azradand go without prior notice.
25e7dc5d7bSMatan Azrad
26e7dc5d7bSMatan AzradWhen the physical device is present, egress and most of the ingress traffic
27e7dc5d7bSMatan Azradflows through it; only multicasts and other hypervisor control still flow
28e7dc5d7bSMatan Azradthrough NetVSC. Otherwise, NetVSC acts as a fallback for all traffic.
29e7dc5d7bSMatan Azrad
30e7dc5d7bSMatan AzradTo avoid unnecessary code duplication and ensure maximum performance,
31e7dc5d7bSMatan Azradhandling of physical devices is left to their original PMDs; this virtual
32e7dc5d7bSMatan Azraddevice driver (also known as *vdev*) manages other PMDs as summarized by the
33e7dc5d7bSMatan Azradfollowing block diagram::
34e7dc5d7bSMatan Azrad
35e7dc5d7bSMatan Azrad         .------------------.
36e7dc5d7bSMatan Azrad         | DPDK application |
37e7dc5d7bSMatan Azrad         `--------+---------'
38e7dc5d7bSMatan Azrad                  |
39e7dc5d7bSMatan Azrad           .------+------.
40e7dc5d7bSMatan Azrad           | DPDK ethdev |
41e7dc5d7bSMatan Azrad           `------+------'       Control
42e7dc5d7bSMatan Azrad                  |                 |
43e7dc5d7bSMatan Azrad     .------------+------------.    v    .--------------------.
44e7dc5d7bSMatan Azrad     |       failsafe PMD      +---------+ vdev_netvsc driver |
45e7dc5d7bSMatan Azrad     `--+-------------------+--'         `--------------------'
46e7dc5d7bSMatan Azrad        |                   |
47e7dc5d7bSMatan Azrad        |          .........|.........
48e7dc5d7bSMatan Azrad        |          :        |        :
49e7dc5d7bSMatan Azrad   .----+----.     :   .----+----.   :
50e7dc5d7bSMatan Azrad   | tap PMD |     :   | any PMD |   :
51e7dc5d7bSMatan Azrad   `----+----'     :   `----+----'   : <-- Hot-pluggable
52e7dc5d7bSMatan Azrad        |          :        |        :
53e7dc5d7bSMatan Azrad .------+-------.  :  .-----+-----.  :
54e7dc5d7bSMatan Azrad | NetVSC-based |  :  | SR-IOV VF |  :
55e7dc5d7bSMatan Azrad |   netdevice  |  :  |   device  |  :
56e7dc5d7bSMatan Azrad `--------------'  :  `-----------'  :
57e7dc5d7bSMatan Azrad                   :.................:
58e7dc5d7bSMatan Azrad
59e7dc5d7bSMatan Azrad
60e7dc5d7bSMatan AzradThis driver implementation may be temporary and should be improved or removed
61e7dc5d7bSMatan Azradeither when hot-plug will be fully supported in EAL and bus drivers or when
62e7dc5d7bSMatan Azrada new NetVSC driver will be integrated.
63e7dc5d7bSMatan Azrad
64e7dc5d7bSMatan Azrad
65*b583b9a1SFerruh YigitRuntime Configuration
66*b583b9a1SFerruh Yigit---------------------
67e7dc5d7bSMatan Azrad
6856252de7SMatan AzradThis driver is invoked automatically in Hyper-V VM systems unless the user
6956252de7SMatan Azradinvoked it by command line using ``--vdev=net_vdev_netvsc`` EAL option.
70e7dc5d7bSMatan Azrad
71e7dc5d7bSMatan AzradThe following device parameters are supported:
72e7dc5d7bSMatan Azrad
73e7dc5d7bSMatan Azrad- ``iface`` [string]
74e7dc5d7bSMatan Azrad
75e7dc5d7bSMatan Azrad  Provide a specific NetVSC interface (netdevice) name to attach this driver
76e7dc5d7bSMatan Azrad  to. Can be provided multiple times for additional instances.
77e7dc5d7bSMatan Azrad
78e7dc5d7bSMatan Azrad- ``mac`` [string]
79e7dc5d7bSMatan Azrad
80e7dc5d7bSMatan Azrad  Same as ``iface`` except a suitable NetVSC interface is located using its
81e7dc5d7bSMatan Azrad  MAC address.
82e7dc5d7bSMatan Azrad
83658dea3aSMatan Azrad- ``force`` [int]
84658dea3aSMatan Azrad
85658dea3aSMatan Azrad  If nonzero, forces the use of specified interfaces even if not detected as
860b39cc82SMatan Azrad  NetVSC.
87658dea3aSMatan Azrad
8856252de7SMatan Azrad- ``ignore`` [int]
8956252de7SMatan Azrad
902be90f79SStephen Hemminger  If nonzero, ignores the driver running (actually used to disable the
9156252de7SMatan Azrad  auto-detection in Hyper-V VM).
9256252de7SMatan Azrad
930b39cc82SMatan Azrad.. note::
940b39cc82SMatan Azrad
95e7dc5d7bSMatan Azrad   Not specifying either ``iface`` or ``mac`` makes this driver attach itself to
9631182fadSMatan Azrad   all unrouted NetVSC interfaces found on the system.
970b39cc82SMatan Azrad   Specifying the device makes this driver attach itself to the device
980b39cc82SMatan Azrad   regardless the device routes.
99