p4bm-vitisnet-cli Application - 2022.2 English

Vitis Networking P4 User Guide (UG1308)

Document ID
UG1308
Version
2022.2 English
Revision

The p4bm-vitisnet-cli application provides the control plane functionality needed to operate the p4bm-vitisnet data plane.

When launched, p4bm-vitisnet-cli attempts to establish a connection to an already running p4bm-vitisnet process, using the port specified. If a connection cannot be established, it retries for a user specified number of attempts before giving up.

Upon successful connection, the user is presented with an interactive command line which includes built-in help for all supported commands. The list of commands can be obtained by entering help and usage information for each command can be obtained by entering help <command>. For example: help table_add.

The following table describes the most important commands supported by the CLI.

Table 1. CLI Supported Commands
Parameter Description
- help Display the list of commands and provides access to usage information for each command
- show_tables List all tables present
- table_add Add an entry to a specified table
- table_delete Remove an entry from a specified table
- table_clear Reset a specified table
- table_dump Display the contents of a specified table
- counter_read Read a counter value from a specified counter extern
- counter_write Update a counter value of a specified counter extern
- counter_reset Reset all counter values of a specified counter extern
- run_traffic Define the source of packet data, and optionally metadata (see below for further detail)
- exit Terminate both the CLI and the model (causes p4bm-vitisnet to exit)

The run_traffic command takes a single parameter which is used as a base from which the source/input and destination/output files for packet data and metadata are derived by appending some extra text. For instance command run_traffic causes the following to take place:

  1. The p4bm-vitisnet application attempts to open the example_in.pcap file for reading.
  2. If step 1 succeeded, it then opens example_out.pcap for writing.
  3. If step 1 failed, the p4bm-vitisnet application attempts to open example_in.user for reading.
  4. If step 3 succeeded, it then opens example_out.user for writing.
  5. The p4bm-vitisnet application then attempts to open example_in.meta reading
  6. The p4bm-vitisnet application finally attempts to open example_out.meta for writing.

These steps describe how the model selects between the PCAP file and the Xilinx packet text file format, for example, PCAP is given priority if present. The file selected as input determines the format of the output, for example, if a PCAP input is found, the output is also PCAP. The process also shows that the input metadata file is optional and can be omitted if desired. When omitted, all metadata is initialized to zero by the model.

The application supports the command line parameters identified in the following table.

Table 2. Optional Parameters
Parameter Description
-h [--help] Prints a list of possible parameters and a short description.
--thrift-port THRIFT_PORT Thrift server port for table updates (socket connection to model).