vmxnet3.rst revision 97f17497
1..  BSD LICENSE
2    Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
3    All rights reserved.
4
5    Redistribution and use in source and binary forms, with or without
6    modification, are permitted provided that the following conditions
7    are met:
8
9    * Redistributions of source code must retain the above copyright
10    notice, this list of conditions and the following disclaimer.
11    * Redistributions in binary form must reproduce the above copyright
12    notice, this list of conditions and the following disclaimer in
13    the documentation and/or other materials provided with the
14    distribution.
15    * Neither the name of Intel Corporation nor the names of its
16    contributors may be used to endorse or promote products derived
17    from this software without specific prior written permission.
18
19    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20    "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22    A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23    OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24    SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25    LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26    DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27    THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29    OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
31Poll Mode Driver for Paravirtual VMXNET3 NIC
32============================================
33
34The VMXNET3 adapter is the next generation of a paravirtualized NIC, introduced by VMware* ESXi.
35It is designed for performance and is not related to VMXNET or VMXENET2.
36It offers all the features available in VMXNET2, and adds several new features such as,
37multi-queue support (also known as Receive Side Scaling, RSS),
38IPv6 offloads, and MSI/MSI-X interrupt delivery.
39Because operating system vendors do not provide built-in drivers for this card,
40VMware Tools must be installed to have a driver for the VMXNET3 network adapter available.
41One can use the same device in a DPDK application with VMXNET3 PMD introduced in DPDK API.
42
43Currently, the driver provides basic support for using the device in a DPDK application running on a guest OS.
44Optimization is needed on the backend, that is, the VMware* ESXi vmkernel switch, to achieve optimal performance end-to-end.
45
46In this chapter, two setups with the use of the VMXNET3 PMD are demonstrated:
47
48#.  Vmxnet3 with a native NIC connected to a vSwitch
49
50#.  Vmxnet3 chaining VMs connected to a vSwitch
51
52VMXNET3 Implementation in the DPDK
53----------------------------------
54
55For details on the VMXNET3 device, refer to the VMXNET3 driver's vmxnet3 directory and support manual from VMware*.
56
57For performance details, refer to the following link from VMware:
58
59`http://www.vmware.com/pdf/vsp_4_vmxnet3_perf.pdf <http://www.vmware.com/pdf/vsp_4_vmxnet3_perf.pdf>`_
60
61As a PMD, the VMXNET3 driver provides the packet reception and transmission callbacks, vmxnet3_recv_pkts and vmxnet3_xmit_pkts.
62It does not support scattered packet reception as part of vmxnet3_recv_pkts and vmxnet3_xmit_pkts.
63Also, it does not support scattered packet reception as part of the device operations supported.
64
65The VMXNET3 PMD handles all the packet buffer memory allocation and resides in guest address space
66and it is solely responsible to free that memory when not needed.
67The packet buffers and features to be supported are made available to hypervisor via VMXNET3 PCI configuration space BARs.
68During RX/TX, the packet buffers are exchanged by their GPAs,
69and the hypervisor loads the buffers with packets in the RX case and sends packets to vSwitch in the TX case.
70
71The VMXNET3 PMD is compiled with vmxnet3 device headers.
72The interface is similar to that of the other PMDs available in the DPDK API.
73The driver pre-allocates the packet buffers and loads the command ring descriptors in advance.
74The hypervisor fills those packet buffers on packet arrival and write completion ring descriptors,
75which are eventually pulled by the PMD.
76After reception, the DPDK application frees the descriptors and loads new packet buffers for the coming packets.
77The interrupts are disabled and there is no notification required.
78This keeps performance up on the RX side, even though the device provides a notification feature.
79
80In the transmit routine, the DPDK application fills packet buffer pointers in the descriptors of the command ring
81and notifies the hypervisor.
82In response the hypervisor takes packets and passes them to the vSwitch. It writes into the completion descriptors ring.
83The rings are read by the PMD in the next transmit routine call and the buffers and descriptors are freed from memory.
84
85Features and Limitations of VMXNET3 PMD
86---------------------------------------
87
88In release 1.6.0, the VMXNET3 PMD provides the basic functionality of packet reception and transmission.
89There are several options available for filtering packets at VMXNET3 device level including:
90
91#.  MAC Address based filtering:
92
93    *   Unicast, Broadcast, All Multicast modes - SUPPORTED BY DEFAULT
94
95    *   Multicast with Multicast Filter table - NOT SUPPORTED
96
97    *   Promiscuous mode - SUPPORTED
98
99    *   RSS based load balancing between queues - SUPPORTED
100
101#.  VLAN filtering:
102
103    *   VLAN tag based filtering without load balancing - SUPPORTED
104
105.. note::
106
107
108    *   Release 1.6.0 does not support separate headers and body receive cmd_ring and hence,
109        multiple segment buffers are not supported.
110        Only cmd_ring_0 is used for packet buffers, one for each descriptor.
111
112    *   Receive and transmit of scattered packets is not supported.
113
114    *   Multicast with Multicast Filter table is not supported.
115
116Prerequisites
117-------------
118
119The following prerequisites apply:
120
121*   Before starting a VM, a VMXNET3 interface to a VM through VMware vSphere Client must be assigned.
122    This is shown in the figure below.
123
124.. _figure_vmxnet3_int:
125
126.. figure:: img/vmxnet3_int.*
127
128   Assigning a VMXNET3 interface to a VM using VMware vSphere Client
129
130.. note::
131
132    Depending on the Virtual Machine type, the VMware vSphere Client shows Ethernet adaptors while adding an Ethernet device.
133    Ensure that the VM type used offers a VMXNET3 device. Refer to the VMware documentation for a listed of VMs.
134
135.. note::
136
137    Follow the *DPDK Getting Started Guide* to setup the basic DPDK environment.
138
139.. note::
140
141    Follow the *DPDK Sample Application's User Guide*, L2 Forwarding/L3 Forwarding and
142    TestPMD for instructions on how to run a DPDK application using an assigned VMXNET3 device.
143
144VMXNET3 with a Native NIC Connected to a vSwitch
145------------------------------------------------
146
147This section describes an example setup for Phy-vSwitch-VM-Phy communication.
148
149.. _figure_vswitch_vm:
150
151.. figure:: img/vswitch_vm.*
152
153   VMXNET3 with a Native NIC Connected to a vSwitch
154
155.. note::
156
157    Other instructions on preparing to use DPDK such as, hugepage enabling, uio port binding are not listed here.
158    Please refer to *DPDK Getting Started Guide and DPDK Sample Application's User Guide* for detailed instructions.
159
160The packet reception and transmission flow path is::
161
162    Packet generator -> 82576
163                     -> VMware ESXi vSwitch
164                     -> VMXNET3 device
165                     -> Guest VM VMXNET3 port 0 rx burst
166                     -> Guest VM 82599 VF port 0 tx burst
167                     -> 82599 VF
168                     -> Packet generator
169
170VMXNET3 Chaining VMs Connected to a vSwitch
171-------------------------------------------
172
173The following figure shows an example VM-to-VM communication over a Phy-VM-vSwitch-VM-Phy communication channel.
174
175.. _figure_vm_vm_comms:
176
177.. figure:: img/vm_vm_comms.*
178
179   VMXNET3 Chaining VMs Connected to a vSwitch
180
181.. note::
182
183    When using the L2 Forwarding or L3 Forwarding applications,
184    a destination MAC address needs to be written in packets to hit the other VM's VMXNET3 interface.
185
186In this example, the packet flow path is::
187
188    Packet generator -> 82599 VF
189                     -> Guest VM 82599 port 0 rx burst
190                     -> Guest VM VMXNET3 port 1 tx burst
191                     -> VMXNET3 device
192                     -> VMware ESXi vSwitch
193                     -> VMXNET3 device
194                     -> Guest VM VMXNET3 port 0 rx burst
195                     -> Guest VM 82599 VF port 1 tx burst
196                     -> 82599 VF
197                     -> Packet generator
198