Replies: 1 comment
|
@lorebrada I'm adding the |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
In #260 @LorenzoTettamanti said that standalone builds would need BPF CO-RE, so I looked at where Rust eBPF is on that. It decides how we fix the offsets listed there.
Rust can't emit BTF field relocations yet. A pre-RFC on the Rust internals forum (April 2026) proposes a
#[btf_preserve_access]attribute, implemented so far in a rustc fork, and there is an example that gets CO-RE with an#[btf]macro from aya-btf plus a bpf-linker built from a development branch, marked experimental. aya already applies BTF relocations when it loads an object, so a C program compiled with clang gets real CO-RE, but ours are Rust.What is hardcoded today:
struct sockfields (sk_drops, sk_err, sk_err_soft, sk_backlog_len, sk_write_memory_queued, sk_receive_buffer_size, sk_ack_backlog) and eightsock_commonfieldsnet_devicename, state, dev_addr and nd_net, thennet.nsandns_common.inumsk_buff->dataThe values that don't match 6.18.44 are in #260.
The options I see:
EbpfLoader::set_global; tracepoint fields come from the format file in tracefs. It works with stable Rust and the bpf-linker we already use. The cost is a small BTF lookup in userspace, and the programs read each offset from a global instead of a constant.I'd go with 1 now, checked by the little-vm-helper job on a few kernels, and look at 3 again once it's released. What do you think?
All reactions