2 Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
5 Redistribution and use in source and binary forms, with or without
6 modification, are permitted provided that the following conditions
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
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.
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.
31 Poll Mode Driver for Paravirtual VMXNET3 NIC
32 ============================================
34 The VMXNET3 adapter is the next generation of a paravirtualized NIC, introduced by VMware* ESXi.
35 It is designed for performance, offers all the features available in VMXNET2, and adds several new features such as,
36 multi-queue support (also known as Receive Side Scaling, RSS),
37 IPv6 offloads, and MSI/MSI-X interrupt delivery.
38 One can use the same device in a DPDK application with VMXNET3 PMD introduced in DPDK API.
40 In this chapter, two setups with the use of the VMXNET3 PMD are demonstrated:
42 #. Vmxnet3 with a native NIC connected to a vSwitch
44 #. Vmxnet3 chaining VMs connected to a vSwitch
46 VMXNET3 Implementation in the DPDK
47 ----------------------------------
49 For details on the VMXNET3 device, refer to the VMXNET3 driver's vmxnet3 directory and support manual from VMware*.
51 For performance details, refer to the following link from VMware:
53 `http://www.vmware.com/pdf/vsp_4_vmxnet3_perf.pdf <http://www.vmware.com/pdf/vsp_4_vmxnet3_perf.pdf>`_
55 As a PMD, the VMXNET3 driver provides the packet reception and transmission callbacks, vmxnet3_recv_pkts and vmxnet3_xmit_pkts.
57 The VMXNET3 PMD handles all the packet buffer memory allocation and resides in guest address space
58 and it is solely responsible to free that memory when not needed.
59 The packet buffers and features to be supported are made available to hypervisor via VMXNET3 PCI configuration space BARs.
60 During RX/TX, the packet buffers are exchanged by their GPAs,
61 and the hypervisor loads the buffers with packets in the RX case and sends packets to vSwitch in the TX case.
63 The VMXNET3 PMD is compiled with vmxnet3 device headers.
64 The interface is similar to that of the other PMDs available in the DPDK API.
65 The driver pre-allocates the packet buffers and loads the command ring descriptors in advance.
66 The hypervisor fills those packet buffers on packet arrival and write completion ring descriptors,
67 which are eventually pulled by the PMD.
68 After reception, the DPDK application frees the descriptors and loads new packet buffers for the coming packets.
69 The interrupts are disabled and there is no notification required.
70 This keeps performance up on the RX side, even though the device provides a notification feature.
72 In the transmit routine, the DPDK application fills packet buffer pointers in the descriptors of the command ring
73 and notifies the hypervisor.
74 In response the hypervisor takes packets and passes them to the vSwitch, It writes into the completion descriptors ring.
75 The rings are read by the PMD in the next transmit routine call and the buffers and descriptors are freed from memory.
77 Features and Limitations of VMXNET3 PMD
78 ---------------------------------------
80 In release 1.6.0, the VMXNET3 PMD provides the basic functionality of packet reception and transmission.
81 There are several options available for filtering packets at VMXNET3 device level including:
83 #. MAC Address based filtering:
85 * Unicast, Broadcast, All Multicast modes - SUPPORTED BY DEFAULT
87 * Multicast with Multicast Filter table - NOT SUPPORTED
89 * Promiscuous mode - SUPPORTED
91 * RSS based load balancing between queues - SUPPORTED
95 * VLAN tag based filtering without load balancing - SUPPORTED
100 * Release 1.6.0 does not support separate headers and body receive cmd_ring and hence,
101 multiple segment buffers are not supported.
102 Only cmd_ring_0 is used for packet buffers, one for each descriptor.
104 * Receive and transmit of scattered packets is not supported.
106 * Multicast with Multicast Filter table is not supported.
111 The following prerequisites apply:
113 * Before starting a VM, a VMXNET3 interface to a VM through VMware vSphere Client must be assigned.
114 This is shown in the figure below.
116 .. _figure_vmxnet3_int:
118 .. figure:: img/vmxnet3_int.*
120 Assigning a VMXNET3 interface to a VM using VMware vSphere Client
124 Depending on the Virtual Machine type, the VMware vSphere Client shows Ethernet adaptors while adding an Ethernet device.
125 Ensure that the VM type used offers a VMXNET3 device. Refer to the VMware documentation for a listed of VMs.
129 Follow the *DPDK Getting Started Guide* to setup the basic DPDK environment.
133 Follow the *DPDK Sample Application's User Guide*, L2 Forwarding/L3 Forwarding and
134 TestPMD for instructions on how to run a DPDK application using an assigned VMXNET3 device.
136 VMXNET3 with a Native NIC Connected to a vSwitch
137 ------------------------------------------------
139 This section describes an example setup for Phy-vSwitch-VM-Phy communication.
141 .. _figure_vswitch_vm:
143 .. figure:: img/vswitch_vm.*
145 VMXNET3 with a Native NIC Connected to a vSwitch
149 Other instructions on preparing to use DPDK such as, hugepage enabling, uio port binding are not listed here.
150 Please refer to *DPDK Getting Started Guide and DPDK Sample Application's User Guide* for detailed instructions.
152 The packet reception and transmission flow path is::
154 Packet generator -> 82576
155 -> VMware ESXi vSwitch
157 -> Guest VM VMXNET3 port 0 rx burst
158 -> Guest VM 82599 VF port 0 tx burst
162 VMXNET3 Chaining VMs Connected to a vSwitch
163 -------------------------------------------
165 The following figure shows an example VM-to-VM communication over a Phy-VM-vSwitch-VM-Phy communication channel.
167 .. _figure_vm_vm_comms:
169 .. figure:: img/vm_vm_comms.*
171 VMXNET3 Chaining VMs Connected to a vSwitch
175 When using the L2 Forwarding or L3 Forwarding applications,
176 a destination MAC address needs to be written in packets to hit the other VM's VMXNET3 interface.
178 In this example, the packet flow path is::
180 Packet generator -> 82599 VF
181 -> Guest VM 82599 port 0 rx burst
182 -> Guest VM VMXNET3 port 1 tx burst
184 -> VMware ESXi vSwitch
186 -> Guest VM VMXNET3 port 0 rx burst
187 -> Guest VM 82599 VF port 1 tx burst