Skip to content

Mention Tofino model source in README.md#125

Open
jafingerhut wants to merge 21 commits intop4lang:mainfrom
jafingerhut:mention-tofino-model-source-in-readme-try2
Open

Mention Tofino model source in README.md#125
jafingerhut wants to merge 21 commits intop4lang:mainfrom
jafingerhut:mention-tofino-model-source-in-readme-try2

Conversation

@jafingerhut
Copy link
Contributor

No description provided.

Signed-off-by: Andy Fingerhut <andy_fingerhut@alum.wustl.edu>
Also that build of everything (at least bf-drivers) requires a system
with x86_64 processor.

Signed-off-by: Andy Fingerhut <andy_fingerhut@alum.wustl.edu>
@jafingerhut jafingerhut requested a review from fruffy February 26, 2026 17:02

# Setup

Note: At least the bf-drivers component of this software depends upon
Copy link
Contributor

@fruffy fruffy Mar 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What binary is this concretely?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are all .a and .so files that are in the latest version of the open-p4studio repo:

$ find . -name '*.a' -o -name '*.so'
./p4studio/third_party/_yaml.cpython-35m-x86_64-linux-gnu.so
./pkgsrc/target-utils/third-party/tommyds/benchmark/lib/judy/libJudyL.a
./pkgsrc/target-utils/third-party/tommyds/benchmark/lib/judy/libJudyMalloc.a
./pkgsrc/bf-drivers/src/port_mgr/port_mgr_lib/libport_mgr_hw.so
./pkgsrc/bf-drivers/src/port_mgr/port_mgr_lib/libport_mgr_hw.a

$ find . -name '*.a' -o -name '*.so' | xargs file
./p4studio/third_party/_yaml.cpython-35m-x86_64-linux-gnu.so:                 ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=5b67f5cf630d08c2490517119c45570ae76fb012, with debug_info, not stripped
./pkgsrc/target-utils/third-party/tommyds/benchmark/lib/judy/libJudyL.a:      current ar archive
./pkgsrc/target-utils/third-party/tommyds/benchmark/lib/judy/libJudyMalloc.a: current ar archive
./pkgsrc/bf-drivers/src/port_mgr/port_mgr_lib/libport_mgr_hw.so:              ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=3e3b4411c3dd9dcc344f410564fa6d75ddf347e6, not stripped
./pkgsrc/bf-drivers/src/port_mgr/port_mgr_lib/libport_mgr_hw.a:               current ar archive

At least the two files libport_mgr_hw.* are mentioned explicitly in CMakeLists.txt files, and the relevant build commands fail when attempting to install open-p4studio on an aarch64 system, and likely also anything but an x86_64 system:

$ find . \! -type d | xargs grep libport_mgr_hw
./pkgsrc/bf-drivers/src/port_mgr/CMakeLists.txt:  ${CMAKE_CURRENT_SOURCE_DIR}/port_mgr_lib/libport_mgr_hw.a
./pkgsrc/bf-drivers/src/port_mgr/CMakeLists.txt:  ${CMAKE_CURRENT_SOURCE_DIR}/port_mgr_lib/libport_mgr_hw.so
./pkgsrc/bf-drivers/bf_switchd/CMakeLists.txt:find_program(MY_PROGRAM libport_mgr_hw.a

The output of ar t libport_mgr_hw.a lists many things that look like C or C++ source file names, most of which have no file with those names in the open-p4studio repo.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I cannot quickly find the conversation on an issue or PR at the moment, but @vgurevich was involved in the past 6 months or so where IIRC he was helping someone try to compile code from this repo for use on a real hardware system with Tofino ASICs, and Vladimir was surprised to find that these binaries were in this repo, but it did seem to enable some additional use cases for this repo's soruce code that he previously thought were not possible.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The libJudy sources should be available from https://judy.sourceforge.net/ at least

Copy link
Contributor Author

@jafingerhut jafingerhut Mar 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Attached is the output of attempting to use the command ./p4studio/p4studio profile apply ./p4studio/profiles/testing.yaml mentioned in the README of this repo for installing it, on an Ubuntu 24.04 Linux VM running on an Apple Silicon Mac (aarch64 processor architecture) host. Near the end you can see these errors:

[ 25%] Linking CXX shared library /home/p4/open-p4studio/install/lib/libdriver.so
/usr/bin/ld: /home/p4/open-p4studio/install/lib/libport_mgr_hw.a(port_mgr_tof3_dev.c.o): Relocations in generic ELF (EM: 62)
/usr/bin/ld: /home/p4/open-p4studio/install/lib/libport_mgr_hw.a(port_mgr_tof3_dev.c.o): Relocations in generic ELF (EM: 62)
/usr/bin/ld: /home/p4/open-p4studio/install/lib/libport_mgr_hw.a(port_mgr_tof3_dev.c.o): Relocations in generic ELF (EM: 62)
/usr/bin/ld: /home/p4/open-p4studio/install/lib/libport_mgr_hw.a: error adding symbols: file in wrong format
collect2: error: ld returned 1 exit status

out-aarch64-ubuntu24.04-p4studio-profile-apply.txt

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI, I am NOT proposing that we try to change things so that this code can be built on systems with non-x86_64 processors. I simply think it might help others save some time if they know that this is a property of the current code base.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants