83ee68b8aa39a040d3d69f1d49de53c48290fbe1
[dpdk.git] / doc / guides / prog_guide / poll_mode_drv_paravirtual_vmxnets_nic.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 and is not related to VMXNET or VMXENET2.
36 It offers all the features available in VMXNET2, and adds several new features such as,
37 multi-queue support (also known as Receive Side Scaling, RSS),
38 IPv6 offloads, and MSI/MSI-X interrupt delivery.
39 Because operating system vendors do not provide built-in drivers for this card,
40 VMware Tools must be installed to have a driver for the VMXNET3 network adapter available.
41 One can use the same device in an Intel® DPDK application with VMXNET3 PMD introduced in Intel® DPDK API.
42
43 Currently, the driver provides basic support for using the device in an Intel® DPDK application running on a guest OS.
44 Optimization is needed on the backend, that is, the VMware* ESXi vmkernel switch, to achieve optimal performance end-to-end.
45
46 In 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
52 VMXNET3 Implementation in the Intel® DPDK
53 -----------------------------------------
54
55 For details on the VMXNET3 device, refer to the VMXNET3 driver's vmxnet3 directory and support manual from VMware*.
56
57 For 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
61 As a PMD, the VMXNET3 driver provides the packet reception and transmission callbacks, vmxnet3_recv_pkts and vmxnet3_xmit_pkts.
62 It does not support scattered packet reception as part of vmxnet3_recv_pkts and vmxnet3_xmit_pkts.
63 Also, it does not support scattered packet reception as part of the device operations supported.
64
65 The VMXNET3 PMD handles all the packet buffer memory allocation and resides in guest address space
66 and it is solely responsible to free that memory when not needed.
67 The packet buffers and features to be supported are made available to hypervisor via VMXNET3 PCI configuration space BARs.
68 During RX/TX, the packet buffers are exchanged by their GPAs,
69 and the hypervisor loads the buffers with packets in the RX case and sends packets to vSwitch in the TX case.
70
71 The VMXNET3 PMD is compiled with vmxnet3 device headers.
72 The interface is similar to that of the other PMDs available in the Intel® DPDK API.
73 The driver pre-allocates the packet buffers and loads the command ring descriptors in advance.
74 The hypervisor fills those packet buffers on packet arrival and write completion ring descriptors,
75 which are eventually pulled by the PMD.
76 After reception, the Intel® DPDK application frees the descriptors and loads new packet buffers for the coming packets.
77 The interrupts are disabled and there is no notification required.
78 This keeps performance up on the RX side, even though the device provides a notification feature.
79
80 In the transmit routine, the Intel® DPDK application fills packet buffer pointers in the descriptors of the command ring
81 and notifies the hypervisor.
82 In response the hypervisor takes packets and passes them to the vSwitch. It writes into the completion descriptors ring.
83 The rings are read by the PMD in the next transmit routine call and the buffers and descriptors are freed from memory.
84
85 Features and Limitations of VMXNET3 PMD
86 ---------------------------------------
87
88 In release 1.6.0, the VMXNET3 PMD provides the basic functionality of packet reception and transmission.
89 There 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
116 Prerequisites
117 -------------
118
119 The 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 .. image32_png has been renamed
125
126 |vmxnet3_int|
127
128 .. note::
129
130     Depending on the Virtual Machine type, the VMware vSphere Client shows Ethernet adaptors while adding an Ethernet device.
131     Ensure that the VM type used offers a VMXNET3 device. Refer to the VMware documentation for a listed of VMs.
132
133 .. note::
134
135     Follow the *Intel® DPDK Getting Started Guide* to setup the basic Intel® DPDK environment.
136
137 .. note::
138
139     Follow the *Intel® DPDK Sample Application's User Guide*, L2 Forwarding/L3 Forwarding and
140     TestPMD for instructions on how to run an Intel® DPDK application using an assigned VMXNET3 device.
141
142 VMXNET3 with a Native NIC Connected to a vSwitch
143 ------------------------------------------------
144
145 This section describes an example setup for Phy-vSwitch-VM-Phy communication.
146
147 .. image33_png has been renamed
148
149 |vswitch_vm|
150
151 .. note::
152
153     Other instructions on preparing to use Intel® DPDK such as, hugepage enabling, igb_uio port binding are not listed here.
154     Please refer to *Intel® DPDK Getting Started Guide and Intel® DPDK Sample Application's User Guide* for detailed instructions.
155
156 The packet reception and transmission flow path is:
157
158     Packet generator -> 82576 -> VMware ESXi vSwitch -> VMXNET3 device -> Guest VM VMXNET3 port 0 rx burst -> Guest
159     VM 82599 VF port 0 tx burst -> 82599 VF -> Packet generator
160
161 VMXNET3 Chaining VMs Connected to a vSwitch
162 -------------------------------------------
163
164 The following figure shows an example VM-to-VM communication over a Phy-VM-vSwitch-VM-Phy communication channel.
165
166 .. image34_png has been renamed
167
168 |vm_vm_comms|
169
170 .. note::
171
172     When using the L2 Forwarding or L3 Forwarding applications,
173     a destination MAC address needs to be written in packets to hit the other VM's VMXNET3 interface.
174
175 In this example, the packet flow path is:
176
177     Packet generator -> 82599 VF -> Guest VM 82599 port 0 rx burst -> Guest VM VMXNET3 port 1 tx burst -> VMXNET3
178     device -> VMware ESXi vSwitch -> VMXNET3 device -> Guest VM VMXNET3 port 0 rx burst -> Guest VM 82599 VF port 1 tx burst -> 82599 VF -> Packet generator
179
180 .. |vm_vm_comms| image:: img/vm_vm_comms.png
181
182 .. |vmxnet3_int| image:: img/vmxnet3_int.png
183
184 .. |vswitch_vm| image:: img/vswitch_vm.png