docs: Update vmxnet3 usecase
[vpp.git] / docs / usecases / vmxnet3.rst
1 .. _vmxnet3:
2
3 VPP with VMware/Vmxnet3
4 =======================
5
6 This section describes a native Vmxnet3 driver that is included with VPP.
7 This driver is written as a plugin and is found in src/plugin/vmxnet3.
8
9 Advantages
10 ----------
11
12 The native VPP native vmxnet3 driver provides the following features
13 that are not provided with the standard dpdk vmxnet3 driver.
14
15 -  Interrupt mode
16 -  Adaptive mode
17 -  TSO/LRO mode
18
19 Does not support
20 ----------------
21
22 This driver does yet support the following features.
23
24 -  VLAN filter
25
26 Prerequisites
27 -------------
28
29 -  This code is tested with vfio-pci driver installed with Ubuntu 18.04
30    which has kernel version 4.15.0-33-generic.
31
32 -  This code is tested with ESXi vSwitch version 6.5/6.7 for LRO/TSO support,
33    VMware Workstation 15 Pro (no LRO/TSO), and VMware Fusion 11 Pro (no LRO/TSO).
34
35 -  Driver requires MSI-X interrupt support, which is not supported by
36    uio_pci_generic driver, so vfio-pci needs to be used. On systems
37    without IOMMU vfio driver can still be used with recent kernels which
38    support no-iommu mode.
39
40 VMware Fusion for Mac
41 ---------------------
42
43 VMware fusion does not have a menu option to change the default driver (e1000)
44 to the **vmxnet3** driver. VPP supports the **vmxnet3** driver.
45
46 These instructions describe how to change the e1000 driver for VMware fusion.
47
48 * From the VMware Fusion menu bar select **Window** then **Virtual Machine Library**.
49 * From the Virtual Machine menu right click on the Virtual Machine you are using and select **Show in Finder**
50 * Find the name associated with the VM you are using, right click on it and select **Show Package Contents**
51 * Find the **.vmx** file and edit it.
52 * Find all the occurences of **e1000** and change them to **vmxnet3**
53
54 If you are concerned more with configuration not performance the vmxnet3 driver can be set to
55 **interrupt** mode in VPP. This will save a great deal on battery usage. Do this with the following
56
57 VMware Workstatiom PRO 15 for Linux
58 -----------------------------------
59
60 VMware Workstation does not have a menu option to change the default driver (e1000)
61 to the **vmxnet3** driver. VPP supports the **vmxnet3** driver.
62
63 These instructions describe how to change the e1000 driver for VMware Workstation PRO 15 Linux. You may need to be a superuser for performing these steps.
64
65 * Shut down the VM you are about to change.
66 * From the vmware folder where vmware creates and stores the VM's, change the directory to the specific VM which you want to modify, and use your favorite text editor to open the corresponding VM's .vmx file. By default, it is $HOME/vmware/<vm-name>/<vm-name>.vmx
67 * Locate the line for the interface which you want to modify. For example, if it is ethernet1, then change the line **ethernet1.virtualDev = "e1000"** to **ethernet1.virtualDev = "vmxnet3"**
68 * Save the file and power on the VM.
69
70 If you are concerned more with configuration not performance the vmxnet3 driver can be set to
71 **interrupt** mode in VPP. This will save a great deal on battery usage. Do this with the following
72
73 .. code-block:: console
74
75     $ sudo vppctl set interface rx-mode <interface> interrupt
76
77
78 System setup
79 ~~~~~~~~~~~~
80
81 To use the native VPP vmxnet3 driver use the following Steps
82
83 Load VFIO driver
84
85 .. code-block:: console
86
87     $ sudo modprobe vfio-pci
88
89 Make sure the interface is down
90
91 .. code-block:: console
92
93     $ sudo ifconfig <if-name> down
94
95 The next 2 steps are optional and may be accomplished by specifying the optional "bind" keyword
96 when creating the vmxnet3 interface.
97
98 For systems without IOMMU only, enable unsafe NOIOMMU mode
99
100 .. code-block:: console
101
102     $ echo Y | sudo tee /sys/module/vfio/parameters/enable_unsafe_noiommu_mode
103
104 To bind interface to vfio-pci first install the :ref:`configutil`. This will download
105 the dpdk_devbind.py script. It is located in */usr/vpp/vpp-config/scripts* with Centos
106 and */usr/local/vpp/vpp-config/scripts* with Ubuntu.
107
108 Bind the driver with the following commands:
109
110 .. code-block:: console
111
112     $ sudo /usr/local/vpp/vpp-config/scripts/dpdk-devbind.py -s
113
114     Network devices using DPDK-compatible driver
115     ============================================
116     <none>
117     
118     Network devices using kernel driver
119     ===================================
120     0000:03:00.0 'VMXNET3 Ethernet Controller' if=ens160 drv=vmxnet3 unused=vfio-pci,uio_pci_generic 
121     0000:0b:00.0 'VMXNET3 Ethernet Controller' drv=vfio-pci unused=vmxnet3,uio_pci_generic
122     0000:13:00.0 'VMXNET3 Ethernet Controller' drv=vfio-pci unused=vmxnet3,uio_pci_generic
123     .....
124
125     $ sudo /usr/local/vpp/vpp-config/scripts/dpdk-devbind.py --bind vfio-pci 0b:00.0
126
127
128 Interface Creation
129 ~~~~~~~~~~~~~~~~~~
130
131 Now create the interface dynamically with following. The bind option must be specified if pci is
132 not already bound manually by above steps.
133
134 .. code-block:: console
135
136     $ sudo vppctl create interface vmxnet3 0000:0b:00.0 bind
137     $ sudo vppctl set interface state vmxnet3-0/b/0/0 up
138
139 Interface Deletion
140 ~~~~~~~~~~~~~~~~~~
141
142 If the interface needs to be deleted:
143
144 .. code-block:: console
145
146     $ sudo vppctl delete interface vmxnet3 <if-name>
147
148 Show vmxnet3
149 ~~~~~~~~~~~~
150
151 Interface and ring information can be obtained with the command
152 **show vmxnet3 [if-name] [desc]**
153
154 For example:
155
156 .. code-block:: console
157
158     $ sudo vppctl show vmxnet3
159     Interface: vmxnet3-0/b/0/0 (ifindex 1)
160       Version: 1
161       PCI Address: 0000:0b:00.0
162       Mac Address: 00:50:56:88:63:be
163       hw if index: 1
164       Device instance: 0
165       Number of interrupts: 2
166       Queue 0 (RX)
167         RX completion next index 786
168         RX completion generation flag 0x80000000
169         ring 0 size 4096 fill 4094 consume 785 produce 784
170         ring 1 size 4096 fill 4096 consume 0 produce 0
171       Queue 0 (TX)
172         TX completion next index 216
173         TX completion generation flag 0x0
174         size 4096 consume 216 produce 245