Skip to content

ebpf: fold the lookup helpers into the lookup - #780

Merged
lneto merged 1 commit into
masterfrom
claude_ebpf_lookup
Sep 4, 2026
Merged

lneto merged 1 commit into
masterfrom
claude_ebpf_lookup

Conversation

@lneto

@lneto lneto commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

Reopens #773, which GitHub merged into its base branch while #762 was still open; #762 is on master now, and this is rebased onto it. The fold only exists once the second table, _ENV.percpu, is gone.

lunatik_ebpf_checkkey carried an out parameter and a return code for two lines with one caller, and lunatik_ebpf_checkruntimes returned an int for the caller to test while the table it fetched sat in a global. The key check is inline, and lunatik_ebpf_getruntimes returns the table it caches, so the lookup is key, table, runtime, context. lunatik_ebpf_getctx loses a staged local. No behaviour change; the xdp and tc suites cover it, and the process-context case still fails with the refusal disabled.

The cache of _ENV.runtimes stays. Dropping it would read lunatik_env per packet, and that pointer is freed when lunatik_run unloads while a pinned kfunc module can still receive packets; the cache holds its own reference, so it goes stale across such a reload but never dangles.

Tested on 6.8.0-138 (aarch64): runtime 17/17, xdp 7/7, tc 6/6, clean dmesg.

🤖 Generated with Claude Code

@lneto
lneto force-pushed the claude_ebpf_lookup branch 2 times, most recently from db41c49 to 20f2c52 Compare September 4, 2026 22:38
@lneto
lneto force-pushed the claude_percpu_object branch from 5c2eddb to d7c3441 Compare September 4, 2026 22:38
@lneto
lneto force-pushed the claude_ebpf_lookup branch from 20f2c52 to 8d16881 Compare September 4, 2026 22:41
@lneto
lneto force-pushed the claude_percpu_object branch 2 times, most recently from fa86fce to 41d4314 Compare September 4, 2026 22:42
@lneto
lneto force-pushed the claude_ebpf_lookup branch from 8d16881 to fba9af6 Compare September 4, 2026 22:42
lunatik_ebpf_checkkey carried an out parameter and a return code for two
lines with one caller, and lunatik_ebpf_checkruntimes returned an int
for the caller to test while the table it fetched sat in a global. The
key check is inline now, and lunatik_ebpf_getruntimes returns the table
it caches, so the lookup reads top to bottom: key, table, runtime,
context.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@lneto
lneto changed the base branch from claude_percpu_object to master September 4, 2026 22:48
@lneto
lneto force-pushed the claude_ebpf_lookup branch from fba9af6 to 0c4375a Compare September 4, 2026 22:48
@lneto
lneto merged commit 76b288c into master Sep 4, 2026
4 checks passed
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

Successfully merging this pull request may close these issues.

1 participant