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