15630257fSFerruh Yigit.. SPDX-License-Identifier: BSD-3-Clause 25630257fSFerruh Yigit Copyright(c) 2010-2014 Intel Corporation. 3d0dff9baSBernard Iremonger 4d0dff9baSBernard IremongerTest Pipeline Application 5d0dff9baSBernard Iremonger========================= 6d0dff9baSBernard Iremonger 7e0c7c473SSiobhan ButlerThe Test Pipeline application illustrates the use of the DPDK Packet Framework tool suite. 8e0c7c473SSiobhan ButlerIts purpose is to demonstrate the performance of single-table DPDK pipelines. 9d0dff9baSBernard Iremonger 10d0dff9baSBernard IremongerOverview 11d0dff9baSBernard Iremonger-------- 12d0dff9baSBernard Iremonger 13d0dff9baSBernard IremongerThe application uses three CPU cores: 14d0dff9baSBernard Iremonger 15d0dff9baSBernard Iremonger* Core A ("RX core") receives traffic from the NIC ports and feeds core B with traffic through SW queues. 16d0dff9baSBernard Iremonger 17e0c7c473SSiobhan Butler* Core B ("Pipeline core") implements a single-table DPDK pipeline 18d0dff9baSBernard Iremonger whose type is selectable through specific command line parameter. 19d0dff9baSBernard Iremonger Core B receives traffic from core A through software queues, 20d0dff9baSBernard Iremonger processes it according to the actions configured in the table entries that 21d0dff9baSBernard Iremonger are hit by the input packets and feeds it to core C through another set of software queues. 22d0dff9baSBernard Iremonger 23d0dff9baSBernard Iremonger* Core C ("TX core") receives traffic from core B through software queues and sends it to the NIC ports for transmission. 24d0dff9baSBernard Iremonger 254a22e6eeSJohn McNamara.. _figure_test_pipeline_app: 26d0dff9baSBernard Iremonger 274a22e6eeSJohn McNamara.. figure:: img/test_pipeline_app.* 28d0dff9baSBernard Iremonger 294a22e6eeSJohn McNamara Test Pipeline Application 30d0dff9baSBernard Iremonger 31d0dff9baSBernard IremongerCompiling the Application 32d0dff9baSBernard Iremonger------------------------- 337cacb056SHerakliusz LipiecTo compile the sample application see :doc:`compiling` 34d0dff9baSBernard Iremonger 35*e2a94f9aSCiara PowerThe application is located in the ``dpdk/<build_dir>/app`` directory. 36d0dff9baSBernard Iremonger 37d0dff9baSBernard Iremonger 38d0dff9baSBernard IremongerRunning the Application 39d0dff9baSBernard Iremonger----------------------- 40d0dff9baSBernard Iremonger 41d0dff9baSBernard IremongerApplication Command Line 42d0dff9baSBernard Iremonger~~~~~~~~~~~~~~~~~~~~~~~~ 43d0dff9baSBernard Iremonger 44d0dff9baSBernard IremongerThe application execution command line is: 45d0dff9baSBernard Iremonger 46d0dff9baSBernard Iremonger.. code-block:: console 47d0dff9baSBernard Iremonger 48*e2a94f9aSCiara Power ./dpdk-test-pipeline [EAL options] -- -p PORTMASK --TABLE_TYPE 49d0dff9baSBernard Iremonger 5035b09d76SKeith WilesThe -c or -l EAL CPU coremask/corelist option has to contain exactly 3 CPU cores. 51d0dff9baSBernard IremongerThe first CPU core in the core mask is assigned for core A, the second for core B and the third for core C. 52d0dff9baSBernard Iremonger 53d0dff9baSBernard IremongerThe PORTMASK parameter must contain 2 or 4 ports. 54d0dff9baSBernard Iremonger 55d0dff9baSBernard IremongerTable Types and Behavior 56d0dff9baSBernard Iremonger~~~~~~~~~~~~~~~~~~~~~~~~ 57d0dff9baSBernard Iremonger 588c9a3374SJohn McNamara:numref:`table_test_pipeline_1` describes the table types used and how they are populated. 59d0dff9baSBernard Iremonger 60d0dff9baSBernard IremongerThe hash tables are pre-populated with 16 million keys. 61d0dff9baSBernard IremongerFor hash tables, the following parameters can be selected: 62d0dff9baSBernard Iremonger 63d0dff9baSBernard Iremonger* **Configurable key size implementation or fixed (specialized) key size implementation (e.g. hash-8-ext or hash-spec-8-ext).** 64d0dff9baSBernard Iremonger The key size specialized implementations are expected to provide better performance for 8-byte and 16-byte key sizes, 65d0dff9baSBernard Iremonger while the key-size-non-specialized implementation is expected to provide better performance for larger key sizes; 66d0dff9baSBernard Iremonger 67d0dff9baSBernard Iremonger* **Key size (e.g. hash-spec-8-ext or hash-spec-16-ext).** 68d0dff9baSBernard Iremonger The available options are 8, 16 and 32 bytes; 69d0dff9baSBernard Iremonger 70d0dff9baSBernard Iremonger* **Table type (e.g. hash-spec-16-ext or hash-spec-16-lru).** 71fea1d908SJohn McNamara The available options are ext (extendable bucket) or lru (least recently used). 72d0dff9baSBernard Iremonger 738c9a3374SJohn McNamara.. _table_test_pipeline_1: 74d0dff9baSBernard Iremonger 758c9a3374SJohn McNamara.. table:: Table Types 76d0dff9baSBernard Iremonger 77d0dff9baSBernard Iremonger +-------+------------------------+----------------------------------------------------------+-------------------------------------------------------+ 78d0dff9baSBernard Iremonger | **#** | **TABLE_TYPE** | **Description of Core B Table** | **Pre-added Table Entries** | 79d0dff9baSBernard Iremonger | | | | | 80d0dff9baSBernard Iremonger +=======+========================+==========================================================+=======================================================+ 81e0c7c473SSiobhan Butler | 1 | none | Core B is not implementing a DPDK pipeline. | N/A | 82d0dff9baSBernard Iremonger | | | Core B is implementing a pass-through from its input set | | 83d0dff9baSBernard Iremonger | | | of software queues to its output set of software queues. | | 84d0dff9baSBernard Iremonger | | | | | 85d0dff9baSBernard Iremonger +-------+------------------------+----------------------------------------------------------+-------------------------------------------------------+ 86d0dff9baSBernard Iremonger | 2 | stub | Stub table. Core B is implementing the same pass-through | N/A | 87d0dff9baSBernard Iremonger | | | functionality as described for the "none" option by | | 88e0c7c473SSiobhan Butler | | | using the DPDK Packet Framework by using one | | 89d0dff9baSBernard Iremonger | | | stub table for each input NIC port. | | 90d0dff9baSBernard Iremonger | | | | | 91d0dff9baSBernard Iremonger +-------+------------------------+----------------------------------------------------------+-------------------------------------------------------+ 92d0dff9baSBernard Iremonger | 3 | hash-[spec]-8-lru | LRU hash table with 8-byte key size and 16 million | 16 million entries are successfully added to the | 93d0dff9baSBernard Iremonger | | | entries. | hash table with the following key format: | 94d0dff9baSBernard Iremonger | | | | | 95d0dff9baSBernard Iremonger | | | | [4-byte index, 4 bytes of 0] | 961e7055acSJohn McNamara | | | | | 971e7055acSJohn McNamara | | | | The action configured for all table entries is | 981e7055acSJohn McNamara | | | | "Sendto output port", with the output port index | 99d0dff9baSBernard Iremonger | | | | uniformly distributed for the range of output ports. | 100d0dff9baSBernard Iremonger | | | | | 101d0dff9baSBernard Iremonger | | | | The default table rule (used in the case of a lookup | 102d0dff9baSBernard Iremonger | | | | miss) is to drop the packet. | 103d0dff9baSBernard Iremonger | | | | | 104d0dff9baSBernard Iremonger | | | | At run time, core A is creating the following lookup | 105d0dff9baSBernard Iremonger | | | | key and storing it into the packet meta data for | 106d0dff9baSBernard Iremonger | | | | core B to use for table lookup: | 107d0dff9baSBernard Iremonger | | | | | 108d0dff9baSBernard Iremonger | | | | [destination IPv4 address, 4 bytes of 0] | 109d0dff9baSBernard Iremonger | | | | | 110d0dff9baSBernard Iremonger +-------+------------------------+----------------------------------------------------------+-------------------------------------------------------+ 1112fe68f32SJohn McNamara | 4 | hash-[spec]-8-ext | Extendable bucket hash table with 8-byte key size | Same as hash-[spec]-8-lru table entries, above. | 1121e7055acSJohn McNamara | | | and 16 million entries. | | 1131e7055acSJohn McNamara | | | | | 1141e7055acSJohn McNamara +-------+------------------------+----------------------------------------------------------+-------------------------------------------------------+ 115d0dff9baSBernard Iremonger | 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 | 116d0dff9baSBernard Iremonger | | | entries. | table with the following key format: | 117d0dff9baSBernard Iremonger | | | | | 118d0dff9baSBernard Iremonger | | | | [4-byte index, 12 bytes of 0] | 1191e7055acSJohn McNamara | | | | | 1201e7055acSJohn McNamara | | | | The action configured for all table entries is | 1211e7055acSJohn McNamara | | | | "Send to output port", with the output port index | 122d0dff9baSBernard Iremonger | | | | uniformly distributed for the range of output ports. | 123d0dff9baSBernard Iremonger | | | | | 124d0dff9baSBernard Iremonger | | | | The default table rule (used in the case of a lookup | 125d0dff9baSBernard Iremonger | | | | miss) is to drop the packet. | 126d0dff9baSBernard Iremonger | | | | | 127d0dff9baSBernard Iremonger | | | | At run time, core A is creating the following lookup | 128d0dff9baSBernard Iremonger | | | | key and storing it into the packet meta data for core | 129d0dff9baSBernard Iremonger | | | | B to use for table lookup: | 130d0dff9baSBernard Iremonger | | | | | 131d0dff9baSBernard Iremonger | | | | [destination IPv4 address, 12 bytes of 0] | 132d0dff9baSBernard Iremonger | | | | | 133d0dff9baSBernard Iremonger +-------+------------------------+----------------------------------------------------------+-------------------------------------------------------+ 1342fe68f32SJohn McNamara | 6 | hash-[spec]-16-ext | Extendable bucket hash table with 16-byte key size | Same as hash-[spec]-16-lru table entries, above. | 1351e7055acSJohn McNamara | | | and 16 million entries. | | 1361e7055acSJohn McNamara | | | | | 1371e7055acSJohn McNamara +-------+------------------------+----------------------------------------------------------+-------------------------------------------------------+ 138d0dff9baSBernard Iremonger | 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 | 139d0dff9baSBernard Iremonger | | | entries. | table with the following key format: | 140d0dff9baSBernard Iremonger | | | | | 141d0dff9baSBernard Iremonger | | | | [4-byte index, 28 bytes of 0]. | 1421e7055acSJohn McNamara | | | | | 1431e7055acSJohn McNamara | | | | The action configured for all table entries is | 1441e7055acSJohn McNamara | | | | "Send to output port", with the output port index | 145d0dff9baSBernard Iremonger | | | | uniformly distributed for the range of output ports. | 146d0dff9baSBernard Iremonger | | | | | 147d0dff9baSBernard Iremonger | | | | The default table rule (used in the case of a lookup | 148d0dff9baSBernard Iremonger | | | | miss) is to drop the packet. | 149d0dff9baSBernard Iremonger | | | | | 150d0dff9baSBernard Iremonger | | | | At run time, core A is creating the following lookup | 151d0dff9baSBernard Iremonger | | | | key and storing it into the packet meta data for | 152d0dff9baSBernard Iremonger | | | | Lpmcore B to use for table lookup: | 153d0dff9baSBernard Iremonger | | | | | 154d0dff9baSBernard Iremonger | | | | [destination IPv4 address, 28 bytes of 0] | 155d0dff9baSBernard Iremonger | | | | | 156d0dff9baSBernard Iremonger +-------+------------------------+----------------------------------------------------------+-------------------------------------------------------+ 1572fe68f32SJohn McNamara | 8 | hash-[spec]-32-ext | Extendable bucket hash table with 32-byte key size | Same as hash-[spec]-32-lru table entries, above. | 1581e7055acSJohn McNamara | | | and 16 million entries. | | 1591e7055acSJohn McNamara | | | | | 1601e7055acSJohn McNamara +-------+------------------------+----------------------------------------------------------+-------------------------------------------------------+ 161d0dff9baSBernard Iremonger | 9 | lpm | Longest Prefix Match (LPM) IPv4 table. | In the case of two ports, two routes | 162d0dff9baSBernard Iremonger | | | | are added to the table: | 163d0dff9baSBernard Iremonger | | | | | 164d0dff9baSBernard Iremonger | | | | [0.0.0.0/9 => send to output port 0] | 165d0dff9baSBernard Iremonger | | | | | 166d0dff9baSBernard Iremonger | | | | [0.128.0.0/9 => send to output port 1] | 167d0dff9baSBernard Iremonger | | | | | 168d0dff9baSBernard Iremonger | | | | In case of four ports, four entries are added to the | 169d0dff9baSBernard Iremonger | | | | table: | 170d0dff9baSBernard Iremonger | | | | | 171d0dff9baSBernard Iremonger | | | | [0.0.0.0/10 => send to output port 0] | 172d0dff9baSBernard Iremonger | | | | | 173d0dff9baSBernard Iremonger | | | | [0.64.0.0/10 => send to output port 1] | 174d0dff9baSBernard Iremonger | | | | | 175d0dff9baSBernard Iremonger | | | | [0.128.0.0/10 => send to output port 2] | 176d0dff9baSBernard Iremonger | | | | | 177d0dff9baSBernard Iremonger | | | | [0.192.0.0/10 => send to output port 3] | 178d0dff9baSBernard Iremonger | | | | | 179d0dff9baSBernard Iremonger | | | | The default table rule (used in the case of a lookup | 180d0dff9baSBernard Iremonger | | | | miss) is to drop the packet. | 181d0dff9baSBernard Iremonger | | | | | 182d0dff9baSBernard Iremonger | | | | At run time, core A is storing the IPv4 destination | 183d0dff9baSBernard Iremonger | | | | within the packet meta data to be later used by core | 184d0dff9baSBernard Iremonger | | | | B as the lookup key. | 185d0dff9baSBernard Iremonger | | | | | 186d0dff9baSBernard Iremonger +-------+------------------------+----------------------------------------------------------+-------------------------------------------------------+ 187d0dff9baSBernard Iremonger | 10 | acl | Access Control List (ACL) table | In the case of two ports, two ACL rules are added to | 188d0dff9baSBernard Iremonger | | | | the table: | 189d0dff9baSBernard Iremonger | | | | | 190d0dff9baSBernard Iremonger | | | | [priority = 0 (highest), | 191d0dff9baSBernard Iremonger | | | | | 192d0dff9baSBernard Iremonger | | | | IPv4 source = ANY, | 193d0dff9baSBernard Iremonger | | | | | 194d0dff9baSBernard Iremonger | | | | IPv4 destination = 0.0.0.0/9, | 195d0dff9baSBernard Iremonger | | | | | 196d0dff9baSBernard Iremonger | | | | L4 protocol = ANY, | 197d0dff9baSBernard Iremonger | | | | | 198d0dff9baSBernard Iremonger | | | | TCP source port = ANY, | 199d0dff9baSBernard Iremonger | | | | | 200d0dff9baSBernard Iremonger | | | | TCP destination port = ANY | 201d0dff9baSBernard Iremonger | | | | | 202d0dff9baSBernard Iremonger | | | | => send to output port 0] | 203d0dff9baSBernard Iremonger | | | | | 204d0dff9baSBernard Iremonger | | | | | 205d0dff9baSBernard Iremonger | | | | [priority = 0 (highest), | 206d0dff9baSBernard Iremonger | | | | | 207d0dff9baSBernard Iremonger | | | | IPv4 source = ANY, | 208d0dff9baSBernard Iremonger | | | | | 209d0dff9baSBernard Iremonger | | | | IPv4 destination = 0.128.0.0/9, | 210d0dff9baSBernard Iremonger | | | | | 211d0dff9baSBernard Iremonger | | | | L4 protocol = ANY, | 212d0dff9baSBernard Iremonger | | | | | 213d0dff9baSBernard Iremonger | | | | TCP source port = ANY, | 214d0dff9baSBernard Iremonger | | | | | 215d0dff9baSBernard Iremonger | | | | TCP destination port = ANY | 216d0dff9baSBernard Iremonger | | | | | 217d0dff9baSBernard Iremonger | | | | => send to output port 0]. | 218d0dff9baSBernard Iremonger | | | | | 219d0dff9baSBernard Iremonger | | | | | 220d0dff9baSBernard Iremonger | | | | The default table rule (used in the case of a lookup | 221d0dff9baSBernard Iremonger | | | | miss) is to drop the packet. | 222d0dff9baSBernard Iremonger | | | | | 223d0dff9baSBernard Iremonger +-------+------------------------+----------------------------------------------------------+-------------------------------------------------------+ 224d0dff9baSBernard Iremonger 225d0dff9baSBernard IremongerInput Traffic 226d0dff9baSBernard Iremonger~~~~~~~~~~~~~ 227d0dff9baSBernard Iremonger 228d0dff9baSBernard IremongerRegardless of the table type used for the core B pipeline, 229d0dff9baSBernard Iremongerthe same input traffic can be used to hit all table entries with uniform distribution, 230d0dff9baSBernard Iremongerwhich results in uniform distribution of packets sent out on the set of output NIC ports. 231d0dff9baSBernard IremongerThe profile for input traffic is TCP/IPv4 packets with: 232d0dff9baSBernard Iremonger 233d0dff9baSBernard Iremonger* destination IP address as A.B.C.D with A fixed to 0 and B, C,D random 234d0dff9baSBernard Iremonger 235d0dff9baSBernard Iremonger* source IP address fixed to 0.0.0.0 236d0dff9baSBernard Iremonger 237d0dff9baSBernard Iremonger* destination TCP port fixed to 0 238d0dff9baSBernard Iremonger 239d0dff9baSBernard Iremonger* source TCP port fixed to 0 240