Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[P4Testgen] Add a DPDK-PTF P4Testgen back end and the corresponding test runner #4173

Merged
merged 9 commits into from
Oct 22, 2023
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "p4c-dpdk-ptf-tests"
name: "p4c-dpdk-ptf-p4testgen-tests"

on:
push:
Expand All @@ -9,7 +9,7 @@ on:
- main

concurrency:
# if workflow for PR or push is already running stop it, and start new one
# If workflow for PR or push is already running stop it, and start new one.
group: p4c_dpdk_ptf_ci-${{ github.ref }}
cancel-in-progress: true

Expand All @@ -30,39 +30,44 @@ jobs:
build_p4dpdk_ubuntu:
runs-on: ubuntu-22.04
steps:
- name: 'ccache'
- name: ccache
uses: hendrikmuhs/ccache-action@v1
with:
key: ptf-${{ runner.os }}-test
max-size: 1000M

- name: 'Checkout DPDK-target'
- name: Checkout DPDK-target
uses: actions/checkout@v3
with:
repository: p4lang/p4-dpdk-target
path: p4sde
submodules: 'recursive'
submodules: recursive

- name: 'Checkout ipdk-recipe'
- name: Checkout ipdk-recipe
uses: actions/checkout@v3
with:
repository: ipdk-io/networking-recipe
path: ipdk.recipe
submodules: 'recursive'
submodules: recursive

- name: checkout P4C
- name: Checkout P4C
uses: actions/checkout@v3
with:
path: p4c
submodules: recursive

- name: 'Install DPDK dependencies'
- name: Install hugepages and set transparent gugepages to madvise
run: |
sudo apt-get install libhugetlbfs-bin
sudo hugeadm --thp-madvise

- name: Install DPDK dependencies
working-directory: p4sde/tools/setup
run: |
sudo apt update -y
python3 install_dep.py

- name: 'Compile p4sde dpdk target'
- name: Compile p4sde dpdk target
working-directory: p4sde
run: |
mkdir ${GITHUB_WORKSPACE}/install
Expand All @@ -71,7 +76,7 @@ jobs:
make
make install

- name: 'Build infrap4d dependencies'
- name: Build infrap4d dependencies
working-directory: ipdk.recipe
run: |
echo "Install infrap4d dependencies"
Expand All @@ -82,12 +87,12 @@ jobs:
cmake -B build -DCMAKE_INSTALL_PREFIX="$IPDK_INSTALL_DIR"
cmake --build build

- name: 'Build infrap4d'
- name: Build infrap4d
working-directory: ipdk.recipe
run: |
./make-all.sh --target=dpdk --no-krnlmon --no-ovs -S $IPDK_INSTALL_DIR -D $IPDK_INSTALL_DIR --prefix=$IPDK_INSTALL_DIR

- name: Build p4c with only the DPDK backend
- name: Build P4C with only the DPDK backend
working-directory: p4c
run: |
export CMAKE_FLAGS+="-DENABLE_BMV2=OFF "
Expand All @@ -101,8 +106,8 @@ jobs:
export CMAKE_FLAGS+="-DIPDK_INSTALL_DIR=$IPDK_INSTALL_DIR "
tools/ci-build.sh

- name: 'Run DPDK PTF tests'
- name: Run DPDK PTF tests using P4Testgen
working-directory: p4c/build
run: |
sudo $IPDK_INSTALL_DIR/sbin/set_hugepages.sh
sudo -E ctest --output-on-failure --schedule-random -R dpdk-ptf*
sudo -E ctest -j1 --output-on-failure --schedule-random -R testgen-p4c-pna-ptf
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,6 @@ build/

# Bazel files
bazel-*

# JetBrains
.idea/
Loading
Loading