Imported Upstream version 16.11
[deb_dpdk.git] / doc / guides / nics / vmxnet3.rst
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
31 Poll Mode Driver for Paravirtual VMXNET3 NIC
32 ============================================
33
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.
39
40 In this chapter, two setups with the use of the VMXNET3 PMD are demonstrated:
41
42 #.  Vmxnet3 with a native NIC connected to a vSwitch
43
44 #.  Vmxnet3 chaining VMs connected to a vSwitch
45
46 VMXNET3 Implementation in the DPDK
47 ----------------------------------
48
49 For details on the VMXNET3 device, refer to the VMXNET3 driver's vmxnet3 directory and support manual from VMware*.
50
51 For performance details, refer to the following link from VMware:
52
53 `http://www.vmware.com/pdf/vsp_4_vmxnet3_perf.pdf <http://www.vmware.com/pdf/vsp_4_vmxnet3_perf.pdf>`_
54
55 As a PMD, the VMXNET3 driver provides the packet reception and transmission callbacks, vmxnet3_recv_pkts and vmxnet3_xmit_pkts.
56
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.
62
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.
71
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.
76
77 Features and Limitations of VMXNET3 PMD
78 ---------------------------------------
79
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:
82
83 #.  MAC Address based filtering:
84
85     *   Unicast, Broadcast, All Multicast modes - SUPPORTED BY DEFAULT
86
87     *   Multicast with Multicast Filter table - NOT SUPPORTED
88
89     *   Promiscuous mode - SUPPORTED
90
91     *   RSS based load balancing between queues - SUPPORTED
92
93 #.  VLAN filtering:
94
95     *   VLAN tag based filtering without load balancing - SUPPORTED
96
97 .. note::
98
99
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.
103
104     *   Receive and transmit of scattered packets is not supported.
105
106     *   Multicast with Multicast Filter table is not supported.
107
108 Prerequisites
109 -------------
110
111 The following prerequisites apply:
112
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.
115
116 .. _figure_vmxnet3_int:
117
118 .. figure:: img/vmxnet3_int.*
119
120    Assigning a VMXNET3 interface to a VM using VMware vSphere Client
121
122 .. note::
123
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.
126
127 .. note::
128
129     Follow the *DPDK Getting Started Guide* to setup the basic DPDK environment.
130
131 .. note::
132
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.
135
136 VMXNET3 with a Native NIC Connected to a vSwitch
137 ------------------------------------------------
138
139 This section describes an example setup for Phy-vSwitch-VM-Phy communication.
140
141 .. _figure_vswitch_vm:
142
143 .. figure:: img/vswitch_vm.*
144
145    VMXNET3 with a Native NIC Connected to a vSwitch
146
147 .. note::
148
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.
151
152 The packet reception and transmission flow path is::
153
154     Packet generator -> 82576
155                      -> VMware ESXi vSwitch
156                      -> VMXNET3 device
157                      -> Guest VM VMXNET3 port 0 rx burst
158                      -> Guest VM 82599 VF port 0 tx burst
159                      -> 82599 VF
160                      -> Packet generator
161
162 VMXNET3 Chaining VMs Connected to a vSwitch
163 -------------------------------------------
164
165 The following figure shows an example VM-to-VM communication over a Phy-VM-vSwitch-VM-Phy communication channel.
166
167 .. _figure_vm_vm_comms:
168
169 .. figure:: img/vm_vm_comms.*
170
171    VMXNET3 Chaining VMs Connected to a vSwitch
172
173 .. note::
174
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.
177
178 In this example, the packet flow path is::
179
180     Packet generator -> 82599 VF
181                      -> Guest VM 82599 port 0 rx burst
182                      -> Guest VM VMXNET3 port 1 tx burst
183                      -> VMXNET3 device
184                      -> VMware ESXi vSwitch
185                      -> VMXNET3 device
186                      -> Guest VM VMXNET3 port 0 rx burst
187                      -> Guest VM 82599 VF port 1 tx burst
188                      -> 82599 VF
189                      -> Packet generator