GitShow/facebook/bpfilter
facebook

bpfilter

eBPF-based packet filtering framework

by facebook
Star on GitHubForkWebsite

C

341 stars60 forks29 contributorsActive · 1mo agoSince 2023v0.6.0GPL-2.0

Meet the team

See all 29 on GitHub →
qdeslandes
qdeslandes1.1k contributions
pzmarzly
pzmarzly63 contributions
yaakov-stein
yaakov-stein63 contributions
SkohTV
SkohTV6 contributions
ryanbsull
ryanbsull6 contributions
rphibel
rphibel5 contributions
AliGhaffarian
AliGhaffarian4 contributions
daandemeyer
daandemeyer3 contributions

Languages

View on GitHub →
C60.6%
C++14%
Shell11.2%
Befunge3.5%
Python3.3%
CMake2.4%
Other5.0%

Commit activity

Last 12 weeks · 83 commits

Full graph →

Community health

4 of 6 standards met

Community profile →
75
✓README✓License✓Contributing✓Code of Conduct○Issue Template○PR Template

Recent PRs & issues

Active · 2 in progress · Last activity 1mo ago
See all on GitHub →
yaakov-stein
`update-set` Should Accept Multiple Set DeltasOpenIssue

Currently, if you want to update multiple sets, you can either call multiple times or use the chain update/set operations. A better option would be passing multiple set deltas via the operation.

yaakov-stein · 2w ago
qdeslandes
Investigate `meta.(s|d)addr` feasibility to match against IPv4 or IPv6 addressesOpenIssue

Similarly to and , / could have a meta counterpart to filter on either IPv4 or IPv6 from the same matcher. That would also apply to sets filtering: This requires investigation as it might not be feasible.

qdeslandes · 1mo ago

Recent fixes

View closed PRs →
qdeslandes
tests: benchmarks: add hostname to benchmark metadataMergedPR

The hostname is now recorded as custom context in the JSON output alongside gitrev, gitdate, and other run metadata. This makes it possible to correlate results with the machine that produced them, which matters when benchmarks are run on different hosts.

qdeslandes · 1mo ago
qdeslandes
lib: cgen: add per-rule state map for log rate limitingMergedPR

Rules with a log action currently emit one entry per matching packet with no throttling. To support rate-limited logging, BPF programs need mutable per-rule state that persists across invocations. Introduce bf_smap, a single-entry BPF_MAP_TYPE_ARRAY map per chain whose value is a flat array of bf_rule_state entries (one per rule). The map is looked up once in the program prologue and the base pointer stored in bf_runtime.state_map; per-rule access is then a constant offset, avoiding one bpf_map_lookup_elem call per rule at packet time. For each rule with log_rate_ns set, the generated code reads last_log_ts, calls bpf_ktime_get_ns(), and skips the log elfstub if the elapsed time falls short of the configured interval. R9 (callee-saved) holds the state entry pointer across the ktime call. Writes to last_log_ts are best-effort: no CAS, but a naturally aligned 8-byte store is atomic on x86-64, so no torn writes occur. Expose the rate in the DSL as 'log [] every {ns,us,ms,s}' and wire it to the new bf_rule.log_rate_ns field serialized alongside the existing rule fields.

qdeslandes · 1mo ago
qdeslandes
lib: cgen: replace counters map with per-CPU arrayMergedPR

Switch BF_MAP_TYPE_COUNTERS from BPF_MAP_TYPE_ARRAY to BPF_MAP_TYPE_PERCPU_ARRAY. Each CPU updates its own counter slot without contention, which eliminates the need for atomic operations in the BPF fast path (bpf_map_lookup_elem on a per-CPU map returns a direct pointer to the current CPU's value). Changes lib: Add to Switch the counters map to : allocate a per-CPU buffer, do one lookup, then sum all CPU slots into the returned Add : builds a per-CPU buffer with the value in CPU 0's slot and zeroes elsewhere, then calls with the full buffer : replace with — the old call passed a 16-byte buffer to a syscall that reads bytes, writing garbage from the stack into the new map tests: Update jq queries in 8 e2e tests: per-CPU dumps use (array per CPU) instead of , so counter reads change from to

qdeslandes · 1mo ago
Structured data for AI agents

Repository: facebook/bpfilter. Description: eBPF-based packet filtering framework Stars: 341, Forks: 60. Primary language: C. Languages: C (60.6%), C++ (14%), Shell (11.2%), Befunge (3.5%), Python (3.3%). License: GPL-2.0. Homepage: https://bpfilter.io/ Latest release: v0.6.0 (9mo ago). Open PRs: 2, open issues: 20. Last activity: 1mo ago. Community health: 75%. Top contributors: qdeslandes, pzmarzly, yaakov-stein, SkohTV, ryanbsull, rphibel, AliGhaffarian, daandemeyer, vinxcls, era-or-entra and others.

·@ofershap

Replace github.com with gitshow.dev