Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • P p4-learning
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • p4git
  • p4-learning
  • Wiki
  • Getting Started

Last edited by Jurij Nota Sep 10, 2021
Page history
This is an old version of this page. You can view the most recent version or browse the history.

Getting Started

Useful Scripts

In this section we will add scripts that might come handy. For instance, a script to upgrade some of the software you can find in the VM.

Installing all the p4-tools that come with the VM

If you just want to install all the software required to start developing P4 you can use the install-p4-tools.sh script.

You can change the two following variables to enable/disable debugging or the required software for the P4runtime.

DEBUG_FLAGS=true
ENABLE_P4_RUNTIME=true

Updating BMV2

We provide a very useful script that allows you to easily update bmv2 to the latest version, to a different commit, enable/disable debugging, multiqueuing and more. If you built the vm using vagrant or use the provided VM this script will be already installed in /bin/ and you directly used it.

update-bmv2 -h

update-bmv2 [OPTION]... [FILE]...

Update bmv2/PI script options.

 Options:
  --enable-multi-queue: Enables simple_switch multiple queues per port
  --update-code:        Before building cleans and pulls code from master or <use-commit>
  --bmv2-commit:        Specific commit we want to checkout before building the bmv2
  --pi-commit:          Specific commit we want to checkout before building PI
  --enable-debugging:   Compiles the switch with debugging options
  --enable-p4runtime:   Compiles the simple_switch_grpc

You can find the script here.

Updating P4C

We also provide a similar script to update p4c, the P4 code compiler.

update-p4c -h

update-p4c [OPTION]... [FILE]...

Update p4c script options.

 Options:
  --update-code          Username for script
  --p4c-commit:          Specific commit we want to checkout before building the bmv2
  --enable-debugging:    Compiles the switch with debugging options
  --copy-p4include:      Copies a custom p4include to the global path
  --only-copy-p4include: Does not compile p4c

You can find the script here.

Clone repository
  • BMv2 Simple Switch
  • Control Plane
  • Debugging and Troubleshooting
  • FAQ
  • Getting Started
  • Home
  • Migrate to the new version
  • Scapy
  • Useful Scripts

沪ICP备19002739号