xref: /dpdk/doc/guides/sample_app_ug/ip_pipeline.rst (revision 443b949e17953a1094f80532d600a1ee540f2ba4)
15630257fSFerruh Yigit..  SPDX-License-Identifier: BSD-3-Clause
271f2e9baSJasvinder Singh    Copyright(c) 2015-2018 Intel Corporation.
3f1e779ecSCristian Dumitrescu
4f1e779ecSCristian DumitrescuInternet Protocol (IP) Pipeline Application
5f1e779ecSCristian Dumitrescu===========================================
6f1e779ecSCristian Dumitrescu
7f1e779ecSCristian DumitrescuApplication overview
8f1e779ecSCristian Dumitrescu--------------------
9f1e779ecSCristian Dumitrescu
10f1e779ecSCristian DumitrescuThe *Internet Protocol (IP) Pipeline* application is intended to be a vehicle for rapid development of packet processing
1171f2e9baSJasvinder Singhapplications on multi-core CPUs.
12f1e779ecSCristian Dumitrescu
1371f2e9baSJasvinder SinghFollowing OpenFlow and P4 design principles, the application can be used to create functional blocks called pipelines out
1471f2e9baSJasvinder Singhof input/output ports, tables and actions in a modular way. Multiple pipelines can be inter-connected through packet queues
15f1e779ecSCristian Dumitrescuto create complete applications (super-pipelines).
16f1e779ecSCristian Dumitrescu
1771f2e9baSJasvinder SinghThe pipelines are mapped to application threads, with each pipeline executed by a single thread and each thread able to run
1871f2e9baSJasvinder Singhone or several pipelines. The possibilities of creating pipelines out of ports, tables and actions, connecting multiple
1971f2e9baSJasvinder Singhpipelines together and mapping the pipelines to execution threads are endless, therefore this application can be seen as
2071f2e9baSJasvinder Singha true application generator.
21f1e779ecSCristian Dumitrescu
2271f2e9baSJasvinder SinghPipelines are created and managed through Command Line Interface (CLI):
23f1e779ecSCristian Dumitrescu
2471f2e9baSJasvinder Singh * Any standard TCP client (e.g. telnet, netcat, custom script, etc) is typically able to connect to the application, send
2571f2e9baSJasvinder Singh   commands through the network and wait for the response before pushing the next command.
26f1e779ecSCristian Dumitrescu
2771f2e9baSJasvinder Singh * All the application objects are created and managed through CLI commands:
2871f2e9baSJasvinder Singh    * 'Primitive' objects used to create pipeline ports: memory pools, links (i.e. network interfaces), SW queues, traffic managers, etc.
2971f2e9baSJasvinder Singh    * Action profiles: used to define the actions to be executed by pipeline input/output ports and tables.
3071f2e9baSJasvinder Singh    * Pipeline components: input/output ports, tables, pipelines, mapping of pipelines to execution threads.
31f1e779ecSCristian Dumitrescu
32f1e779ecSCristian DumitrescuRunning the application
33f1e779ecSCristian Dumitrescu-----------------------
34f1e779ecSCristian Dumitrescu
35f1e779ecSCristian DumitrescuThe application startup command line is::
36f1e779ecSCristian Dumitrescu
37e2a94f9aSCiara Power   dpdk-ip_pipeline [EAL_ARGS] -- [-s SCRIPT_FILE] [-h HOST] [-p PORT]
38f1e779ecSCristian Dumitrescu
39f1e779ecSCristian DumitrescuThe application startup arguments are:
40f1e779ecSCristian Dumitrescu
41f1e779ecSCristian Dumitrescu``-s SCRIPT_FILE``
42f1e779ecSCristian Dumitrescu
43f1e779ecSCristian Dumitrescu * Optional: Yes
44f1e779ecSCristian Dumitrescu
45f1e779ecSCristian Dumitrescu * Default: Not present
46f1e779ecSCristian Dumitrescu
4771f2e9baSJasvinder Singh * Argument: Path to the CLI script file to be run at application startup.
4871f2e9baSJasvinder Singh   No CLI script file will run at startup if this argument is not present.
49f1e779ecSCristian Dumitrescu
5071f2e9baSJasvinder Singh``-h HOST``
51f1e779ecSCristian Dumitrescu
52f1e779ecSCristian Dumitrescu * Optional: Yes
53f1e779ecSCristian Dumitrescu
5471f2e9baSJasvinder Singh * Default: ``0.0.0.0``
55f1e779ecSCristian Dumitrescu
5671f2e9baSJasvinder Singh * Argument: IP Address of the host running ip pipeline application to be used by
5771f2e9baSJasvinder Singh   remote TCP based client (telnet, netcat, etc.) for connection.
5871f2e9baSJasvinder Singh
5971f2e9baSJasvinder Singh``-p PORT``
6071f2e9baSJasvinder Singh
6171f2e9baSJasvinder Singh * Optional: Yes
6271f2e9baSJasvinder Singh
6371f2e9baSJasvinder Singh * Default: ``8086``
6471f2e9baSJasvinder Singh
6571f2e9baSJasvinder Singh * Argument: TCP port number at which the ip pipeline is running.
6671f2e9baSJasvinder Singh   This port number should be used by remote TCP client (such as telnet, netcat, etc.) to connect to host application.
6771f2e9baSJasvinder Singh
6871f2e9baSJasvinder SinghRefer to *DPDK Getting Started Guide* for general information on running applications and the Environment Abstraction Layer (EAL) options.
6971f2e9baSJasvinder Singh
7071f2e9baSJasvinder SinghThe following is an example command to run ip pipeline application configured for layer 2 forwarding:
7171f2e9baSJasvinder Singh
7271f2e9baSJasvinder Singh.. code-block:: console
7371f2e9baSJasvinder Singh
74e2a94f9aSCiara Power    $ ./<build_dir>/examples/dpdk-ip_pipeline -c 0x3 -- -s examples/route_ecmp.cli
7571f2e9baSJasvinder Singh
7671f2e9baSJasvinder SinghThe application should start successfully and display as follows:
7771f2e9baSJasvinder Singh
7871f2e9baSJasvinder Singh.. code-block:: console
7971f2e9baSJasvinder Singh
8071f2e9baSJasvinder Singh    EAL: Detected 40 lcore(s)
8171f2e9baSJasvinder Singh    EAL: Detected 2 NUMA nodes
8271f2e9baSJasvinder Singh    EAL: Multi-process socket /var/run/.rte_unix
8371f2e9baSJasvinder Singh    EAL: Probing VFIO support...
8471f2e9baSJasvinder Singh    EAL: PCI device 0000:02:00.0 on NUMA socket 0
8571f2e9baSJasvinder Singh    EAL:   probe driver: 8086:10fb net_ixgbe
8671f2e9baSJasvinder Singh    ...
8771f2e9baSJasvinder Singh
8871f2e9baSJasvinder SinghTo run remote client (e.g. telnet) to communicate with the ip pipeline application:
8971f2e9baSJasvinder Singh
9071f2e9baSJasvinder Singh.. code-block:: console
9171f2e9baSJasvinder Singh
9271f2e9baSJasvinder Singh    $ telnet 127.0.0.1 8086
9371f2e9baSJasvinder Singh
9471f2e9baSJasvinder SinghWhen running a telnet client as above, command prompt is displayed:
9571f2e9baSJasvinder Singh
9671f2e9baSJasvinder Singh.. code-block:: console
9771f2e9baSJasvinder Singh
9871f2e9baSJasvinder Singh    Trying 127.0.0.1...
9971f2e9baSJasvinder Singh    Connected to 127.0.0.1.
10071f2e9baSJasvinder Singh    Escape character is '^]'.
10171f2e9baSJasvinder Singh
10271f2e9baSJasvinder Singh    Welcome to IP Pipeline!
10371f2e9baSJasvinder Singh
10471f2e9baSJasvinder Singh    pipeline>
10571f2e9baSJasvinder Singh
10671f2e9baSJasvinder SinghOnce application and telnet client start running, messages can be sent from client to application.
10771f2e9baSJasvinder SinghAt any stage, telnet client can be terminated using the quit command.
108f1e779ecSCristian Dumitrescu
109f1e779ecSCristian Dumitrescu
110f1e779ecSCristian DumitrescuApplication stages
111f1e779ecSCristian Dumitrescu------------------
112f1e779ecSCristian Dumitrescu
113f1e779ecSCristian DumitrescuInitialization
114f1e779ecSCristian Dumitrescu~~~~~~~~~~~~~~
115f1e779ecSCristian Dumitrescu
116d629b7b5SJohn McNamaraDuring this stage, EAL layer is initialised and application specific arguments are parsed. Furthermore, the data structures
11771f2e9baSJasvinder Singh(i.e. linked lists) for application objects are initialized. In case of any initialization error, an error message
11871f2e9baSJasvinder Singhis displayed and the application is terminated.
119f1e779ecSCristian Dumitrescu
120f1e779ecSCristian Dumitrescu.. _ip_pipeline_runtime:
121f1e779ecSCristian Dumitrescu
122f1e779ecSCristian DumitrescuRun-time
123f1e779ecSCristian Dumitrescu~~~~~~~~
124f1e779ecSCristian Dumitrescu
125cb056611SStephen HemmingerThe main thread is creating and managing all the application objects based on CLI input.
126f1e779ecSCristian Dumitrescu
12771f2e9baSJasvinder SinghEach data plane thread runs one or several pipelines previously assigned to it in round-robin order. Each data plane thread
12871f2e9baSJasvinder Singhexecutes two tasks in time-sharing mode:
129f1e779ecSCristian Dumitrescu
130*443b949eSDavid Marchand#. *Packet processing task*: Process bursts of input packets read from the pipeline input ports.
131f1e779ecSCristian Dumitrescu
132*443b949eSDavid Marchand#. *Message handling task*: Periodically, the data plane thread pauses the packet processing task and polls for request
133cb056611SStephen Hemminger   messages send by the main thread. Examples: add/remove pipeline to/from current data plane thread, add/delete rules
13471f2e9baSJasvinder Singh   to/from given table of a specific pipeline owned by the current data plane thread, read statistics, etc.
135f1e779ecSCristian Dumitrescu
13671f2e9baSJasvinder SinghExamples
13771f2e9baSJasvinder Singh--------
138f1e779ecSCristian Dumitrescu
13971f2e9baSJasvinder Singh.. _table_examples:
140f1e779ecSCristian Dumitrescu
141f1e779ecSCristian Dumitrescu.. tabularcolumns:: |p{3cm}|p{5cm}|p{4cm}|p{4cm}|
142f1e779ecSCristian Dumitrescu
14371f2e9baSJasvinder Singh.. table:: Pipeline examples provided with the application
144f1e779ecSCristian Dumitrescu
14571f2e9baSJasvinder Singh   +-----------------------+----------------------+----------------+------------------------------------+
146f1e779ecSCristian Dumitrescu   | Name                  | Table(s)             | Actions        | Messages                           |
14771f2e9baSJasvinder Singh   +=======================+======================+================+====================================+
14871f2e9baSJasvinder Singh   | L2fwd                 | Stub                 | Forward        | 1. Mempool create                  |
14971f2e9baSJasvinder Singh   |                       |                      |                | 2. Link create                     |
15071f2e9baSJasvinder Singh   | Note: Implemented     |                      |                | 3. Pipeline create                 |
15171f2e9baSJasvinder Singh   | using pipeline with   |                      |                | 4. Pipeline port in/out            |
15271f2e9baSJasvinder Singh   | a simple pass-through |                      |                | 5. Pipeline table                  |
15371f2e9baSJasvinder Singh   | connection between    |                      |                | 6. Pipeline port in table          |
15471f2e9baSJasvinder Singh   | input and output      |                      |                | 7. Pipeline enable                 |
15571f2e9baSJasvinder Singh   | ports.                |                      |                | 8. Pipeline table rule add         |
15671f2e9baSJasvinder Singh   +-----------------------+----------------------+----------------+------------------------------------+
15771f2e9baSJasvinder Singh   | Flow classification   | Exact match          | Forward        | 1. Mempool create                  |
15871f2e9baSJasvinder Singh   |                       |                      |                | 2. Link create                     |
15971f2e9baSJasvinder Singh   |                       | * Key = byte array   |                | 3. Pipeline create                 |
16071f2e9baSJasvinder Singh   |                       |    (16 bytes)        |                | 4. Pipeline port in/out            |
16171f2e9baSJasvinder Singh   |                       | * Offset = 278       |                | 5. Pipeline table                  |
16271f2e9baSJasvinder Singh   |                       | * Table size = 64K   |                | 6. Pipeline port in table          |
16371f2e9baSJasvinder Singh   |                       |                      |                | 7. Pipeline enable                 |
16471f2e9baSJasvinder Singh   |                       |                      |                | 8. Pipeline table rule add default |
16571f2e9baSJasvinder Singh   |                       |                      |                | 9. Pipeline table rule add         |
16671f2e9baSJasvinder Singh   +-----------------------+----------------------+----------------+------------------------------------+
16771f2e9baSJasvinder Singh   | Firewall              | ACL                  | Allow/Drop     | 1. Mempool create                  |
16871f2e9baSJasvinder Singh   |                       |                      |                | 2. Link create                     |
16971f2e9baSJasvinder Singh   |                       | * Key = n-tuple      |                | 3. Pipeline create                 |
17071f2e9baSJasvinder Singh   |                       | * Offset = 270       |                | 4. Pipeline port in/out            |
17171f2e9baSJasvinder Singh   |                       | * Table size = 4K    |                | 5. Pipeline table                  |
17271f2e9baSJasvinder Singh   |                       |                      |                | 6. Pipeline port in table          |
17371f2e9baSJasvinder Singh   |                       |                      |                | 7. Pipeline enable                 |
17471f2e9baSJasvinder Singh   |                       |                      |                | 8. Pipeline table rule add default |
17571f2e9baSJasvinder Singh   |                       |                      |                | 9. Pipeline table rule add         |
17671f2e9baSJasvinder Singh   +-----------------------+----------------------+----------------+------------------------------------+
17771f2e9baSJasvinder Singh   | IP routing            | LPM (IPv4)           | Forward        | 1. Mempool Create                  |
17871f2e9baSJasvinder Singh   |                       |                      |                | 2. Link create                     |
179d629b7b5SJohn McNamara   |                       | * Key = IP dest addr |                | 3. Pipeline create                 |
18071f2e9baSJasvinder Singh   |                       | * Offset = 286       |                | 4. Pipeline port in/out            |
18171f2e9baSJasvinder Singh   |                       | * Table size = 4K    |                | 5. Pipeline table                  |
18271f2e9baSJasvinder Singh   |                       |                      |                | 6. Pipeline port in table          |
18371f2e9baSJasvinder Singh   |                       |                      |                | 7. Pipeline enable                 |
18471f2e9baSJasvinder Singh   |                       |                      |                | 8. Pipeline table rule add default |
18571f2e9baSJasvinder Singh   |                       |                      |                | 9. Pipeline table rule add         |
18671f2e9baSJasvinder Singh   +-----------------------+----------------------+----------------+------------------------------------+
18771f2e9baSJasvinder Singh   | Equal-cost multi-path | LPM (IPv4)           | Forward,       | 1. Mempool Create                  |
18871f2e9baSJasvinder Singh   | routing (ECMP)        |                      | load balance,  | 2. Link create                     |
18971f2e9baSJasvinder Singh   |                       | * Key = IP dest addr | encap ether    | 3. Pipeline create                 |
19071f2e9baSJasvinder Singh   |                       | * Offset = 286       |                | 4. Pipeline port in/out            |
19171f2e9baSJasvinder Singh   |                       | * Table size = 4K    |                | 5. Pipeline table (LPM)            |
19271f2e9baSJasvinder Singh   |                       |                      |                | 6. Pipeline table (Array)          |
19371f2e9baSJasvinder Singh   |                       |                      |                | 7. Pipeline port in table (LPM)    |
19471f2e9baSJasvinder Singh   |                       | Array                |                | 8. Pipeline enable                 |
19571f2e9baSJasvinder Singh   |                       |                      |                | 9. Pipeline table rule add default |
19671f2e9baSJasvinder Singh   |                       | * Key = Array index  |                | 10. Pipeline table rule add(LPM)   |
19771f2e9baSJasvinder Singh   |                       | * Offset = 256       |                | 11. Pipeline table rule add(Array) |
19871f2e9baSJasvinder Singh   |                       | * Size = 64K         |                |                                    |
199f1e779ecSCristian Dumitrescu   |                       |                      |                |                                    |
20071f2e9baSJasvinder Singh   +-----------------------+----------------------+----------------+------------------------------------+
201f1e779ecSCristian Dumitrescu
202f1e779ecSCristian DumitrescuCommand Line Interface (CLI)
203f1e779ecSCristian Dumitrescu----------------------------
204f1e779ecSCristian Dumitrescu
20571f2e9baSJasvinder SinghLink
20671f2e9baSJasvinder Singh~~~~
207f1e779ecSCristian Dumitrescu
20871f2e9baSJasvinder Singh Link configuration ::
209f1e779ecSCristian Dumitrescu
21071f2e9baSJasvinder Singh   link <link_name>
21171f2e9baSJasvinder Singh    dev <device_name>|port <port_id>
21271f2e9baSJasvinder Singh    rxq <n_queues> <queue_size> <mempool_name>
21371f2e9baSJasvinder Singh    txq <n_queues> <queue_size> promiscuous on | off
21471f2e9baSJasvinder Singh    [rss <qid_0> ... <qid_n>]
215f1e779ecSCristian Dumitrescu
216bc57bef7SKevin Laatz Note: The PCI device name must be specified in the Domain:Bus:Device.Function format.
217bc57bef7SKevin Laatz
218f1e779ecSCristian Dumitrescu
21971f2e9baSJasvinder SinghMempool
22071f2e9baSJasvinder Singh~~~~~~~
221f1e779ecSCristian Dumitrescu
22271f2e9baSJasvinder Singh Mempool create ::
223f1e779ecSCristian Dumitrescu
22471f2e9baSJasvinder Singh   mempool <mempool_name> buffer <buffer_size>
22571f2e9baSJasvinder Singh   pool <pool_size> cache <cache_size> cpu <cpu_id>
226f1e779ecSCristian Dumitrescu
227f1e779ecSCristian Dumitrescu
22871f2e9baSJasvinder SinghSoftware queue
22971f2e9baSJasvinder Singh~~~~~~~~~~~~~~
230f1e779ecSCristian Dumitrescu
23171f2e9baSJasvinder Singh  Create software queue ::
232f1e779ecSCristian Dumitrescu
23371f2e9baSJasvinder Singh   swq <swq_name> size <size> cpu <cpu_id>
234f1e779ecSCristian Dumitrescu
235f1e779ecSCristian Dumitrescu
23671f2e9baSJasvinder SinghTraffic manager
23771f2e9baSJasvinder Singh~~~~~~~~~~~~~~~
238f1e779ecSCristian Dumitrescu
23971f2e9baSJasvinder Singh Add traffic manager subport profile ::
240f1e779ecSCristian Dumitrescu
24171f2e9baSJasvinder Singh  tmgr subport profile
24271f2e9baSJasvinder Singh   <tb_rate> <tb_size>
243694fd2cbSJasvinder Singh   <tc0_rate> <tc1_rate> <tc2_rate> <tc3_rate> <tc4_rate>
244694fd2cbSJasvinder Singh   <tc5_rate> <tc6_rate> <tc7_rate> <tc8_rate>
245694fd2cbSJasvinder Singh   <tc9_rate> <tc10_rate> <tc11_rate> <tc12_rate>
24671f2e9baSJasvinder Singh   <tc_period>
24771f2e9baSJasvinder Singh
24871f2e9baSJasvinder Singh Add traffic manager pipe profile ::
24971f2e9baSJasvinder Singh
25071f2e9baSJasvinder Singh  tmgr pipe profile
25171f2e9baSJasvinder Singh   <tb_rate> <tb_size>
252694fd2cbSJasvinder Singh   <tc0_rate> <tc1_rate> <tc2_rate> <tc3_rate> <tc4_rate>
253694fd2cbSJasvinder Singh   <tc5_rate> <tc6_rate> <tc7_rate> <tc8_rate>
254694fd2cbSJasvinder Singh   <tc9_rate> <tc10_rate> <tc11_rate> <tc12_rate>
25571f2e9baSJasvinder Singh   <tc_period>
256694fd2cbSJasvinder Singh   <tc_ov_weight>
257694fd2cbSJasvinder Singh   <wrr_weight0..3>
25871f2e9baSJasvinder Singh
25971f2e9baSJasvinder Singh Create traffic manager port ::
26071f2e9baSJasvinder Singh
26171f2e9baSJasvinder Singh  tmgr <tmgr_name>
26271f2e9baSJasvinder Singh   rate <rate>
26371f2e9baSJasvinder Singh   spp <n_subports_per_port>
26443ccdca6SSavinay Dharmappa   pps <n_pipes_per_subport>
265694fd2cbSJasvinder Singh   fo <frame_overhead>
266694fd2cbSJasvinder Singh   mtu <mtu>
267694fd2cbSJasvinder Singh   cpu <cpu_id>
26871f2e9baSJasvinder Singh
26971f2e9baSJasvinder Singh Configure traffic manager subport ::
27071f2e9baSJasvinder Singh
27171f2e9baSJasvinder Singh  tmgr <tmgr_name>
27271f2e9baSJasvinder Singh   subport <subport_id>
27371f2e9baSJasvinder Singh   profile <subport_profile_id>
27471f2e9baSJasvinder Singh
27571f2e9baSJasvinder Singh Configure traffic manager pipe ::
27671f2e9baSJasvinder Singh
27771f2e9baSJasvinder Singh  tmgr <tmgr_name>
27871f2e9baSJasvinder Singh   subport <subport_id>
27971f2e9baSJasvinder Singh   pipe from <pipe_id_first> to <pipe_id_last>
28071f2e9baSJasvinder Singh   profile <pipe_profile_id>
28171f2e9baSJasvinder Singh
28271f2e9baSJasvinder Singh
28371f2e9baSJasvinder SinghTap
28471f2e9baSJasvinder Singh~~~
28571f2e9baSJasvinder Singh
28671f2e9baSJasvinder Singh Create tap port ::
28771f2e9baSJasvinder Singh
28871f2e9baSJasvinder Singh  tap <name>
28971f2e9baSJasvinder Singh
29071f2e9baSJasvinder Singh
2911edccebcSFan ZhangCryptodev
2921edccebcSFan Zhang~~~~~~~~~
2931edccebcSFan Zhang
2941edccebcSFan Zhang  Create cryptodev port ::
2951edccebcSFan Zhang
2961edccebcSFan Zhang   cryptodev <cryptodev_name>
2971edccebcSFan Zhang    dev <DPDK Cryptodev PMD name>
2981edccebcSFan Zhang    queue <n_queues> <queue_size>
2991edccebcSFan Zhang
30071f2e9baSJasvinder SinghAction profile
30171f2e9baSJasvinder Singh~~~~~~~~~~~~~~
30271f2e9baSJasvinder Singh
30371f2e9baSJasvinder Singh Create action profile for pipeline input port ::
30471f2e9baSJasvinder Singh
30571f2e9baSJasvinder Singh  port in action profile <profile_name>
30671f2e9baSJasvinder Singh   [filter match | mismatch offset <key_offset> mask <key_mask> key <key_value> port <port_id>]
30771f2e9baSJasvinder Singh   [balance offset <key_offset> mask <key_mask> port <port_id0> ... <port_id15>]
30871f2e9baSJasvinder Singh
30971f2e9baSJasvinder Singh Create action profile for the pipeline table ::
31071f2e9baSJasvinder Singh
31171f2e9baSJasvinder Singh  table action profile <profile_name>
31271f2e9baSJasvinder Singh   ipv4 | ipv6
31371f2e9baSJasvinder Singh   offset <ip_offset>
31471f2e9baSJasvinder Singh   fwd
31571f2e9baSJasvinder Singh   [balance offset <key_offset> mask <key_mask> outoffset <out_offset>]
31671f2e9baSJasvinder Singh   [meter srtcm | trtcm
31771f2e9baSJasvinder Singh       tc <n_tc>
31871f2e9baSJasvinder Singh       stats none | pkts | bytes | both]
31971f2e9baSJasvinder Singh   [tm spp <n_subports_per_port> pps <n_pipes_per_subport>]
32071f2e9baSJasvinder Singh   [encap ether | vlan | qinq | mpls | pppoe]
32171f2e9baSJasvinder Singh   [nat src | dst
32271f2e9baSJasvinder Singh       proto udp | tcp]
32371f2e9baSJasvinder Singh   [ttl drop | fwd
32471f2e9baSJasvinder Singh       stats none | pkts]
32571f2e9baSJasvinder Singh   [stats pkts | bytes | both]
3261edccebcSFan Zhang   [sym_crypto cryptodev <cryptodev_name>
3271edccebcSFan Zhang       mempool_create <mempool_name> mempool_init <mempool_name>]
32871f2e9baSJasvinder Singh   [time]
32971f2e9baSJasvinder Singh
33071f2e9baSJasvinder Singh
33171f2e9baSJasvinder SinghPipeline
33271f2e9baSJasvinder Singh~~~~~~~~
33371f2e9baSJasvinder Singh
33471f2e9baSJasvinder SinghCreate pipeline ::
33571f2e9baSJasvinder Singh
33671f2e9baSJasvinder Singh  pipeline <pipeline_name>
33771f2e9baSJasvinder Singh   period <timer_period_ms>
33871f2e9baSJasvinder Singh   offset_port_id <offset_port_id>
33971f2e9baSJasvinder Singh   cpu <cpu_id>
34071f2e9baSJasvinder Singh
34171f2e9baSJasvinder SinghCreate pipeline input port ::
34271f2e9baSJasvinder Singh
34371f2e9baSJasvinder Singh  pipeline <pipeline_name> port in
34471f2e9baSJasvinder Singh   bsz <burst_size>
34571f2e9baSJasvinder Singh   link <link_name> rxq <queue_id>
34671f2e9baSJasvinder Singh   | swq <swq_name>
34771f2e9baSJasvinder Singh   | tmgr <tmgr_name>
34871f2e9baSJasvinder Singh   | tap <tap_name> mempool <mempool_name> mtu <mtu>
34971f2e9baSJasvinder Singh   | source mempool <mempool_name> file <file_name> bpp <n_bytes_per_pkt>
35071f2e9baSJasvinder Singh   [action <port_in_action_profile_name>]
35171f2e9baSJasvinder Singh   [disabled]
35271f2e9baSJasvinder Singh
35371f2e9baSJasvinder SinghCreate pipeline output port ::
35471f2e9baSJasvinder Singh
35571f2e9baSJasvinder Singh  pipeline <pipeline_name> port out
35671f2e9baSJasvinder Singh   bsz <burst_size>
35771f2e9baSJasvinder Singh   link <link_name> txq <txq_id>
35871f2e9baSJasvinder Singh   | swq <swq_name>
35971f2e9baSJasvinder Singh   | tmgr <tmgr_name>
36071f2e9baSJasvinder Singh   | tap <tap_name>
36171f2e9baSJasvinder Singh   | sink [file <file_name> pkts <max_n_pkts>]
36271f2e9baSJasvinder Singh
36371f2e9baSJasvinder SinghCreate pipeline table ::
36471f2e9baSJasvinder Singh
36571f2e9baSJasvinder Singh  pipeline <pipeline_name> table
36671f2e9baSJasvinder Singh       match
36771f2e9baSJasvinder Singh       acl
36871f2e9baSJasvinder Singh           ipv4 | ipv6
36971f2e9baSJasvinder Singh           offset <ip_header_offset>
37071f2e9baSJasvinder Singh           size <n_rules>
37171f2e9baSJasvinder Singh       | array
37271f2e9baSJasvinder Singh           offset <key_offset>
37371f2e9baSJasvinder Singh           size <n_keys>
37471f2e9baSJasvinder Singh       | hash
37571f2e9baSJasvinder Singh           ext | lru
37671f2e9baSJasvinder Singh           key <key_size>
37771f2e9baSJasvinder Singh           mask <key_mask>
37871f2e9baSJasvinder Singh           offset <key_offset>
37971f2e9baSJasvinder Singh           buckets <n_buckets>
38071f2e9baSJasvinder Singh           size <n_keys>
38171f2e9baSJasvinder Singh       | lpm
38271f2e9baSJasvinder Singh           ipv4 | ipv6
38371f2e9baSJasvinder Singh           offset <ip_header_offset>
38471f2e9baSJasvinder Singh           size <n_rules>
38571f2e9baSJasvinder Singh       | stub
38671f2e9baSJasvinder Singh   [action <table_action_profile_name>]
38771f2e9baSJasvinder Singh
38871f2e9baSJasvinder SinghConnect pipeline input port to table ::
38971f2e9baSJasvinder Singh
39071f2e9baSJasvinder Singh  pipeline <pipeline_name> port in <port_id> table <table_id>
39171f2e9baSJasvinder Singh
39271f2e9baSJasvinder SinghDisplay statistics for specific pipeline input port, output port
39371f2e9baSJasvinder Singhor table ::
39471f2e9baSJasvinder Singh
39571f2e9baSJasvinder Singh  pipeline <pipeline_name> port in <port_id> stats read [clear]
39671f2e9baSJasvinder Singh  pipeline <pipeline_name> port out <port_id> stats read [clear]
39771f2e9baSJasvinder Singh  pipeline <pipeline_name> table <table_id> stats read [clear]
39871f2e9baSJasvinder Singh
39971f2e9baSJasvinder SinghEnable given input port for specific pipeline instance ::
40071f2e9baSJasvinder Singh
40171f2e9baSJasvinder Singh  pipeline <pipeline_name> port out <port_id> disable
40271f2e9baSJasvinder Singh
40371f2e9baSJasvinder SinghDisable given input port for specific pipeline instance ::
40471f2e9baSJasvinder Singh
40571f2e9baSJasvinder Singh  pipeline <pipeline_name> port out <port_id> disable
40671f2e9baSJasvinder Singh
40771f2e9baSJasvinder SinghAdd default rule to table for specific pipeline instance ::
40871f2e9baSJasvinder Singh
40971f2e9baSJasvinder Singh  pipeline <pipeline_name> table <table_id> rule add
41071f2e9baSJasvinder Singh     match
41171f2e9baSJasvinder Singh        default
41271f2e9baSJasvinder Singh     action
41371f2e9baSJasvinder Singh        fwd
41471f2e9baSJasvinder Singh           drop
41571f2e9baSJasvinder Singh           | port <port_id>
41671f2e9baSJasvinder Singh           | meta
41771f2e9baSJasvinder Singh           | table <table_id>
41871f2e9baSJasvinder Singh
41971f2e9baSJasvinder SinghAdd rule to table for specific pipeline instance ::
42071f2e9baSJasvinder Singh
42171f2e9baSJasvinder Singh  pipeline <pipeline_name> table <table_id> rule add
42271f2e9baSJasvinder Singh
42371f2e9baSJasvinder Singh  match
42471f2e9baSJasvinder Singh     acl
42571f2e9baSJasvinder Singh        priority <priority>
42671f2e9baSJasvinder Singh        ipv4 | ipv6 <sa> <sa_depth> <da> <da_depth>
42771f2e9baSJasvinder Singh        <sp0> <sp1> <dp0> <dp1> <proto>
42871f2e9baSJasvinder Singh     | array <pos>
42971f2e9baSJasvinder Singh     | hash
43071f2e9baSJasvinder Singh        raw <key>
43171f2e9baSJasvinder Singh        | ipv4_5tuple <sa> <da> <sp> <dp> <proto>
43271f2e9baSJasvinder Singh        | ipv6_5tuple <sa> <da> <sp> <dp> <proto>
43371f2e9baSJasvinder Singh        | ipv4_addr <addr>
43471f2e9baSJasvinder Singh        | ipv6_addr <addr>
43571f2e9baSJasvinder Singh        | qinq <svlan> <cvlan>
43671f2e9baSJasvinder Singh     | lpm
43771f2e9baSJasvinder Singh        ipv4 | ipv6 <addr> <depth>
43871f2e9baSJasvinder Singh
43971f2e9baSJasvinder Singh  action
44071f2e9baSJasvinder Singh     fwd
44171f2e9baSJasvinder Singh        drop
44271f2e9baSJasvinder Singh        | port <port_id>
44371f2e9baSJasvinder Singh        | meta
44471f2e9baSJasvinder Singh        | table <table_id>
44571f2e9baSJasvinder Singh     [balance <out0> ... <out7>]
44671f2e9baSJasvinder Singh     [meter
44771f2e9baSJasvinder Singh        tc0 meter <meter_profile_id> policer g <pa> y <pa> r <pa>
44871f2e9baSJasvinder Singh        [tc1 meter <meter_profile_id> policer g <pa> y <pa> r <pa>
44971f2e9baSJasvinder Singh        tc2 meter <meter_profile_id> policer g <pa> y <pa> r <pa>
45071f2e9baSJasvinder Singh        tc3 meter <meter_profile_id> policer g <pa> y <pa> r <pa>]]
45171f2e9baSJasvinder Singh     [tm subport <subport_id> pipe <pipe_id>]
45271f2e9baSJasvinder Singh     [encap
45371f2e9baSJasvinder Singh        ether <da> <sa>
45471f2e9baSJasvinder Singh        | vlan <da> <sa> <pcp> <dei> <vid>
45571f2e9baSJasvinder Singh        | qinq <da> <sa> <pcp> <dei> <vid> <pcp> <dei> <vid>
45671f2e9baSJasvinder Singh        | mpls unicast | multicast
45771f2e9baSJasvinder Singh           <da> <sa>
45871f2e9baSJasvinder Singh           label0 <label> <tc> <ttl>
45971f2e9baSJasvinder Singh           [label1 <label> <tc> <ttl>
46071f2e9baSJasvinder Singh           [label2 <label> <tc> <ttl>
46171f2e9baSJasvinder Singh           [label3 <label> <tc> <ttl>]]]
46271f2e9baSJasvinder Singh        | pppoe <da> <sa> <session_id>]
46371f2e9baSJasvinder Singh     [nat ipv4 | ipv6 <addr> <port>]
46471f2e9baSJasvinder Singh     [ttl dec | keep]
46571f2e9baSJasvinder Singh     [stats]
46671f2e9baSJasvinder Singh     [time]
4671edccebcSFan Zhang     [sym_crypto
4681edccebcSFan Zhang        encrypt | decrypt
4691edccebcSFan Zhang        type
4701edccebcSFan Zhang        | cipher
4711edccebcSFan Zhang           cipher_algo <algo> cipher_key <key> cipher_iv <iv>
4721edccebcSFan Zhang        | cipher_auth
4731edccebcSFan Zhang           cipher_algo <algo> cipher_key <key> cipher_iv <iv>
4741edccebcSFan Zhang           auth_algo <algo> auth_key <key> digest_size <size>
4751edccebcSFan Zhang        | aead
4761edccebcSFan Zhang           aead_algo <algo> aead_key <key> aead_iv <iv> aead_aad <aad>
4771edccebcSFan Zhang           digest_size <size>
4781edccebcSFan Zhang        data_offset <data_offset>]
47971f2e9baSJasvinder Singh
48071f2e9baSJasvinder Singh  where:
48171f2e9baSJasvinder Singh     <pa> ::= g | y | r | drop
48271f2e9baSJasvinder Singh
48371f2e9baSJasvinder SinghAdd bulk rules to table for specific pipeline instance ::
48471f2e9baSJasvinder Singh
48571f2e9baSJasvinder Singh  pipeline <pipeline_name> table <table_id> rule add bulk <file_name> <n_rules>
48671f2e9baSJasvinder Singh
48771f2e9baSJasvinder Singh  Where:
48871f2e9baSJasvinder Singh  - file_name = path to file
48971f2e9baSJasvinder Singh  - File line format = match <match> action <action>
49071f2e9baSJasvinder Singh
49171f2e9baSJasvinder SinghDelete table rule for specific pipeline instance ::
49271f2e9baSJasvinder Singh
49371f2e9baSJasvinder Singh  pipeline <pipeline_name> table <table_id> rule delete
49471f2e9baSJasvinder Singh     match <match>
49571f2e9baSJasvinder Singh
49671f2e9baSJasvinder SinghDelete default table rule for specific pipeline instance ::
49771f2e9baSJasvinder Singh
49871f2e9baSJasvinder Singh  pipeline <pipeline_name> table <table_id> rule delete
49971f2e9baSJasvinder Singh     match
50071f2e9baSJasvinder Singh        default
50171f2e9baSJasvinder Singh
50271f2e9baSJasvinder SinghAdd meter profile to the table for specific pipeline instance ::
50371f2e9baSJasvinder Singh
50471f2e9baSJasvinder Singh  pipeline <pipeline_name> table <table_id> meter profile <meter_profile_id>
50571f2e9baSJasvinder Singh   add srtcm cir <cir> cbs <cbs> ebs <ebs>
50671f2e9baSJasvinder Singh   | trtcm cir <cir> pir <pir> cbs <cbs> pbs <pbs>
50771f2e9baSJasvinder Singh
50871f2e9baSJasvinder SinghDelete meter profile from the table for specific pipeline instance ::
50971f2e9baSJasvinder Singh
51071f2e9baSJasvinder Singh  pipeline <pipeline_name> table <table_id>
51171f2e9baSJasvinder Singh   meter profile <meter_profile_id> delete
51271f2e9baSJasvinder Singh
51371f2e9baSJasvinder Singh
51471f2e9baSJasvinder SinghUpdate the dscp table for meter or traffic manager action for specific
51571f2e9baSJasvinder Singhpipeline instance ::
51671f2e9baSJasvinder Singh
51771f2e9baSJasvinder Singh   pipeline <pipeline_name> table <table_id> dscp <file_name>
51871f2e9baSJasvinder Singh
51971f2e9baSJasvinder Singh   Where:
52071f2e9baSJasvinder Singh      - file_name = path to file
52171f2e9baSJasvinder Singh      - exactly 64 lines
52271f2e9baSJasvinder Singh      - File line format = <tc_id> <tc_queue_id> <color>, with <color> as: g | y | r
52371f2e9baSJasvinder Singh
52471f2e9baSJasvinder Singh
52571f2e9baSJasvinder SinghPipeline enable/disable
52671f2e9baSJasvinder Singh~~~~~~~~~~~~~~~~~~~~~~~
52771f2e9baSJasvinder Singh
52871f2e9baSJasvinder Singh   Enable given pipeline instance for specific data plane thread ::
52971f2e9baSJasvinder Singh
53071f2e9baSJasvinder Singh    thread <thread_id> pipeline <pipeline_name> enable
53171f2e9baSJasvinder Singh
53271f2e9baSJasvinder Singh
53371f2e9baSJasvinder Singh   Disable given pipeline instance for specific data plane thread ::
53471f2e9baSJasvinder Singh
53571f2e9baSJasvinder Singh    thread <thread_id> pipeline <pipeline_name> disable
536