2 Copyright (c) 2015, Cisco Systems, Inc.
5 Redistribution and use in source and binary forms, with or without
6 modification, are permitted provided that the following conditions
9 1. Redistributions of source code must retain the above copyright
10 notice, this list of conditions and the following disclaimer.
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
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.
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.
38 How to obtain ENIC PMD integrated DPDK
39 --------------------------------------
41 ENIC PMD support is integrated into the DPDK suite. dpdk-<version>.tar.gz
42 should be downloaded from http://dpdk.org
45 Configuration information
46 -------------------------
48 - **DPDK Configuration Parameters**
50 The following configuration options are available for the ENIC PMD:
52 - **CONFIG_RTE_LIBRTE_ENIC_PMD** (default y): Enables or disables inclusion
53 of the ENIC PMD driver in the DPDK compilation.
55 - **CONFIG_RTE_LIBRTE_ENIC_DEBUG** (default n): Enables or disables debug
56 logging within the ENIC PMD driver.
58 - **vNIC Configuration Parameters**
60 - **Number of Queues**
62 The maximum number of receive queues (RQs), work queues (WQs) and
63 completion queues (CQs) are configurable on a per vNIC basis
64 through the Cisco UCS Manager (CIMC or UCSM).
66 These values should be configured as follows:
68 - The number of WQs should be greater or equal to the value of the
69 expected nb_tx_q parameter in the call to the
70 rte_eth_dev_configure()
72 - The number of RQs configured in the vNIC should be greater or
73 equal to *twice* the value of the expected nb_rx_q parameter in
74 the call to rte_eth_dev_configure(). With the addition of rx
75 scatter, a pair of RQs on the vnic is needed for each receive
76 queue used by DPDK, even if rx scatter is not being used.
77 Having a vNIC with only 1 RQ is not a valid configuration, and
78 will fail with an error message.
80 - The number of CQs should set so that there is one CQ for each
81 WQ, and one CQ for each pair of RQs.
83 For example: If the application requires 3 Rx queues, and 3 Tx
84 queues, the vNIC should be configured to have at least 3 WQs, 6
85 RQs (3 pairs), and 6 CQs (3 for use by WQs + 3 for use by the 3
90 Likewise, the number of receive and transmit descriptors are configurable on
91 a per vNIC bases via the UCS Manager and should be greater than or equal to
92 the nb_rx_desc and nb_tx_desc parameters expected to be used in the calls
93 to rte_eth_rx_queue_setup() and rte_eth_tx_queue_setup() respectively.
94 An application requesting more than the set size will be limited to that
97 Unless there is a lack of resources due to creating many vNICs, it
98 is recommended that the WQ and RQ sizes be set to the maximum. This
99 gives the application the greatest amount of flexibility in its
102 - *Note*: Since the introduction of rx scatter, for performance
103 reasons, this PMD uses two RQs on the vNIC per receive queue in
104 DPDK. One RQ holds descriptors for the start of a packet the
105 second RQ holds the descriptors for the rest of the fragments of
106 a packet. This means that the nb_rx_desc parameter to
107 rte_eth_rx_queue_setup() can be a greater than 4096. The exact
108 amount will depend on the size of the mbufs being used for
109 receives, and the MTU size.
111 For example: If the mbuf size is 2048, and the MTU is 9000, then
112 receiving a full size packet will take 5 descriptors, 1 from the
113 start of packet queue, and 4 from the second queue. Assuming
114 that the RQ size was set to the maximum of 4096, then the
115 application can specify up to 1024 + 4096 as the nb_rx_desc
116 parameter to rte_eth_rx_queue_setup().
120 Only one interrupt per vNIC interface should be configured in the UCS
121 manager regardless of the number receive/transmit queues. The ENIC PMD
122 uses this interrupt to get information about link status and errors
125 .. _enic-flow-director:
127 Flow director support
128 ---------------------
130 Advanced filtering support was added to 1300 series VIC firmware starting
131 with version 2.0.13 for C-series UCS servers and version 3.1.2 for UCSM
132 managed blade servers. In order to enable advanced filtering the 'Advanced
133 filter' radio button should be enabled via CIMC or UCSM followed by a reboot
136 With advanced filters, perfect matching of all fields of IPv4, IPv6 headers
137 as well as TCP, UDP and SCTP L4 headers is available through flow director.
138 Masking of these feilds for partial match is also supported.
140 Without advanced filter support, the flow director is limited to IPv4
141 perfect filtering of the 5-tuple with no masking of fields supported.
146 - **VLAN 0 Priority Tagging**
148 If a vNIC is configured in TRUNK mode by the UCS manager, the adapter will
149 priority tag egress packets according to 802.1Q if they were not already
150 VLAN tagged by software. If the adapter is connected to a properly configured
151 switch, there will be no unexpected behavior.
153 In test setups where an Ethernet port of a Cisco adapter in TRUNK mode is
154 connected point-to-point to another adapter port or connected though a router
155 instead of a switch, all ingress packets will be VLAN tagged. Programs such
156 as l3fwd which do not account for VLAN tags in packets will misbehave. The
157 solution is to enable VLAN stripping on ingress. The follow code fragment is
158 example of how to accomplish this:
160 .. code-block:: console
162 vlan_offload = rte_eth_dev_get_vlan_offload(port);
163 vlan_offload |= ETH_VLAN_STRIP_OFFLOAD;
164 rte_eth_dev_set_vlan_offload(port, vlan_offload);
166 - Limited flow director support on 1200 series and 1300 series Cisco VIC
167 adapters with old firmware. Please see :ref:`enic-flow-director`.
169 - Flow director features are not supported on generation 1 Cisco VIC adapters
172 How to build the suite?
173 -----------------------
174 The build instructions for the DPDK suite should be followed. By default
175 the ENIC PMD library will be built into the DPDK library.
177 For configuring and using UIO and VFIO frameworks, please refer the
178 documentation that comes with DPDK suite.
180 Supported Cisco VIC adapters
181 ----------------------------
183 ENIC PMD supports all recent generations of Cisco VIC adapters including:
197 Supported Operating Systems
198 ---------------------------
199 Any Linux distribution fulfilling the conditions described in Dependencies
200 section of DPDK documentation.
204 - Unicast, multicast and broadcast transmission and reception
205 - Receive queue polling
206 - Port Hardware Statistics
207 - Hardware VLAN acceleration
208 - IP checksum offload
209 - Receive side VLAN stripping
210 - Multiple receive and transmit queues
211 - Flow Director ADD, UPDATE, DELETE, STATS operation support IPv4 and IPv6
213 - Setting RX VLAN (supported via UCSM/CIMC only)
214 - VLAN filtering (supported via UCSM/CIMC only)
215 - Execution of application by unprivileged system users
216 - IPV4, IPV6 and TCP RSS hashing
220 Known bugs and Unsupported features in this release
221 ---------------------------------------------------
222 - Signature or flex byte based flow direction
223 - Drop feature of flow direction
224 - VLAN based flow direction
225 - non-IPV4 flow direction
226 - Setting of extended VLAN
228 - MTU update only works if Scattered Rx mode is disabled
232 - Prepare the system as recommended by DPDK suite. This includes environment
233 variables, hugepages configuration, tool-chains and configuration
234 - Insert vfio-pci kernel module using the command 'modprobe vfio-pci' if the
235 user wants to use VFIO framework
236 - Insert uio kernel module using the command 'modprobe uio' if the user wants
238 - DPDK suite should be configured based on the user's decision to use VFIO or
240 - If the vNIC device(s) to be used is bound to the kernel mode Ethernet driver
241 (enic), use 'ifconfig' to bring the interface down. The dpdk-devbind.py tool
242 can then be used to unbind the device's bus id from the enic kernel mode
244 - Bind the intended vNIC to vfio-pci in case the user wants ENIC PMD to use
245 VFIO framework using dpdk-devbind.py.
246 - Bind the intended vNIC to igb_uio in case the user wants ENIC PMD to use
247 UIO framework using dpdk-devbind.py.
249 At this point the system should be ready to run DPDK applications. Once the
250 application runs to completion, the vNIC can be detached from vfio-pci or
251 igb_uio if necessary.
253 Root privilege is required to bind and unbind vNICs to/from VFIO/UIO.
254 VFIO framework helps an unprivileged user to run the applications.
255 For an unprivileged user to run the applications on DPDK and ENIC PMD,
256 it may be necessary to increase the maximum locked memory of the user.
257 The following command could be used to do this.
259 .. code-block:: console
261 sudo sh -c "ulimit -l <value in Kilo Bytes>"
263 The value depends on the memory configuration of the application, DPDK and
264 PMD. Typically, the limit has to be raised to higher than 2GB.
267 The compilation of any unused drivers can be disabled using the
268 configuration file in config/ directory (e.g., config/common_linuxapp).
269 This would help in bringing down the time taken for building the
270 libraries and the initialization time of the application.
274 - http://www.cisco.com/c/en/us/products/servers-unified-computing
278 Any questions or bugs should be reported to DPDK community and to the ENIC PMD
281 - John Daley <johndale@cisco.com>
282 - Nelson Escobar <neescoba@cisco.com>