From 3344147d9d5dd9e064ac2d98b5088426cc32e191 Mon Sep 17 00:00:00 2001 From: riyazahm22 Date: Wed, 27 Jul 2022 03:41:48 -0400 Subject: [PATCH] Release logs | add release logs, change logs and update README. --- CHANGELOG.md | 37 +++ README | 70 +++--- README.md | 233 ++++++++++++++++++ RELEASENOTES.md | 18 ++ examples/pna/simple_lpm/Readme | 16 +- .../tap_port/bf_shell_commands.txt | 54 ++++ .../tap_port/bfrt_sample_config.conf | 55 +++++ .../port_config/tap_port/port_config.json | 72 ++++++ examples/psa/simple_l2l3_lpm/Readme | 16 +- 9 files changed, 527 insertions(+), 44 deletions(-) create mode 100644 CHANGELOG.md create mode 100644 README.md create mode 100644 RELEASENOTES.md create mode 100644 examples/port_config/tap_port/bf_shell_commands.txt create mode 100644 examples/port_config/tap_port/bfrt_sample_config.conf create mode 100644 examples/port_config/tap_port/port_config.json diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..4a96bb9 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,37 @@ +## [v22.07] - 2022-07-27 + +### Added + +* Linux Networking support (L2 Forwarding, VXLAN, Routing, Connection Tracking) +* TDI Integration and TDI CLI Python support. +* PAL API support to retrieve fixed table functionality such as port, device etc. +* Direct Match Table support [Match kind supported - Exact, Ternary, LPM]. +* Indirect Match Table support - Action Selector, Action Profile. +* Indirect Counter support. +* Port and Vport support. +* Auto learn support. +* PNA meta data direction support. +* Table default action with arguments support. +* Multiple Pipeline support. +* Hotplug support for vhost-user ports. +* Enable DPDK backend cli to get port/mac stats. +* GTEST based Unit test framework. + +### Fixed + +* Table name is different in ContextJSON and SPEC artifacts/file. +* Display of custom MTU value for TAP port set by gnmi-cli. +* Action profile/selector: table entry addition is failing for action profile or selector tests. +* Action selector: deleting non-existing group (the first one) did not generate error. +* Indirect Counter: Flow / Indirect counters does not account packet counters. +* Indirect Counter: Reset-counter not working for flow counters. + +### Limitation + +* Counter: No support for Counter cell display when index is not set. +* Counter: Cumulative count of all counters not supported (index is 0). +* Configure invalid port in rule and sending traffic causes application to crash. +* Add/Remove Hot plug interface on VM1/VM2 does not resume ping traffic on any VM in the same host in LNT Feature. +* Need to set PYTHONPATH and PYTHONHOME for tdi_python to work and LD_LIBRARY_PATH to the custom library path. +* Logging: Following error logs of type "BF_BFRT ERROR" and "BF_BFRT FATAL" generated when lanunching the OVS but + no functional impact. diff --git a/README b/README index 41674e7..acbd491 100644 --- a/README +++ b/README @@ -16,14 +16,16 @@ p4-dpdk-target works in conjunction with following repos: DPDK SWX Pipeline: (https://github.com/DPDK/dpdk/blob/main/lib/pipeline) + Version: 22.07-rc2 + P4 DPDK SWX pipeline implements the P4 pipeline in a DPDK software switch. The software switch is driven by artifacts generated by the P4 compiler for P4 DPDK SWX pipeline. p4-dpdk-target submodules dpdk repo to build P4 DPDK pipeline. Note about DPDK Patches (p4-dpdk-target/src/lld/dpdk/patch): - DPDK patches 0001-pipeline-updated-instruction-label-check.patch and - 0001-add-ctl-wrapper-api.patch are a temporary solution and will be - removed. The fixes are being worked upon and will be committed soon. + DPDK patches 007-Fix-pipeline-structs-initialization.patch + is a temporary solution and will be removed. + The fixes are being worked upon and will be committed soon. P4 Compiler DPDK Backend: (https://github.com/p4lang/p4c/tree/main/backends/dpdk) @@ -36,19 +38,11 @@ p4-dpdk-target works in conjunction with following repos: The P4 DPDK spec file from P4C DPDK, which is used by DPDK SWX pipeline to setup the software pipeline, is also loaded through p4-dpdk-target. - Target backend utilities: - (https://github.com/p4lang/target-utils) - (https://github.com/p4lang/target-syslibs) - p4-dpdk-target utilizes the libraries built through target-utils and - target-syslibs libraries. p4-dpdk-target uses these libraries - in the install directory. - P4-OVS: (https://github.com/ipdk-io/ovs) The remote control plane interfaces like P4 Runtime and OpenConfig are supported through P4-OVS. P4-OVS maps these remote protocol messages - and maps them to TDI interface. (Currently, it maps them to the interim - bf_rt interface). + and maps them to tdi_rt interface. Code Organization ================= @@ -60,8 +54,9 @@ p4-dpdk-target is organized as follows include/ Header files associated with various driver modules bf_rt: - bf_rt defines the interim frontend interface till TDI interface is - supported. + bf_rt defines the interim frontend interface with bfrt. + tdi_rt: + tdi_rt defines the frontend interface with TDI. src/ Driver source files. Largely they are categorized into these submodules. @@ -74,6 +69,8 @@ p4-dpdk-target is organized as follows Low Level Driver (e.g. DPDK library) dvm: Device Mgmt (e.g. device/port instantiation, HA sequences) + tdi_rt: + P4 program independent and object driven implementation with TDI. bf_rt: P4 program independent and object driven implementation. bf_pal: @@ -86,11 +83,7 @@ p4-dpdk-target is organized as follows third-party tdi: - Target independent frontend interface. (To be supported in future.) - target-syslibs: - Target syslib package - target-utils: - Target utilities package + Target independent frontend interface. tools/ Scripts to help dependencies installation, ports setup and executing. @@ -130,7 +123,7 @@ Note:- Make sure that your yum repository proxy and environment proxies are set cd $SDE/p4-dpdk-target git submodule update --init --recursive --force ./autogen.sh - ./configure --prefix=$SDE_INSTALL + ./configure --prefix=$SDE_INSTALL (For both bfrt and TDI build) ./configure --prefix=$SDE_INSTALL --with-generic-flags=yes (For TDI build) make -j make install @@ -153,6 +146,11 @@ Running Reference App bf_switchd is a reference application that can be configured through a debug CLI. # Running of bf_switchd + Need to set PYTHONPATH and PYTHONHOME for bfrt_python/tdi_python to work. + export SDE_INSTALL= + export LD_LIBRARY_PATH=$SDE_INSTALL/lib:$SDE_INSTALL/lib64:$SDE_INSTALL/lib/x86_64-linux-gnu + export PYTHONPATH=$SDE_INSTALL/lib/python3.8/:$SDE_INSTALL/lib/python3.8/lib-dynload:$SDE_INSTALL/lib/python3.8/site-packages + export PYTHONHOME=$SDE_INSTALL/lib/python3.8 cd $SDE_INSTALL/bin ./bf_switchd --install-dir $SDE_INSTALL --conf-file $SDE_INSTALL/share/dpdk//.conf --init-mode=cold --status-port 7777 @@ -167,30 +165,46 @@ Running Reference App { "id": "asic-0", "chip_family": "dpdk", - "instance": 0, + "instance": 0 } ], "instance": 0, "p4_devices": [ { "device-id": 0, + "eal-args": "dummy -n 4 -c 3", + "mempools": [ + { + "name": "MEMPOOL0", + "buffer_size": 2304, + "pool_size": 1024, + "cache_size": 256, + "numa_node": 0 + } + ], "p4_programs": [ { "program-name": "", - "cpu_numa_node": "0", - "bfrt-config": "share/dpdk//bf-rt.json", + "bfrt-config": "share/dpdk//tdi.json", "port-config": "share/dpdk//ports_topology.json", - "eal-args": "dummy -n 4 -c 3", "p4_pipelines": [ { "p4_pipeline_name": "pipe", + "core_id": 1, + "numa_node": 0, "context": "share/dpdk//pipe/context.json", "config": "share/dpdk//pipe/.spec", + "pipe_scope": [ + 0, + 1, + 2, + 3 + ], "path": "share/dpdk/" } ] } - ], + ] } ] } @@ -199,10 +213,10 @@ Running Reference App # CLI interface Once bf_switchd starts running, bfshell is available. - bfshell> bfrt_python + bfshell> tdi_python - bfrt..enable - pipe = bfrt..pipe.ingress + tdi..enable + pipe = tdi..pipe.ingress from netaddr import IPAddress pipe..() eg) pipe.ipv4_lpm.add_with_send(dst_addr=IPAddress('192.168.2.0'),dst_addr_p_length=24, port=1) diff --git a/README.md b/README.md new file mode 100644 index 0000000..b3c65b6 --- /dev/null +++ b/README.md @@ -0,0 +1,233 @@ + +# P4 DPDK Target Components + +p4-dpdk-target repo contains the P4-DPDK target specific code that supports +the target independent Table Driven Interface (TDI). + +## p4-dpdk-target works in conjunction with following repos: + + +#### Table Driven Interface: + (https://github.com/p4lang/tdi) + TDI (Table Driven Interface) provides the target independent frontend + interface while p4-dpdk-target provides the target dependent backend + for DPDK SWX pipeline. + p4-dpdk-target submodules tdi repo. p4-dpdk-target isn't currently + defined in p4-dpdk-target/include/bf_rt directory. + +#### DPDK SWX Pipeline: + (https://github.com/DPDK/dpdk/blob/main/lib/pipeline) + Version: 22.07-rc2 + + P4 DPDK SWX pipeline implements the P4 pipeline in a DPDK software switch. + The software switch is driven by artifacts generated by the P4 compiler + for P4 DPDK SWX pipeline. + p4-dpdk-target submodules dpdk repo to build P4 DPDK pipeline. + Note about DPDK Patches (p4-dpdk-target/src/lld/dpdk/patch): + DPDK patches 007-Fix-pipeline-structs-initialization.patch + is a temporary solution and will be removed. + The fixes are being worked upon and will be committed soon. + +#### P4 Compiler DPDK Backend: + (https://github.com/p4lang/p4c/tree/main/backends/dpdk) + P4C DPDK backend creates the artifact files used by p4-dpdk-target + and DPDK SWX pipeline. + p4-dpdk-target uses bfrt.json to define the program independent frontend + bf_rt interface. + context.json is used to map the P4 runtime info to the P4 DPDK target + specific info. + The P4 DPDK spec file from P4C DPDK, which is used by DPDK SWX pipeline + to setup the software pipeline, is also loaded through p4-dpdk-target. + +#### P4-OVS: + (https://github.com/ipdk-io/p4-ovs) + The remote control plane interfaces like P4 Runtime and OpenConfig are + supported through P4-OVS. P4-OVS maps these remote protocol messages + and maps them to tdi_rt interface. + +## Code Organization + +The drivers are P4 independent. At the time of device initialization, +they take artifacts associated with P4 as inputs. + +**p4-dpdk-target is organized as follows** + + include/ + Header files associated with various driver modules + bf_rt: + bf_rt defines the interim frontend interface with bfrt. + tdi_rt: + tdi_rt defines the frontend interface with TDI. + + src/ + Driver source files. Largely they are categorized into these submodules. + + pipe_mgr: + P4 Pipeline Mgmt API (e.g. tables, actions, stats, meters) + port_mgr: + Port Mgmt API + lld: + Low Level Driver (e.g. DPDK library) + dvm: + Device Mgmt (e.g. device/port instantiation, HA sequences) + tdi_rt: + P4 program independent and object driven implementation with TDI. + bf_rt: + P4 program independent and object driven implementation. + bf_pal: + Platform related code to support device and port management. + ctx_json: + Utility used for parsing cJSON structures in context JSON. + + bf_switchd/ + Reference implementation of application to exercise the drivers. + + third-party + tdi: + Target independent frontend interface. + + tools/ + Scripts to help dependencies installation, ports setup and executing. + + dependencies/ + Python requirements files used by the driver. + + doc/ + Files used for doxygen. + + +## Building and installing + +The building of drivers produces a set of libraries that need to be +loaded (or linked to) the application. + +Note: SDE is the top level directory with this p4-dpdk-target, syslibs and utils repo cloned in next step + +#### Create install directory under SDE +``` + sudo -s + mkdir install +``` +#### Set environment variables +To set environment variables for SDE, see below :- +``` + cd p4-dpdk-target/tools/setup + source p4sde_env_setup.sh +``` +Ensure SDE, SDE_INSTALL and LD_LIBRARY_PATH environment variables are set correctly + +#### Install dependent packages +To Install the dependencies for p4-driver on the platform Fedora 33, see below:- + +Note:- Make sure that your yum repository proxy and environment proxies are set properly and you have sudo access. +``` + pip3 install distro (dependency) + cd p4-dpdk-target/tools/setup + python3 install_dep.py +``` + +#### Building P4 DPDK target + ``` + cd $SDE/p4-dpdk-target + git submodule update --init --recursive --force + ./autogen.sh + ./configure --prefix=$SDE_INSTALL (For both bfrt and TDI build) + ./configure --prefix=$SDE_INSTALL --with-generic-flags=yes (For TDI build) + make -j + make install +``` +#### Artifacts installed + +Here're the artifacts that get installed for p4-driver. + +**Build artifacts:** +``` + header files for driver API to $SDE_INSTALL/include/ + + libdriver.[a,la,so] to $SDE_INSTALL/lib/ + driver library to manage the device + bf_switchd to $SDE_INSTALL/bin + reference implementation to exercise driver API +``` +## Running Reference App + + bf_switchd is a reference application that can be configured through a debug CLI. + +**Running of bf_switchd** +``` + Need to set PYTHONPATH and PYTHONHOME for bfrt_python/tdi_python to work. + export SDE_INSTALL= + export LD_LIBRARY_PATH=$SDE_INSTALL/lib:$SDE_INSTALL/lib64:$SDE_INSTALL/lib/x86_64-linux-gnu + export PYTHONPATH=$SDE_INSTALL/lib/python3.8/:$SDE_INSTALL/lib/python3.8/lib-dynload:$SDE_INSTALL/lib/python3.8/site-packages + export PYTHONHOME=$SDE_INSTALL/lib/python3.8 + cd $SDE_INSTALL/bin + ./bf_switchd --install-dir $SDE_INSTALL --conf-file $SDE_INSTALL/share/dpdk//.conf --init-mode=cold --status-port 7777 +``` +#### Config file used by bf_switchd + bf_switchd uses a config file to initialize. Following are some of the key fields: + bfrt-config: Use file generated from the P4C DPDK for P4 pipeline definition. + port-config: Optional file to describe initial ports topology. + context: Use file generated from the P4C DPDK to map P4 to P4 DPDK. + config: Use file generated from the P4C DPDK to setup P4 DPDK pipeline. + { + "chip_list": [ + { + "id": "asic-0", + "chip_family": "dpdk", + "instance": 0 + } + ], + "instance": 0, + "p4_devices": [ + { + "device-id": 0, + "eal-args": "dummy -n 4 -c 3", + "mempools": [ + { + "name": "MEMPOOL0", + "buffer_size": 2304, + "pool_size": 1024, + "cache_size": 256, + "numa_node": 0 + } + ], + "p4_programs": [ + { + "program-name": "", + "bfrt-config": "share/dpdk//tdi.json", + "port-config": "share/dpdk//ports_topology.json", + "p4_pipelines": [ + { + "p4_pipeline_name": "pipe", + "core_id": 1, + "numa_node": 0, + "context": "share/dpdk//pipe/context.json", + "config": "share/dpdk//pipe/.spec", + "pipe_scope": [ + 0, + 1, + 2, + 3 + ], + "path": "share/dpdk/" + } + ] + } + ] + } + ] + } + + +#### CLI interface + +Once bf_switchd starts running, bfshell is available. +``` + bfshell> tdi_python + + tdi..enable + pipe = tdi..pipe.ingress + from netaddr import IPAddress + pipe..() + eg) pipe.ipv4_lpm.add_with_send(dst_addr=IPAddress('192.168.2.0'),dst_addr_p_length=24, port=1) +``` diff --git a/RELEASENOTES.md b/RELEASENOTES.md new file mode 100644 index 0000000..499980a --- /dev/null +++ b/RELEASENOTES.md @@ -0,0 +1,18 @@ +## [v22.07] - 2022-07-27 + +### Feature support + +* Linux Networking support (L2 Forwarding, VXLAN, Routing, Connection Tracking) +* TDI Integration and TDI CLI Python support. +* PAL API support to retrieve fixed table functionality such as port, device etc. +* Direct Match Table support [Match kind supported - Exact, Ternary, LPM]. +* Indirect Match Table support - Action Selector, Action Profile. +* Indirect Counter support. +* Port and Vport support. +* Auto learn support. +* PNA meta data direction support. +* Table default action with arguments support. +* Multiple Pipeline support. +* Hotplug support for vhost-user ports. +* Enable DPDK backend cli to get port/mac stats. +* GTEST based Unit test framework. diff --git a/examples/pna/simple_lpm/Readme b/examples/pna/simple_lpm/Readme index 69df758..6ed2191 100644 --- a/examples/pna/simple_lpm/Readme +++ b/examples/pna/simple_lpm/Readme @@ -2,19 +2,19 @@ This document describes simple test scenario and provides sample commands to run Versioning : commit-id ================================================================================================================================================== -p4sde : c9dc2f256e5ab3ae0d49adb1faa815abb046a557 -p4c : 026de0abf21ad576ab4e290faa94bfda46d51fce +p4sde : 9c532ecb50cb32a49ccfd72cb1cb8ab4f73c69db +p4c : bad00d940a7913d6df671dc4947409982d5f7a84 ================================================================================================================================================== artifacts generation steps: ============================ simple_lpm.p4 is compiled using p4c-dpdk compiler and below are p4c-dpdk compiler version and artifacts generated. -p4c-dpdk : version - 1.2.2.2 (SHA: 026de0abf BUILD: RELEASE) -artifacts: bfrt.json, context.json, sample_lpm.spec.spec and p4Info.txt +p4c-dpdk : version - 1.2.2.3 (SHA: bad00d940 BUILD: RELEASE) +artifacts: tdi.json, context.json, sample_lpm.spec.spec and p4Info.txt Command to generate artifacts: -/root/p4c/p4c/build/p4c-dpdk -I /root/p4c/p4c/build/p4include --p4v=16 --p4runtime-files ./p4Info.txt -I /root/p4c/p4c/build/p4include/dpdk -o ./pipe/sample_lpm.spec --arch pna --bf-rt-schema ./bf-rt.json --context ./pipe/context.json sample_lpm.p4 +/root/p4c/p4c/build/p4c-dpdk -I /root/p4c/p4c/build/p4include --p4v=16 --p4runtime-files ./p4Info.txt -I /root/p4c/p4c/build/p4include/dpdk -o ./pipe/sample_lpm.spec --arch pna --bf-rt-schema ./bf-rt.json --context ./pipe/context.json --tdi tdi.json sample_lpm.p4 Test scenario : ================ @@ -24,9 +24,9 @@ Test scenario : BF_RT commands: =============== -bfrt_python -bfrt.sample_lpm.enable -pipe = bfrt.sample_lpm.pipe.MainControlImpl +tdi_python +tdi.sample_lpm.enable +pipe = tdi.sample_lpm.pipe.MainControlImpl from netaddr import IPAddress pipe.ipv4_da_lpm.add_with_next_hop(dstAddr=IPAddress('192.168.2.0'), dstAddr_p_length=24,vport=2) pipe.ipv4_da_lpm.get(dstAddr=IPAddress('192.168.2.0'),dstAddr_p_length=24) diff --git a/examples/port_config/tap_port/bf_shell_commands.txt b/examples/port_config/tap_port/bf_shell_commands.txt new file mode 100644 index 0000000..0ae93f8 --- /dev/null +++ b/examples/port_config/tap_port/bf_shell_commands.txt @@ -0,0 +1,54 @@ +Tap Ports : +============ + + +This example contains a DPDK Pipeline with 4 TAP Ports and 1 Sink Port. +The Port JSON for this topology is port_config.json. + + + + + + + IN OUT + + + |-----------------------------------| + TAP0(0) | | TAP0(0) + | | + TAP1(1) | | TAP1(1) + | | + TAP2(2) | DPDK Pipeline | TAP2(2) + | | + TAP3(3) | | TAP3(3) + | | + | | SINK0(4) + |-----------------------------------| + + + +BF SHELL Commands : +=================== + +bfshell> tdi_python +tdi.port.port +tdi.port.port> + +add(DEV_PORT=0, PORT_TYPE="BF_DPDK_TAP", PORT_DIR="PM_PORT_DIR_DEFAULT", PORT_IN_ID=0, + PORT_OUT_ID =0, PIPE_IN="pipe", PIPE_OUT="pipe", MEMPOOL="MEMPOOL0", PORT_NAME="TAP0", + MTU=1500) + +add(DEV_PORT=1, PORT_TYPE="BF_DPDK_TAP", PORT_DIR="PM_PORT_DIR_DEFAULT", PORT_IN_ID=1, + PORT_OUT_ID =1, PIPE_IN="pipe", PIPE_OUT="pipe", MEMPOOL="MEMPOOL0", PORT_NAME="TAP1", + MTU=1500) + +add(DEV_PORT=2, PORT_TYPE="BF_DPDK_TAP", PORT_DIR="PM_PORT_DIR_DEFAULT", PORT_IN_ID=2, + PORT_OUT_ID =2,PIPE_IN="pipe", PIPE_OUT="pipe", MEMPOOL="MEMPOOL0", PORT_NAME="TAP2", + MTU=1500) + +add(DEV_PORT=3, PORT_TYPE="BF_DPDK_TAP", PORT_DIR="PM_PORT_DIR_DEFAULT", PORT_IN_ID=3, + PORT_OUT_ID =3,PIPE_IN="pipe", PIPE_OUT="pipe", MEMPOOL="MEMPOOL0", PORT_NAME="TAP3", + MTU=1500) + +add(DEV_PORT=4, PORT_TYPE="BF_DPDK_SINK", PORT_DIR="PM_PORT_DIR_TX_ONLY", PORT_OUT_ID=4, + PIPE_OUT="pipe", PORT_NAME="SINK0", FILE_NAME="./sink0.pcap") diff --git a/examples/port_config/tap_port/bfrt_sample_config.conf b/examples/port_config/tap_port/bfrt_sample_config.conf new file mode 100644 index 0000000..5c8e877 --- /dev/null +++ b/examples/port_config/tap_port/bfrt_sample_config.conf @@ -0,0 +1,55 @@ +{ + "chip_list": [ + { + "id": "asic-0", + "chip_family": "dpdk", + "instance": 0, + "pcie_sysfs_prefix": "/sys/devices/pci0000:00/0000:00:03.0/0000:05:00.0", + "pcie_domain": 0, + "pcie_bus": 5, + "pcie_fn": 0, + "pcie_dev": 0, + "pcie_int_mode": 1 + } + ], + "instance": 0, + "p4_devices": [ + { + "device-id": 0, + "eal-args": "dummy -n 4 -c 3", + "mempools": [ + { + "name": "MEMPOOL0", + "buffer_size": 2304, + "pool_size": 1024, + "cache_size": 256, + "numa_node": 0 + } + ], + "p4_programs": [ + { + "program-name": "", + "bfrt-config": "share/dpdk//tdi.json", + "port-config": "share/dpdk//port_config.json", + "p4_pipelines": [ + { + "p4_pipeline_name": "pipe", + "core_id": 1, + "numa_node": 0, + "context": "share/dpdk//pipe/context.json", + "config": "share/dpdk//pipe/.spec", + "pipe_scope": [ + 0, + 1, + 2, + 3 + ], + "path": "share/dpdk/" + } + ] + } + ], + "agent0": "lib/libpltfm_mgr.so" + } + ] +} diff --git a/examples/port_config/tap_port/port_config.json b/examples/port_config/tap_port/port_config.json new file mode 100644 index 0000000..0531007 --- /dev/null +++ b/examples/port_config/tap_port/port_config.json @@ -0,0 +1,72 @@ +{ + "ports" : [ + { + "dev_port" : 0, + "port_name" : "TAP0", + "mempool_name" : "MEMPOOL0", + "port_dir" : "default", + "port_in_id" : 0, + "pipe_in" : "pipe", + "port_out_id" : 0, + "pipe_out" : "pipe", + "port_type" : "tap", + "tap_port_attributes" : { + "mtu" : 1500 + } + }, + { + "dev_port" : 1, + "port_name" : "TAP1", + "mempool_name" : "MEMPOOL0", + "port_dir" : "default", + "port_in_id" : 1, + "pipe_in" : "pipe", + "port_out_id" : 1, + "pipe_out" : "pipe", + "port_type" : "tap", + "tap_port_attributes" : { + "mtu" : 1500 + } + }, + { + "dev_port" : 2, + "port_name" : "TAP2", + "mempool_name" : "MEMPOOL0", + "port_dir" : "default", + "port_in_id" : 2, + "pipe_in" : "pipe", + "port_out_id" : 2, + "pipe_out" : "pipe", + "port_type" : "tap", + "tap_port_attributes" : { + "mtu" : 1500 + } + }, + { + "dev_port" : 3, + "port_name" : "TAP3", + "mempool_name" : "MEMPOOL0", + "port_dir" : "default", + "port_in_id" : 3, + "pipe_in" : "pipe", + "port_out_id" : 3, + "pipe_out" : "pipe", + "port_type" : "tap", + "tap_port_attributes" : { + "mtu" : 1500 + } + }, + { + "dev_port" : 4, + "port_name" : "SINK0", + "mempool_name" : "MEMPOOL0", + "port_dir" : "out", + "port_out_id" : 4, + "pipe_out" : "pipe", + "port_type" : "sink", + "sink_port_attributes" : { + "file_name" : "./sink0.pcap" + } + } + ] +} diff --git a/examples/psa/simple_l2l3_lpm/Readme b/examples/psa/simple_l2l3_lpm/Readme index b2733f2..517a704 100644 --- a/examples/psa/simple_l2l3_lpm/Readme +++ b/examples/psa/simple_l2l3_lpm/Readme @@ -2,19 +2,19 @@ This document describes simple test scenario and provides sample commands to run Versioning : commit-id ================================================================================================================================================== -p4sde : c9dc2f256e5ab3ae0d49adb1faa815abb046a557 -p4c : 026de0abf21ad576ab4e290faa94bfda46d51fce +p4sde : 9c532ecb50cb32a49ccfd72cb1cb8ab4f73c69db +p4c : bad00d940a7913d6df671dc4947409982d5f7a84 ================================================================================================================================================== artifacts generation steps: ============================ simple_l2l3_lpm.p4 is compiled using p4c-dpdk compiler and below are p4c-dpdk compiler version and artifacts generated. -p4c-dpdk : version - 1.2.2.2 (SHA: 026de0abf BUILD: RELEASE) -artifacts: bfrt.json, context.json, simple_l2l3_lpm.spec and p4Info.txt +p4c-dpdk : version - 1.2.2.3 (SHA: bad00d940 BUILD: RELEASE) +artifacts: tdi.json, context.json, simple_l2l3_lpm.spec and p4Info.txt Command to generate artifacts: -/root/p4c/p4c/build/p4c-dpdk -I /root/p4c/p4c/build/p4include --p4v=16 --p4runtime-files ./p4Info.txt -I /root/p4c/p4c/build/p4include/dpdk -o ./pipe/simple_l2l3_lpm.spec --arch psa --bf-rt-schema ./bf-rt.json --context ./pipe/context.json simple_l2l3_lpm.p4 +/root/p4c/p4c/build/p4c-dpdk -I /root/p4c/p4c/build/p4include --p4v=16 --p4runtime-files ./p4Info.txt -I /root/p4c/p4c/build/p4include/dpdk -o ./pipe/simple_l2l3_lpm.spec --arch psa --bf-rt-schema ./bf-rt.json --context ./pipe/context.json --tdi tdi.json simple_l2l3_lpm.p4 Test scenario : ================ @@ -38,9 +38,9 @@ cd $SDE_INSTALL/bin BF_RT commands: =============== -bfrt_python -bfrt.simple_l2l3_lpm.enable -pipe = bfrt.simple_l2l3_lpm.ip.ingress +tdi_python +tdi.simple_l2l3_lpm.enable +pipe = tdi.simple_l2l3_lpm.ip.ingress from netaddr import IPAddress pipe.ipv4_lpm.add_with_send(dst_addr=IPAddress('192.168.2.0'),dst_addr_p_length=24, port=1) pipe.ipv4_lpm.get(dst_addr=IPAddress('192.168.2.0'),dst_addr_p_length=24)