[stratum-dev] Problems regarding the installation of stratum & SDE 9.4.0 on Tofino switch

1 view
Skip to first unread message


Nov 17, 2021, 11:39:31 PM11/17/21
to strat...@lists.stratumproject.org
Hello everyone,

I encountered some problems during the installation of stratum & SDE 9.4.0 on Tofino switch and was unable to run stratum smoothly.

Switch: Netberg Aurora 610
root@localhost:~# cat /etc/onl/platform

root@localhost:~# uname -a
Linux localhost 4.19.81-OpenNetworkLinux #1 SMP Wed Apr 21 09:25:49 UTC 2021 x86_64 GNU/Linux

root@localhost:~# lsmod
Module Size Used by
bf_kdrv 28672 0
at24 20480 0
x86_pkg_temp_thermal 16384 0
intel_pch_thermal 16384 0
optoe 20480 0
vpd 24576 0
swps 147456 0
net_cpld 16384 0
net_psoc 24576 0
net_platform 16384 0
i2c_gpio 16384 0
lpc_ich 28672 0
gpio_ich 16384 3

I tried two ways to run ONOS + Stratum + Tofino, the steps are as followed:
• Pre-built Stratum binaries:
On switch:
1. Install ONL on Tofino Switch
2. Install stratum on Tofino Switch by stratum_bf_deb.deb
3. Start stratum using start-stratum.sh

On ONOS server:
1. Start ONOS Server
2. Build and install my app to ONOS server
(My app can work on stratum + bmv2. To run on physical switch, I just modify PipeconfLoader.java)
3. Put network configuration to ONOS server

So far, ONOS can connect to Tofino Switch with stratum. But for Install rule, Stratum returned an error:
[libprotobuf FATAL external/com_google_protobuf/src/google/protobuf/repeated_field.h:1694] CHECK failed: (index) < (current_size_):
I saw the solution and want to build a new stratum_bf_deb.deb by myself: https://github.com/stratum/stratum/pull/687

• Build Stratum Source code:
It cannot compile stratum on Tofino Switch, so I tried to build the STRATUM package on another Debian machine.

Prepare package:
Stratum Packet: https://github.com/stratum/stratum
P4-SDE: 9.4.0
BSP: 9.4.0

On Debian:
1. Download Stratum Source Code
2. Start a temporary container by setup_dev_env.sh
3. Copy require packages into a container (SDE, BSP, Linux-kernel)
4. Compile SDE:
./p4studio_build.py -up profiles/stratum_profile.yaml -shc -kdir <path/to/linux/sources> --bsp-path $BSP_PATH
5. Get Stratum package:
bazel build --sandbox_debug --verbose_failures //stratum/hal/bin/barefoot:stratum_bf_deb

In this step it returned the following error:
Repository rule http_archive defined at:
/root/.cache/bazel/_bazel_root/1b07b1db06ec9ee22c71eac6f0bd4549/external/bazel_tools/tools/build_defs/repo/http.bzl:336:31: in <toplevel>
ERROR: /stratum/stratum/hal/bin/barefoot/BUILD:85:8: no such target '@local_barefoot_bin//:bf_library_files': target 'bf_library_files' not declared in package '' defined by /root/.cache/bazel/_bazel_root/1b07b1db06ec9ee22c71eac6f0bd4549/external/local_barefoot_bin/BUILD and referenced by '//stratum/hal/bin/barefoot:stratum_bf_data'
ERROR: /stratum/stratum/hal/bin/barefoot/BUILD:85:8: no such target '@local_barefoot_bin//:bf_shareable_files': target 'bf_shareable_files' not declared in package '' defined by /root/.cache/bazel/_bazel_root/1b07b1db06ec9ee22c71eac6f0bd4549/external/local_barefoot_bin/BUILD and referenced by '//stratum/hal/bin/barefoot:stratum_bf_data'
ERROR: /stratum/stratum/hal/bin/barefoot/BUILD:85:8: no such target '@local_barefoot_bin//:kernel_module': target 'kernel_module' not declared in package '' defined by /root/.cache/bazel/_bazel_root/1b07b1db06ec9ee22c71eac6f0bd4549/external/local_barefoot_bin/BUILD and referenced by '//stratum/hal/bin/barefoot:stratum_bf_data'
ERROR: Analysis of target '//stratum/hal/bin/barefoot:stratum_bf_deb' failed; build aborted: Analysis failed
INFO: Elapsed time: 0.148s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded, 0 targets configured)

I am not sure how to solve the problem. Can anyone offer me your insight?


Confidentiality Note
This e-mail transmission and any attachments contain information from O'Prueba Technology Inc. The information is confidential and/or privileged and intended to be solely for the use of the individuals or entity named in this e-mail transmission. If you are not the intended recipient, be aware that any disclosure, saving or use of the contents of this e-mail transmission and attachments is strictly prohibited. If you have received this email transmission in error, please notify us immediately, and delete the e-mail and attachments. We greatly appreciate your cooperation.

Maximilian Pudelko

Nov 18, 2021, 12:08:40 AM11/18/21
to 鄭仲翔, strat...@lists.stratumproject.org
Hi John,

That bug you linked should be fixed by now and has been included in a few releases. Can you verify
you're running the latest 2021-10-09 release from the release page?
If this (or another) error still exists, that's worth investigating and probably a new bug.

If you still want to build Stratum yourself, you should check out the Stratum on Tofino build instructions here.
Method 2 or 3 seem close to what you're looking for.


stratum-dev mailing list


Nov 19, 2021, 10:12:09 AM11/19/21
to Maximilian Pudelko, strat...@lists.stratumproject.org

Hi Max,


Thanks for your information. It works for me.


I use latest Stratum source code and it can work now.


Best Regards,


Reply all
Reply to author
0 new messages