Imported Upstream version 16.04
[deb_dpdk.git] / doc / guides / nics / enic.rst
1 ..  BSD LICENSE
2     Copyright (c) 2015, Cisco Systems, Inc.
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     1. Redistributions of source code must retain the above copyright
10     notice, this list of conditions and the following disclaimer.
11
12     2. Redistributions in binary form must reproduce the above copyright
13     notice, this list of conditions and the following disclaimer in
14     the documentation and/or other materials provided with the
15     distribution.
16
17     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18     "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19     LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
20     FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
21     COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
22     INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23     BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24     LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25     CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26     LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
27     ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28     POSSIBILITY OF SUCH DAMAGE.
29
30 ENIC Poll Mode Driver
31 =====================
32
33 ENIC PMD is the DPDK poll-mode driver for the Cisco System Inc. VIC Ethernet
34 NICs. These adapters are also referred to as vNICs below. If you are running
35 or would like to run DPDK software applications on Cisco UCS servers using
36 Cisco VIC adapters the following documentation is relevant.
37
38 Version Information
39 -------------------
40
41 The version of the ENIC PMD driver is 1.0.0.6 and will be printed by ENIC PMD
42 during the initialization.
43
44 How to obtain ENIC PMD integrated DPDK
45 --------------------------------------
46
47 ENIC PMD support is integrated into the DPDK suite. dpdk-<version>.tar.gz
48 should be downloaded from http://dpdk.org
49
50
51 Configuration information
52 -------------------------
53
54 - **DPDK Configuration Parameters**
55
56   The following configuration options are available for the ENIC PMD:
57
58   - **CONFIG_RTE_LIBRTE_ENIC_PMD** (default y): Enables or disables inclusion
59     of the ENIC PMD driver in the DPDK compilation.
60
61   - **CONFIG_RTE_LIBRTE_ENIC_DEBUG** (default n): Enables or disables debug
62     logging within the ENIC PMD driver.
63
64 - **vNIC Configuration Parameters**
65
66   - **Number of Queues**
67
68     The maximum number of receive and transmit queues are configurable on a per
69     vNIC basis through the Cisco UCS Manager (CIMC or UCSM). These values
70     should be configured to be greater than or equal to the nb_rx_q and nb_tx_q
71     parameters expected to  used in the call to the rte_eth_dev_configure()
72     function.
73
74   - **Size of Queues**
75
76     Likewise, the number of receive and transmit descriptors are configurable on
77     a per vNIC bases via the UCS Manager and should be greater than or equal to
78     the nb_rx_desc and   nb_tx_desc parameters expected to be used in the calls
79     to rte_eth_rx_queue_setup() and rte_eth_tx_queue_setup() respectively.
80
81   - **Interrupts**
82
83     Only one interrupt per vNIC interface should be configured in the UCS
84     manager regardless of the number receive/transmit queues. The ENIC PMD
85     uses this interrupt to   get information about errors in the fast path.
86
87 Limitations
88 -----------
89
90 - **VLAN 0 Priority Tagging**
91
92   If a vNIC is configured in TRUNK mode by the UCS manager, the adapter will
93   priority tag egress packets according to 802.1Q if they were not already
94   VLAN tagged by software. If the adapter is connected to a properly configured
95   switch, there will be no unexpected behavior.
96
97   In test setups where an Ethernet port of a Cisco adapter in TRUNK mode is
98   connected point-to-point to another adapter port or connected though a router
99   instead of a switch, all ingress packets will be VLAN tagged. Programs such
100   as l3fwd which do not account for VLAN tags in packets will misbehave. The
101   solution is to enable VLAN stripping on ingress. The follow code fragment is
102   example of how to accomplish this:
103
104 .. code-block:: console
105
106      vlan_offload = rte_eth_dev_get_vlan_offload(port);
107      vlan_offload |= ETH_VLAN_STRIP_OFFLOAD;
108      rte_eth_dev_set_vlan_offload(port, vlan_offload);
109
110 How to build the suite?
111 -----------------------
112 The build instructions for the DPDK suite should be followed. By default
113 the ENIC PMD library will be built into the DPDK library.
114
115 For configuring and using UIO and VFIO frameworks, please refer the
116 documentation that comes with DPDK suite.
117
118 Supported Cisco VIC adapters
119 ----------------------------
120
121 ENIC PMD supports all recent generations of Cisco VIC adapters including:
122
123 - VIC 1280
124 - VIC 1240
125 - VIC 1225
126 - VIC 1285
127 - VIC 1225T
128 - VIC 1227
129 - VIC 1227T
130 - VIC 1380
131 - VIC 1340
132 - VIC 1385
133 - VIC 1387
134
135 - Flow director features are not supported on generation 1 Cisco VIC adapters
136    (M81KR and P81E)
137
138 Supported Operating Systems
139 ---------------------------
140 Any Linux distribution fulfilling the conditions described in Dependencies
141 section of DPDK documentation.
142
143 Supported features
144 ------------------
145 - Unicast, multicast and broadcast transmission and reception
146 - Receive queue polling
147 - Port Hardware Statistics
148 - Hardware VLAN acceleration
149 - IP checksum offload
150 - Receive side VLAN stripping
151 - Multiple receive and transmit queues
152 - Flow Director ADD, UPDATE, DELETE, STATS operation support for IPV4 5-TUPLE
153   flows
154 - Promiscuous mode
155 - Setting RX VLAN (supported via UCSM/CIMC only)
156 - VLAN filtering (supported via UCSM/CIMC only)
157 - Execution of application by unprivileged system users
158 - IPV4, IPV6 and TCP RSS hashing
159
160 Known bugs and Unsupported features in this release
161 ---------------------------------------------------
162 - Signature or flex byte based flow direction
163 - Drop feature of flow direction
164 - VLAN based flow direction
165 - non-IPV4 flow direction
166 - Setting of extended VLAN
167 - UDP RSS hashing
168
169 Prerequisites
170 -------------
171 - Prepare the system as recommended by DPDK suite.  This includes environment
172   variables, hugepages configuration, tool-chains and configuration
173 - Insert vfio-pci kernel module using the command 'modprobe vfio-pci' if the
174   user wants to use VFIO framework
175 - Insert uio kernel module using the command 'modprobe uio' if the user wants
176   to use UIO framework
177 - DPDK suite should be configured based on the user's decision to use VFIO or
178   UIO framework
179 - If the vNIC device(s) to be used is bound to the kernel mode Ethernet driver
180   (enic), use 'ifconfig' to bring the interface down. The dpdk_nic_bind.py tool
181   can then be used to unbind the device's bus id from the enic kernel mode
182   driver.
183 - Bind the intended vNIC to vfio-pci in case the user wants ENIC PMD to use
184   VFIO framework using dpdk_nic_bind.py.
185 - Bind the intended vNIC to igb_uio in case the user wants ENIC PMD to use
186   UIO framework using dpdk_nic_bind.py.
187
188 At this point the system should be ready to run DPDK applications. Once the
189 application runs to completion, the vNIC can be detached from vfio-pci or
190 igb_uio if necessary.
191
192 Root privilege is required to bind and unbind vNICs to/from VFIO/UIO.
193 VFIO framework helps an unprivileged user to run the applications.
194 For an unprivileged user to run the applications on DPDK and ENIC PMD,
195 it may be necessary to increase the maximum locked memory of the user.
196 The following command could be used to do this.
197
198 .. code-block:: console
199
200     sudo sh -c "ulimit -l <value in Kilo Bytes>"
201
202 The value depends on the memory configuration of the application, DPDK and
203 PMD.  Typically, the limit has to be raised to higher than 2GB.
204 e.g., 2621440
205
206 The compilation of any unused drivers can be disabled using the
207 configuration file in config/ directory (e.g., config/common_linuxapp).
208 This would help in bringing down the time taken for building the
209 libraries and the initialization time of the application.
210
211 Additional Reference
212 --------------------
213 - http://www.cisco.com/c/en/us/products/servers-unified-computing
214
215 Contact Information
216 -------------------
217 Any questions or bugs should be reported to DPDK community and to the ENIC PMD
218 maintainers:
219
220 - John Daley <johndale@cisco.com>
221 - Nelson Escobar <neescoba@cisco.com>