feat(ebpf): add usid TC-BPF program and generated bindings - #280
feat(ebpf): add usid TC-BPF program and generated bindings#280privateip wants to merge 1 commit into
Conversation
d042d61 to
16637d5
Compare
Adds the `uFMT 48+16` uSID decode/forward datapath as a TC-BPF program (usid.c) plus its bpf2go-generated Go bindings (usid_bpfeb/el.go/.o) in internal/plumbing/ebpf/prog. The program does the ingress lookup chain (locator -> function -> VRF), strips the outer IPv6 header, and does a VRF-scoped FIB lookup/redirect for the inner packet, counting drops by reason via dropreason.go's exported constants.
16637d5 to
f93f05c
Compare
|
The summary says the |
|
Good catch — the summary was stale. Updated it to reflect that |
|
Closing as superseded by #281 — |
Summary
Adds the
uFMT 48+16uSID decode/forward datapath as a TC-BPF program underinternal/plumbing/ebpf/prog, plus the pure-Go primitives for its key format underinternal/plumbing/ebpf/uformat:usid.c— the TC-BPF ingress program: exact-match lookup chain (locator → function → VRF), strip of the outer IPv6 header, and a VRF-scoped FIB lookup/redirect for the inner packet, with per-reason drop counters.usid_bpfeb.go/usid_bpfeb.oandusid_bpfel.go/usid_bpfel.o—bpf2go-generated Go bindings and compiled BPF objects (big/little endian), committed per this repo's convention for generated code.dropreason.go— exported drop-reason constants kept in sync withusid.c'senum drop_reason, for consumption by callers outside this package (e.g. a future Prometheus collector).doc.go— package documentation, including thego:generatedirective used to regenerate the bindings.usid_test.go—BPF_PROG_TEST_RUN-based tests for the program.internal/plumbing/ebpf/uformat/uformat.go— pure-Go, no-cgo encode/decode of theuFMT 48+16bit layout (block, node-ID, function, argument) and thelocator_table/function_tablekey composition thatusid.cimplements in C, so this package is the in-repo source of truth for that key format.internal/plumbing/ebpf/uformat/uformat_test.go— tests for the above.This PR is scoped to the program and its key-format primitives. The surrounding Go plumbing that will load/attach it (
attach), read its maps (usidmap), and expose metrics (metrics,preflight) is intentionally left out and will land in follow-up PRs.Testing
task ci(lint → build → test:unit → test:e2e)🤖 Generated with Claude Code