Skip to content

GitLab

  • Menu
项目 Groups 代码片段
    • 正在加载...
  • 帮助
    • 帮助
    • 支持
    • 社区论坛
    • 提交反馈
  • 登录/注册
  • P p4-learning
  • Project information
    • Project information
    • 动态
    • 标记
    • 成员
  • 仓库
    • 仓库
    • 文件
    • 提交
    • 分支
    • 标签
    • 贡献者
    • 分支图
    • 比较
  • 议题 0
    • 议题 0
    • 列表
    • 看板
    • 服务台
    • 里程碑
  • 合并请求 0
    • 合并请求 0
  • CI/CD
    • CI/CD
    • 流水线
    • 作业
    • 计划
  • Deployments
    • Deployments
    • 环境
    • 发布
  • Monitor
    • Monitor
    • 事件
  • 软件包与镜像库
    • 软件包与镜像库
    • 软件包注册表
    • Infrastructure Registry
  • 分析
    • 分析
    • CI/CD
    • 仓库
    • Value stream
  • Wiki
    • Wiki
  • 代码片段
    • 代码片段
  • 动态
  • 分支图
  • 创建新议题
  • 作业
  • 提交
  • 议题看板
收起侧边栏
  • p4git
  • p4-learning
  • Wiki
  • Useful Scripts

Last edited by Jurij Nota 7月 26, 2021
页面历史

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.

克隆仓库

P4-Learning Documentation

  • Getting Started
  • Migrate to the new version
  • BMv2 Simple Switch
  • Control Plane
  • Debugging and Troubleshooting
  • Scapy
  • FAQ

沪ICP备19002739号