129485dd0SCristian Dumitrescu.. SPDX-License-Identifier: BSD-3-Clause 229485dd0SCristian Dumitrescu Copyright(c) 2020 Intel Corporation. 329485dd0SCristian Dumitrescu 429485dd0SCristian DumitrescuPipeline Application 529485dd0SCristian Dumitrescu==================== 629485dd0SCristian Dumitrescu 729485dd0SCristian DumitrescuApplication overview 829485dd0SCristian Dumitrescu-------------------- 929485dd0SCristian Dumitrescu 1029485dd0SCristian DumitrescuThis application showcases the features of the Software Switch (SWX) pipeline that is aligned with the P4 language. 1129485dd0SCristian Dumitrescu 1229485dd0SCristian DumitrescuEach pipeline is created using a specification file that can either be manually developed or generated using a P4 compiler. 1329485dd0SCristian Dumitrescu 1429485dd0SCristian DumitrescuEach pipeline is built through the CLI, either by invoking commands one by one, or through a CLI script. 1529485dd0SCristian DumitrescuThe CLI can also be used to update the pipeline tables or poll the pipeline statistics. 1629485dd0SCristian Dumitrescu 1729485dd0SCristian DumitrescuEach pipeline is mapped to a specific application thread. Multiple pipelines can be mapped to the same thread. 1829485dd0SCristian Dumitrescu 1929485dd0SCristian DumitrescuRunning the application 2029485dd0SCristian Dumitrescu----------------------- 2129485dd0SCristian Dumitrescu 2229485dd0SCristian DumitrescuThe application startup command line is:: 2329485dd0SCristian Dumitrescu 2429485dd0SCristian Dumitrescu dpdk-pipeline [EAL_ARGS] -- [-s SCRIPT_FILE] [-h HOST] [-p PORT] 2529485dd0SCristian Dumitrescu 2629485dd0SCristian DumitrescuThe application startup arguments are: 2729485dd0SCristian Dumitrescu 2829485dd0SCristian Dumitrescu``-s SCRIPT_FILE`` 2929485dd0SCristian Dumitrescu 3029485dd0SCristian Dumitrescu * Optional: Yes 3129485dd0SCristian Dumitrescu 3229485dd0SCristian Dumitrescu * Default: Not present 3329485dd0SCristian Dumitrescu 3429485dd0SCristian Dumitrescu * Argument: Path to the CLI script file to be run at application startup. 3529485dd0SCristian Dumitrescu No CLI script file will run at startup if this argument is not present. 3629485dd0SCristian Dumitrescu 3729485dd0SCristian Dumitrescu``-h HOST`` 3829485dd0SCristian Dumitrescu 3929485dd0SCristian Dumitrescu * Optional: Yes 4029485dd0SCristian Dumitrescu 4129485dd0SCristian Dumitrescu * Default: ``0.0.0.0`` 4229485dd0SCristian Dumitrescu 4329485dd0SCristian Dumitrescu * Argument: IP Address of the host running the application to be used by 4429485dd0SCristian Dumitrescu remote TCP based client (telnet, netcat, etc.) for connection. 4529485dd0SCristian Dumitrescu 4629485dd0SCristian Dumitrescu``-p PORT`` 4729485dd0SCristian Dumitrescu 4829485dd0SCristian Dumitrescu * Optional: Yes 4929485dd0SCristian Dumitrescu 5029485dd0SCristian Dumitrescu * Default: ``8086`` 5129485dd0SCristian Dumitrescu 5229485dd0SCristian Dumitrescu * Argument: TCP port number at which the application is running. 5329485dd0SCristian Dumitrescu This port number should be used by remote TCP client (such as telnet, netcat, etc.) to connect to host application. 5429485dd0SCristian Dumitrescu 5529485dd0SCristian DumitrescuRefer to *DPDK Getting Started Guide* for general information on running applications and the Environment Abstraction Layer (EAL) options. 5629485dd0SCristian Dumitrescu 5729485dd0SCristian DumitrescuThe following is an example command to run the application configured for the VXLAN encapsulation example: 5829485dd0SCristian Dumitrescu 5929485dd0SCristian Dumitrescu.. code-block:: console 6029485dd0SCristian Dumitrescu 610ab37572SHarshad Narayane $ ./<build_dir>/examples/dpdk-pipeline -c 0x3 -- -s examples/pipeline/examples/vxlan.cli 6229485dd0SCristian Dumitrescu 6329485dd0SCristian DumitrescuThe application should start successfully and display as follows: 6429485dd0SCristian Dumitrescu 6529485dd0SCristian Dumitrescu.. code-block:: console 6629485dd0SCristian Dumitrescu 6729485dd0SCristian Dumitrescu EAL: Detected 40 lcore(s) 6829485dd0SCristian Dumitrescu EAL: Detected 2 NUMA nodes 6929485dd0SCristian Dumitrescu EAL: Multi-process socket /var/run/.rte_unix 7029485dd0SCristian Dumitrescu EAL: Probing VFIO support... 7129485dd0SCristian Dumitrescu EAL: PCI device 0000:02:00.0 on NUMA socket 0 7229485dd0SCristian Dumitrescu EAL: probe driver: 8086:10fb net_ixgbe 7329485dd0SCristian Dumitrescu ... 7429485dd0SCristian Dumitrescu 7529485dd0SCristian DumitrescuTo run remote client (e.g. telnet) to communicate with the application: 7629485dd0SCristian Dumitrescu 7729485dd0SCristian Dumitrescu.. code-block:: console 7829485dd0SCristian Dumitrescu 7929485dd0SCristian Dumitrescu $ telnet 0.0.0.0 8086 8029485dd0SCristian Dumitrescu 8129485dd0SCristian DumitrescuWhen running a telnet client as above, command prompt is displayed: 8229485dd0SCristian Dumitrescu 8329485dd0SCristian Dumitrescu.. code-block:: console 8429485dd0SCristian Dumitrescu 8529485dd0SCristian Dumitrescu Trying 0.0.0.0... 8629485dd0SCristian Dumitrescu Connected to 0.0.0.0. 8729485dd0SCristian Dumitrescu Escape character is '^]'. 8829485dd0SCristian Dumitrescu 8929485dd0SCristian Dumitrescu Welcome! 9029485dd0SCristian Dumitrescu 9129485dd0SCristian Dumitrescu pipeline> 9229485dd0SCristian Dumitrescu 9329485dd0SCristian DumitrescuOnce application and telnet client start running, messages can be sent from client to application. 9429485dd0SCristian Dumitrescu 9529485dd0SCristian Dumitrescu 9629485dd0SCristian DumitrescuApplication stages 9729485dd0SCristian Dumitrescu------------------ 9829485dd0SCristian Dumitrescu 9929485dd0SCristian DumitrescuInitialization 10029485dd0SCristian Dumitrescu~~~~~~~~~~~~~~ 10129485dd0SCristian Dumitrescu 10229485dd0SCristian DumitrescuDuring this stage, EAL layer is initialised and application specific arguments are parsed. Furthermore, the data structures 10329485dd0SCristian Dumitrescufor application objects are initialized. In case of any initialization error, an error message is displayed and the application 10429485dd0SCristian Dumitrescuis terminated. 10529485dd0SCristian Dumitrescu 10629485dd0SCristian DumitrescuRun-time 10729485dd0SCristian Dumitrescu~~~~~~~~ 10829485dd0SCristian Dumitrescu 10929485dd0SCristian DumitrescuThe main thread is creating and managing all the application objects based on CLI input. 11029485dd0SCristian Dumitrescu 11129485dd0SCristian DumitrescuEach data plane thread runs one or several pipelines previously assigned to it in round-robin order. Each data plane thread 11229485dd0SCristian Dumitrescuexecutes two tasks in time-sharing mode: 11329485dd0SCristian Dumitrescu 114*443b949eSDavid Marchand#. *Packet processing task*: Process bursts of input packets read from the pipeline input ports. 11529485dd0SCristian Dumitrescu 116*443b949eSDavid Marchand#. *Message handling task*: Periodically, the data plane thread pauses the packet processing task and polls for request 11729485dd0SCristian Dumitrescu messages send by the main thread. Examples: add/remove pipeline to/from current data plane thread, add/delete rules 11829485dd0SCristian Dumitrescu to/from given table of a specific pipeline owned by the current data plane thread, read statistics, etc. 119