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

custom extern implementation #4730

Open
Arishbiswas opened this issue Jun 18, 2024 · 1 comment
Open

custom extern implementation #4730

Arishbiswas opened this issue Jun 18, 2024 · 1 comment
Labels
ebpf-psa Topics related to the eBPF PSA back end question This is a topic requesting clarification.

Comments

@Arishbiswas
Copy link

Arishbiswas commented Jun 18, 2024

how can we add custom extern for psa-ebpf backend. is it possoble to write an (ebpf.c) extern and call it from the p4 program

@fruffy fruffy added question This is a topic requesting clarification. ebpf-psa Topics related to the eBPF PSA back end labels Jun 18, 2024
@fruffy
Copy link
Collaborator

fruffy commented Jun 18, 2024

@osinstom @tatry

You can add the --extern-file command to the compiler, I would take a look at the
https://github.com/p4lang/p4c/blob/main/backends/ebpf/CMakeLists.txt#L256C156-L256C169
ebpf_checksum_extern example.

sudo -E p4c/backends/ebpf/run-ebpf-test.py -t test -c "p4c/build/p4c-ebpf" p4c --extern-file p4c/testdata/extern_modules/extern-checksum-ebpf.c  p4c/testdata/p4_16_samples/ebpf_checksum_extern.p4

should run it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ebpf-psa Topics related to the eBPF PSA back end question This is a topic requesting clarification.
Projects
None yet
Development

No branches or pull requests

2 participants