xref: /dpdk/doc/guides/sample_app_ug/test_pipeline.rst (revision aae5e11e847ec0b07b00c14564fdef787a0f3595)
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
31Test Pipeline Application
32=========================
33
34The Test Pipeline application illustrates the use of the Intel® DPDK Packet Framework tool suite.
35Its purpose is to demonstrate the performance of single-table Intel® DPDK pipelines.
36
37Overview
38--------
39
40The application uses three CPU cores:
41
42*   Core A ("RX core") receives traffic from the NIC ports and feeds core B with traffic through SW queues.
43
44*   Core B ("Pipeline core") implements a single-table Intel® DPDK pipeline
45    whose type is selectable through specific command line parameter.
46    Core B receives traffic from core A through software queues,
47    processes it according to the actions configured in the table entries that
48    are hit by the input packets and feeds it to core C through another set of software queues.
49
50*   Core C ("TX core") receives traffic from core B through software queues and sends it to the NIC ports for transmission.
51
52.. _figure_21:
53
54**Figure 21.Test Pipeline Application**
55
56.. image24_png has been renamed
57
58|test_pipeline_app|
59
60Compiling the Application
61-------------------------
62
63#.  Go to the app/test directory:
64
65    .. code-block:: console
66
67        export RTE_SDK=/path/to/rte_sdk
68        cd ${RTE_SDK}/app/test/test-pipeline
69
70#.  Set the target (a default target is used if not specified):
71
72    .. code-block:: console
73
74        export RTE_TARGET=x86_64-native-linuxapp-gcc
75
76#.  Build the application:
77
78    .. code-block:: console
79
80        make
81
82Running the Application
83-----------------------
84
85Application Command Line
86~~~~~~~~~~~~~~~~~~~~~~~~
87
88The application execution command line is:
89
90.. code-block:: console
91
92    ./test-pipeline [EAL options] -- -p PORTMASK --TABLE_TYPE
93
94The -c EAL CPU core mask option has to contain exactly 3 CPU cores.
95The first CPU core in the core mask is assigned for core A, the second for core B and the third for core C.
96
97The PORTMASK parameter must contain 2 or 4 ports.
98
99Table Types and Behavior
100~~~~~~~~~~~~~~~~~~~~~~~~
101
102Table 3 describes the table types used and how they are populated.
103
104The hash tables are pre-populated with 16 million keys.
105For hash tables, the following parameters can be selected:
106
107*   **Configurable key size implementation or fixed (specialized) key size implementation (e.g. hash-8-ext or hash-spec-8-ext).**
108    The key size specialized implementations are expected to provide better performance for 8-byte and 16-byte key sizes,
109    while the key-size-non-specialized implementation is expected to provide better performance for larger key sizes;
110
111*   **Key size (e.g. hash-spec-8-ext or hash-spec-16-ext).**
112    The available options are 8, 16 and 32 bytes;
113
114*   **Table type (e.g. hash-spec-16-ext or hash-spec-16-lru).**
115    The available options are ext (extendible bucket) or lru (least recently used).
116
117.. _table_3:
118
119**Table 3. Table Types**
120
121+-------+------------------------+----------------------------------------------------------+-------------------------------------------------------+
122| **#** | **TABLE_TYPE**         | **Description of Core B Table**                          | **Pre-added Table Entries**                           |
123|       |                        |                                                          |                                                       |
124+=======+========================+==========================================================+=======================================================+
125| 1     | none                   | Core B is not implementing an Intel® DPDK pipeline.      | N/A                                                   |
126|       |                        | Core B is implementing a pass-through from its input set |                                                       |
127|       |                        | of software queues to its output set of software queues. |                                                       |
128|       |                        |                                                          |                                                       |
129+-------+------------------------+----------------------------------------------------------+-------------------------------------------------------+
130| 2     | stub                   | Stub table. Core B is implementing the same pass-through | N/A                                                   |
131|       |                        | functionality as described for the "none" option by      |                                                       |
132|       |                        | using the Intel® DPDK Packet Framework by using one      |                                                       |
133|       |                        | stub table for each input NIC port.                      |                                                       |
134|       |                        |                                                          |                                                       |
135+-------+------------------------+----------------------------------------------------------+-------------------------------------------------------+
136| 3     | hash-[spec]-8-lru      | LRU hash table with 8-byte key size and 16 million       | 16 million entries are successfully added to the      |
137|       |                        | entries.                                                 | hash table with the following key format:             |
138|       |                        |                                                          |                                                       |
139|       |                        |                                                          | [4-byte index, 4 bytes of 0]                          |
140+-------+------------------------+----------------------------------------------------------+                                                       |
141| 4     | hash-[spec]-8-ext      |  Extendible bucket hash table with 8-byte key size       | The action configured for all table entries is        |
142|       |                        |  and 16 million entries.                                 | "Sendto output port", with the output port index      |
143|       |                        |                                                          | uniformly distributed for the range of output ports.  |
144|       |                        |                                                          |                                                       |
145|       |                        |                                                          | The default table rule (used in the case of a lookup  |
146|       |                        |                                                          | miss) is to drop the packet.                          |
147|       |                        |                                                          |                                                       |
148|       |                        |                                                          | At run time, core A is creating the following lookup  |
149|       |                        |                                                          | key and storing it into the packet meta data for      |
150|       |                        |                                                          | core B to use for table lookup:                       |
151|       |                        |                                                          |                                                       |
152|       |                        |                                                          | [destination IPv4 address, 4 bytes of 0]              |
153|       |                        |                                                          |                                                       |
154+-------+------------------------+----------------------------------------------------------+-------------------------------------------------------+
155| 5     | hash-[spec]-16-lru     | LRU hash table with 16-byte key size and 16 million      | 16 million entries are successfully added to the hash |
156|       |                        | entries.                                                 | table with the following key format:                  |
157|       |                        |                                                          |                                                       |
158|       |                        |                                                          | [4-byte index, 12 bytes of 0]                         |
159+-------+------------------------+----------------------------------------------------------+                                                       |
160| 6     | hash-[spec]-ash-16-ext | Extendible bucket hash table with 16-byte key size       | The action configured for all table entries is        |
161|       |                        | and 16 million entries.                                  | "Send to output port", with the output port index     |
162|       |                        |                                                          | uniformly distributed for the range of output ports.  |
163|       |                        |                                                          |                                                       |
164|       |                        |                                                          | The default table rule (used in the case of a lookup  |
165|       |                        |                                                          | miss) is to drop the packet.                          |
166|       |                        |                                                          |                                                       |
167|       |                        |                                                          | At run time, core A is creating the following lookup  |
168|       |                        |                                                          | key and storing it into the packet meta data for core |
169|       |                        |                                                          | B to use for table lookup:                            |
170|       |                        |                                                          |                                                       |
171|       |                        |                                                          | [destination IPv4 address, 12 bytes of 0]             |
172|       |                        |                                                          |                                                       |
173+-------+------------------------+----------------------------------------------------------+-------------------------------------------------------+
174| 7     | hash-[spec]-32-lru     | LRU hash table with 32-byte key size and 16 million      | 16 million entries are successfully added to the hash |
175|       |                        | entries.                                                 |  table with the following key format:                 |
176|       |                        |                                                          |                                                       |
177|       |                        |                                                          | [4-byte index, 28 bytes of 0].                        |
178+-------+------------------------+----------------------------------------------------------+                                                       |
179| 8     | hash-[spec]-32-ext     | Extendible bucket hash table with 32-byte key size       | The action configured for all table entries is        |
180|       |                        | and 16 million entries.                                  | "Send to output port", with the output port index     |
181|       |                        |                                                          | uniformly distributed for the range of output ports.  |
182|       |                        |                                                          |                                                       |
183|       |                        |                                                          | The default table rule (used in the case of a lookup  |
184|       |                        |                                                          | miss) is to drop the packet.                          |
185|       |                        |                                                          |                                                       |
186|       |                        |                                                          | At run time, core A is creating the following lookup  |
187|       |                        |                                                          | key and storing it into the packet meta data for      |
188|       |                        |                                                          | Lpmcore B to use for table lookup:                    |
189|       |                        |                                                          |                                                       |
190|       |                        |                                                          | [destination IPv4 address, 28 bytes of 0]             |
191|       |                        |                                                          |                                                       |
192+-------+------------------------+----------------------------------------------------------+-------------------------------------------------------+
193| 9     | lpm                    | Longest Prefix Match (LPM) IPv4 table.                   | In the case of two ports, two routes                  |
194|       |                        |                                                          | are added to the table:                               |
195|       |                        |                                                          |                                                       |
196|       |                        |                                                          | [0.0.0.0/9 => send to output port 0]                  |
197|       |                        |                                                          |                                                       |
198|       |                        |                                                          | [0.128.0.0/9 => send to output port 1]                |
199|       |                        |                                                          |                                                       |
200|       |                        |                                                          | In case of four ports, four entries are added to the  |
201|       |                        |                                                          | table:                                                |
202|       |                        |                                                          |                                                       |
203|       |                        |                                                          | [0.0.0.0/10 => send to output port 0]                 |
204|       |                        |                                                          |                                                       |
205|       |                        |                                                          | [0.64.0.0/10 => send to output port 1]                |
206|       |                        |                                                          |                                                       |
207|       |                        |                                                          | [0.128.0.0/10 => send to output port 2]               |
208|       |                        |                                                          |                                                       |
209|       |                        |                                                          | [0.192.0.0/10 => send to output port 3]               |
210|       |                        |                                                          |                                                       |
211|       |                        |                                                          | The default table rule (used in the case of a lookup  |
212|       |                        |                                                          | miss) is to drop the packet.                          |
213|       |                        |                                                          |                                                       |
214|       |                        |                                                          | At run time, core A is storing the IPv4 destination   |
215|       |                        |                                                          | within the packet meta data to be later used by core  |
216|       |                        |                                                          | B as the lookup key.                                  |
217|       |                        |                                                          |                                                       |
218+-------+------------------------+----------------------------------------------------------+-------------------------------------------------------+
219| 10    | acl                    | Access Control List (ACL) table                          | In the case of two ports, two ACL rules are added to  |
220|       |                        |                                                          | the table:                                            |
221|       |                        |                                                          |                                                       |
222|       |                        |                                                          | [priority = 0 (highest),                              |
223|       |                        |                                                          |                                                       |
224|       |                        |                                                          | IPv4 source = ANY,                                    |
225|       |                        |                                                          |                                                       |
226|       |                        |                                                          | IPv4 destination = 0.0.0.0/9,                         |
227|       |                        |                                                          |                                                       |
228|       |                        |                                                          | L4 protocol = ANY,                                    |
229|       |                        |                                                          |                                                       |
230|       |                        |                                                          | TCP source port = ANY,                                |
231|       |                        |                                                          |                                                       |
232|       |                        |                                                          | TCP destination port = ANY                            |
233|       |                        |                                                          |                                                       |
234|       |                        |                                                          | => send to output port 0]                             |
235|       |                        |                                                          |                                                       |
236|       |                        |                                                          |                                                       |
237|       |                        |                                                          | [priority = 0 (highest),                              |
238|       |                        |                                                          |                                                       |
239|       |                        |                                                          | IPv4 source = ANY,                                    |
240|       |                        |                                                          |                                                       |
241|       |                        |                                                          | IPv4 destination = 0.128.0.0/9,                       |
242|       |                        |                                                          |                                                       |
243|       |                        |                                                          | L4 protocol = ANY,                                    |
244|       |                        |                                                          |                                                       |
245|       |                        |                                                          | TCP source port = ANY,                                |
246|       |                        |                                                          |                                                       |
247|       |                        |                                                          | TCP destination port = ANY                            |
248|       |                        |                                                          |                                                       |
249|       |                        |                                                          | => send to output port 0].                            |
250|       |                        |                                                          |                                                       |
251|       |                        |                                                          |                                                       |
252|       |                        |                                                          | The default table rule (used in the case of a lookup  |
253|       |                        |                                                          | miss) is to drop the packet.                          |
254|       |                        |                                                          |                                                       |
255+-------+------------------------+----------------------------------------------------------+-------------------------------------------------------+
256
257Input Traffic
258~~~~~~~~~~~~~
259
260Regardless of the table type used for the core B pipeline,
261the same input traffic can be used to hit all table entries with uniform distribution,
262which results in uniform distribution of packets sent out on the set of output NIC ports.
263The profile for input traffic is TCP/IPv4 packets with:
264
265*   destination IP address as A.B.C.D with A fixed to 0 and B, C,D random
266
267*   source IP address fixed to 0.0.0.0
268
269*   destination TCP port fixed to 0
270
271*   source TCP port fixed to 0
272
273.. |test_pipeline_app| image:: img/test_pipeline_app.png
274