p4c-xdp

(β˜… 170)

Backend for the P4 compiler targeting XDP

  • .gitignore
  • AUTHORS
  • CMakeLists.txt
  • compile-bpf.sh
  • Dockerfile
  • LICENSE
  • ovs-parse-14.p4
  • ovs.c
  • ovs.p4
  • p4c-xdp.cpp
  • README.md
  • run-bpf.sh
  • run-p4c-xdp.sh
  • target.cpp
  • target.h
  • test_ebpf_map.c
  • Vagrantfile
  • xdp_target.py
  • xdpBackend.cpp
  • xdpBackend.h
  • xdpControl.cpp
  • xdpControl.h
  • xdpModel.cpp
  • xdpModel.h
  • xdpProgram.cpp
  • xdpProgram.h

# Installation Guide

1. Get the code
git clone https://github.com/vmware-archive/p4c-xdp

Downloads the entire project code from GitHub to your computer.

cd p4c-xdp

Moves into the project folder you just downloaded.

2. Docker

Easy Recommended
Prerequisites
  • Git Needed to download the project code from GitHub.
  • Docker Desktop Needed to build and run containers. Install it and keep it running in the background.
$ docker pull u9012063/p4xdp

Type this command into your terminal and run it.

root@ubuntu-xenial:/home/ubuntu# docker images

Type this command into your terminal and run it.

root@ubuntu-xenial:/home/ubuntu# docker run -it -u root --privileged <IMAGE ID>

Runs the built image as an actual container.

βœ… Run docker compose ps to check the containers are Up. If the README mentions a port, open http://localhost:PORT in your browser.

Pulled directly from this repo's README.

3. CMake

Medium
Prerequisites
  • Git Needed to download the project code from GitHub.
  • CMake The tool used to generate build configuration.
  • C/C++ 컴파일러 Windows needs Visual Studio (Community edition, free), macOS needs Xcode Command Line Tools, Linux needs the gcc/g++ package.
cmake ..

Analyzes the source code and generates build configuration files (must be run inside the build folder).

βœ… Check that an executable was created inside the build folder, then run it directly (e.g. ./build/app_name).

Pulled directly from this repo's README.

4. Make

Medium
Prerequisites
  • Git Needed to download the project code from GitHub.
  • Make Usually pre-installed on Linux/macOS. On Windows, install separately (e.g. via MSYS2 or WSL).
make

Compiles the code based on the generated build configuration to produce an executable.

make check-xdp

Compiles the code based on the generated build configuration to produce an executable.

βœ… If it finishes without errors, it worked. Try running the generated executable directly.

Pulled directly from this repo's README.

// repository documentation