Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

open source still includes binary blobs #1

Open
Nieuwejaar opened this issue Feb 18, 2025 · 0 comments
Open

open source still includes binary blobs #1

Nieuwejaar opened this issue Feb 18, 2025 · 0 comments

Comments

@Nieuwejaar
Copy link
Collaborator

There are at least two binary blobs buried in the source:

pkgsrc/bf-drivers/src/port_mgr/port_mgr_lib/libport_mgr_hw.a
pkgsrc/bf-drivers/src/port_mgr/port_mgr_lib/libport_mgr_hw.so

It looks like this is mostly code for accessing registers in the tofino and serdes:

nils:~/dev/tofino-sde$ nm ./pkgsrc/bf-drivers/src/port_mgr/port_mgr_lib/libport_mgr_hw.a | grep pkgsrc
[...]
./pkgsrc/bf-drivers/src/port_mgr/port_mgr_lib/libport_mgr_hw.a[bf_ll_eth100g_reg_rspec_if.c.o]:
./pkgsrc/bf-drivers/src/port_mgr/port_mgr_lib/libport_mgr_hw.a[bf_ll_eth400g_mac_rspec_if.c.o]:
./pkgsrc/bf-drivers/src/port_mgr/port_mgr_lib/libport_mgr_hw.a[bf_ll_eth400g_pcs_rspec_if.c.o]:
./pkgsrc/bf-drivers/src/port_mgr/port_mgr_lib/libport_mgr_hw.a[port_mgr_tof2_umac.c.o]:
./pkgsrc/bf-drivers/src/port_mgr/port_mgr_lib/libport_mgr_hw.a[port_mgr_tof2_umac3.c.o]:
./pkgsrc/bf-drivers/src/port_mgr/port_mgr_lib/libport_mgr_hw.a[port_mgr_tof2_umac4.c.o]:
./pkgsrc/bf-drivers/src/port_mgr/port_mgr_lib/libport_mgr_hw.a[credo_sd_access.c.o]:

I can imagine that the credo file contains source that Intel can't distribute, but I don't know why the intel/barefoot code isn't available.

This is a standard ELF library, but seems to be mostly self-contained:

nils@atrium:~/dev/tofino-sde$ nm ./pkgsrc/bf-drivers/src/port_mgr/port_mgr_lib/libport_mgr_hw.so | egrep "UNDEF.*@"
[299932]        |                   0|                   0|FUNC |GLOB |0    |UNDEF  |__assert_fail@@GLIBC_2.2.5
[307006]        |                   0|                   0|FUNC |GLOB |0    |UNDEF  |__ctype_b_loc@@GLIBC_2.3
[296002]        |                   0|                   0|FUNC |WEAK |0    |UNDEF  |__cxa_finalize@@GLIBC_2.2.5
[305312]        |                   0|                   0|FUNC |GLOB |0    |UNDEF  |__isoc99_sscanf@@GLIBC_2.7
[307501]        |                   0|                   0|FUNC |GLOB |0    |UNDEF  |__stack_chk_fail@@GLIBC_2.4
[314788]        |                   0|                   0|FUNC |GLOB |0    |UNDEF  |atoi@@GLIBC_2.2.5
[313548]        |                   0|                   0|FUNC |GLOB |0    |UNDEF  |backtrace_symbols@@GLIBC_2.2.5
[313440]        |                   0|                   0|FUNC |GLOB |0    |UNDEF  |backtrace@@GLIBC_2.2.5
[305551]        |                   0|                   0|FUNC |GLOB |0    |UNDEF  |fclose@@GLIBC_2.2.5
[308593]        |                   0|                   0|FUNC |GLOB |0    |UNDEF  |fflush@@GLIBC_2.2.5
[314951]        |                   0|                   0|FUNC |GLOB |0    |UNDEF  |fgets@@GLIBC_2.2.5
[308624]        |                   0|                   0|FUNC |GLOB |0    |UNDEF  |fopen@@GLIBC_2.2.5
[312873]        |                   0|                   0|FUNC |GLOB |0    |UNDEF  |fprintf@@GLIBC_2.2.5
[309710]        |                   0|                   0|FUNC |GLOB |0    |UNDEF  |fputc@@GLIBC_2.2.5
[313670]        |                   0|                   0|FUNC |GLOB |0    |UNDEF  |fread@@GLIBC_2.2.5
[321161]        |                   0|                   0|FUNC |GLOB |0    |UNDEF  |fwrite@@GLIBC_2.2.5
[297444]        |                   0|                   0|FUNC |GLOB |0    |UNDEF  |getcwd@@GLIBC_2.2.5
[315901]        |                   0|                   0|FUNC |GLOB |0    |UNDEF  |gettimeofday@@GLIBC_2.2.5
[301083]        |                   0|                   0|FUNC |GLOB |0    |UNDEF  |localtime@@GLIBC_2.2.5
[297983]        |                   0|                   0|FUNC |GLOB |0    |UNDEF  |memset@@GLIBC_2.2.5
[290453]        |                   0|                   0|FUNC |GLOB |0    |UNDEF  |printf@@GLIBC_2.2.5
[312251]        |                   0|                   0|FUNC |GLOB |0    |UNDEF  |putchar@@GLIBC_2.2.5
[314498]        |                   0|                   0|FUNC |GLOB |0    |UNDEF  |puts@@GLIBC_2.2.5
[293406]        |                   0|                   0|FUNC |GLOB |0    |UNDEF  |rand@@GLIBC_2.2.5
[315574]        |                   0|                   0|FUNC |GLOB |0    |UNDEF  |snprintf@@GLIBC_2.2.5
[290832]        |                   0|                   0|OBJT |GLOB |0    |UNDEF  |stdout@@GLIBC_2.2.5
[312278]        |                   0|                   0|FUNC |GLOB |0    |UNDEF  |strcmp@@GLIBC_2.2.5
[302415]        |                   0|                   0|FUNC |GLOB |0    |UNDEF  |strftime@@GLIBC_2.2.5
[296022]        |                   0|                   0|FUNC |GLOB |0    |UNDEF  |strlen@@GLIBC_2.2.5
[300150]        |                   0|                   0|FUNC |GLOB |0    |UNDEF  |strncat@@GLIBC_2.2.5
[296474]        |                   0|                   0|FUNC |GLOB |0    |UNDEF  |strncmp@@GLIBC_2.2.5
[314857]        |                   0|                   0|FUNC |GLOB |0    |UNDEF  |strtok@@GLIBC_2.2.5
[312333]        |                   0|                   0|FUNC |GLOB |0    |UNDEF  |strtol@@GLIBC_2.2.5
[294219]        |                   0|                   0|FUNC |GLOB |0    |UNDEF  |strtoul@@GLIBC_2.2.5
[310856]        |                   0|                   0|FUNC |GLOB |0    |UNDEF  |strtoull@@GLIBC_2.2.5
[299502]        |                   0|                   0|FUNC |GLOB |0    |UNDEF  |vsnprintf@@GLIBC_2.2.5

Hopefully I can fashion a compatibility wrapper to get this Linux library to work on illumos. I'm almost certain I could build an illumos-native version of the library from the old closed-source SDE, but I suspect that would be frowned upon.

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

No branches or pull requests

1 participant