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

[P4-EBPF] Computation of more than 128 bits not supported in EBPF. #4235

Open
komaljai opened this issue Nov 9, 2023 · 1 comment
Open
Labels
ebpf Topics related to the eBPF back end

Comments

@komaljai
Copy link
Contributor

komaljai commented Nov 9, 2023

For header fields more than 128 bits, compiler throw errors as computation not supported

error: (bit<128>)hdr.ipv4.dst_addr: Computations on 128 bits not supported
meta.dst_ip_addr = (bit<128>)hdr.ipv4.dst_addr;

@fruffy fruffy added the ebpf Topics related to the eBPF back end label Nov 9, 2023
@jafingerhut
Copy link
Contributor

P4-DPDK has a similar limitation today: #4174

As I mention there, I would strongly recommend that all P4 implementation consider supporting arithmetic operations up to 128-bit wide values, because IPv6 is a fairly commonly used header, and although you do not often want to do arithmetic on IPv6 addresses, in the few cases that you do, it is very helpful, and you really miss it if you do not have it.

I cannot think of any strong reason to support arithmetic on values wider than 128 bits. At least, there would be diminishing returns there in terms of common use cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ebpf Topics related to the eBPF back end
Projects
None yet
Development

No branches or pull requests

3 participants