blob: f3ec8d4b6f6420d074c450caea33a0162396d0ff [file] [log] [blame]
jdenisco82b22f72018-12-17 15:45:21 -05001.. _vmxnet3:
2
3VPP with VMware/Vmxnet3
4=======================
5
6This section describes a native Vmxnet3 driver that is included with VPP.
7This driver is written as a plugin and is found in src/plugin/vmxnet3.
8
9Advantages
10----------
11
12The native VPP native vmxnet3 driver provides the following features
13that are not provided with the standard dpdk vmxnet3 driver.
14
15- Interrupt mode
16- Adaptive mode
Steven Luong1ea74b52019-03-19 14:35:29 -070017- LRO/TSO mode
jdenisco82b22f72018-12-17 15:45:21 -050018
19Does not support
20----------------
21
22This driver does yet support the following features.
23
jdenisco82b22f72018-12-17 15:45:21 -050024- VLAN filter
25
26Prerequisites
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
Steven Luong1ea74b52019-03-19 14:35:29 -070032- This code is tested with ESXi vSwitch version 6.5 and 6.7 for LRO/TSO support,
Steven Luongee94ffa2019-03-14 12:07:29 -070033 VMware Workstation 15 Pro (no LRO/TSO), and VMware Fusion 11 Pro (no LRO/TSO).
jdenisco82b22f72018-12-17 15:45:21 -050034
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
jdeniscof5de0362019-01-30 10:43:43 -050040VMware Fusion for Mac
41---------------------
42
43VMware fusion does not have a menu option to change the default driver (e1000)
44to the **vmxnet3** driver. VPP supports the **vmxnet3** driver.
45
Steven Luongee94ffa2019-03-14 12:07:29 -070046These instructions describe how to change the e1000 driver for VMware fusion.
jdeniscof5de0362019-01-30 10:43:43 -050047
Steven Luong1ea74b52019-03-19 14:35:29 -070048* From the VMware Fusion menu bar select **Window** then **Virtual Machine
49 Library**.
50* From the Virtual Machine menu right click on the Virtual Machine you are using
51 and select **Show in Finder**
52* Find the name associated with the VM you are using, right click on it and
53 select **Show Package Contents**
jdeniscof5de0362019-01-30 10:43:43 -050054* Find the **.vmx** file and edit it.
Jim Thompsonf324dec2019-04-08 03:22:21 -050055* Find all the occurrences of **e1000** and change them to **vmxnet3**
jdeniscof5de0362019-01-30 10:43:43 -050056
Steven Luong1ea74b52019-03-19 14:35:29 -070057If you are concerned more with configuration not performance the vmxnet3 driver
58can be set to **interrupt** mode in VPP. This will save a great deal on battery
59usage. Do this with the following
jdeniscof5de0362019-01-30 10:43:43 -050060
Steven Luongee94ffa2019-03-14 12:07:29 -070061VMware Workstatiom PRO 15 for Linux
62-----------------------------------
63
Steven Luong1ea74b52019-03-19 14:35:29 -070064VMware Workstation does not have a menu option to change the default driver
65(e1000) to the **vmxnet3** driver. VPP supports the **vmxnet3** driver.
Steven Luongee94ffa2019-03-14 12:07:29 -070066
Steven Luong1ea74b52019-03-19 14:35:29 -070067These instructions describe how to change the e1000 driver for VMware
68Workstation PRO 15 Linux. You may need to be a superuser for performing these
69steps.
Steven Luongee94ffa2019-03-14 12:07:29 -070070
71* Shut down the VM you are about to change.
Steven Luong1ea74b52019-03-19 14:35:29 -070072* From the vmware folder where vmware creates and stores the VM's, change the
73 directory to the specific VM which you want to modify, and use your favorite
74 text editor to open the corresponding VM's .vmx file. By default, it is
75 $HOME/vmware/<vm-name>/<vm-name>.vmx
76* Locate the line for the interface which you want to modify. For example, if it
77 is ethernet1, then change the line **ethernet1.virtualDev = "e1000"** to
78 **ethernet1.virtualDev = "vmxnet3"**
Steven Luongee94ffa2019-03-14 12:07:29 -070079* Save the file and power on the VM.
80
Steven Luong1ea74b52019-03-19 14:35:29 -070081If you are concerned more with configuration not performance the vmxnet3 driver
82can be set to **interrupt** mode in VPP. This will save a great deal on battery
83usage. Do this with the following
Steven Luongee94ffa2019-03-14 12:07:29 -070084
jdeniscof5de0362019-01-30 10:43:43 -050085.. code-block:: console
86
Steven Luongee94ffa2019-03-14 12:07:29 -070087 $ sudo vppctl set interface rx-mode <interface> interrupt
jdeniscof5de0362019-01-30 10:43:43 -050088
89
jdenisco82b22f72018-12-17 15:45:21 -050090System setup
91~~~~~~~~~~~~
92
93To use the native VPP vmxnet3 driver use the following Steps
94
95Load VFIO driver
96
97.. code-block:: console
98
99 $ sudo modprobe vfio-pci
100
Steven Luongee94ffa2019-03-14 12:07:29 -0700101Make sure the interface is down
102
103.. code-block:: console
104
105 $ sudo ifconfig <if-name> down
106
Steven Luong1ea74b52019-03-19 14:35:29 -0700107The next 2 steps are optional and may be accomplished by specifying the optional
108"bind" keyword when creating the vmxnet3 interface.
Steven Luongee94ffa2019-03-14 12:07:29 -0700109
jdenisco82b22f72018-12-17 15:45:21 -0500110For systems without IOMMU only, enable unsafe NOIOMMU mode
111
112.. code-block:: console
113
114 $ echo Y | sudo tee /sys/module/vfio/parameters/enable_unsafe_noiommu_mode
115
Steven Luong1ea74b52019-03-19 14:35:29 -0700116To bind interface to vfio-pci first install the :ref:`configutil`. This will
117download the dpdk_devbind.py script. It is located in
118*/usr/vpp/vpp-config/scripts* with Centos and
119*/usr/local/vpp/vpp-config/scripts* with Ubuntu.
jdenisco82b22f72018-12-17 15:45:21 -0500120
121Bind the driver with the following commands:
122
123.. code-block:: console
124
125 $ sudo /usr/local/vpp/vpp-config/scripts/dpdk-devbind.py -s
126
127 Network devices using DPDK-compatible driver
128 ============================================
129 <none>
130
131 Network devices using kernel driver
132 ===================================
133 0000:03:00.0 'VMXNET3 Ethernet Controller' if=ens160 drv=vmxnet3 unused=vfio-pci,uio_pci_generic
134 0000:0b:00.0 'VMXNET3 Ethernet Controller' drv=vfio-pci unused=vmxnet3,uio_pci_generic
135 0000:13:00.0 'VMXNET3 Ethernet Controller' drv=vfio-pci unused=vmxnet3,uio_pci_generic
136 .....
137
138 $ sudo /usr/local/vpp/vpp-config/scripts/dpdk-devbind.py --bind vfio-pci 0b:00.0
139
140
141Interface Creation
142~~~~~~~~~~~~~~~~~~
143
Steven Luong1ea74b52019-03-19 14:35:29 -0700144Now create the interface dynamically with following. The bind option must be
145specified if pci is not already bound manually by above steps.
jdenisco82b22f72018-12-17 15:45:21 -0500146
147.. code-block:: console
148
Steven Luongee94ffa2019-03-14 12:07:29 -0700149 $ sudo vppctl create interface vmxnet3 0000:0b:00.0 bind
150 $ sudo vppctl set interface state vmxnet3-0/b/0/0 up
jdenisco82b22f72018-12-17 15:45:21 -0500151
152Interface Deletion
153~~~~~~~~~~~~~~~~~~
154
155If the interface needs to be deleted:
156
157.. code-block:: console
158
Steven Luongee94ffa2019-03-14 12:07:29 -0700159 $ sudo vppctl delete interface vmxnet3 <if-name>
jdenisco82b22f72018-12-17 15:45:21 -0500160
161Show vmxnet3
162~~~~~~~~~~~~
163
164Interface and ring information can be obtained with the command
165**show vmxnet3 [if-name] [desc]**
166
167For example:
168
169.. code-block:: console
170
Steven Luongee94ffa2019-03-14 12:07:29 -0700171 $ sudo vppctl show vmxnet3
jdenisco82b22f72018-12-17 15:45:21 -0500172 Interface: vmxnet3-0/b/0/0 (ifindex 1)
173 Version: 1
174 PCI Address: 0000:0b:00.0
175 Mac Address: 00:50:56:88:63:be
176 hw if index: 1
177 Device instance: 0
178 Number of interrupts: 2
179 Queue 0 (RX)
180 RX completion next index 786
181 RX completion generation flag 0x80000000
182 ring 0 size 4096 fill 4094 consume 785 produce 784
183 ring 1 size 4096 fill 4096 consume 0 produce 0
184 Queue 0 (TX)
185 TX completion next index 216
186 TX completion generation flag 0x0
187 size 4096 consume 216 produce 245