Skip to content

Zenithar/chaos controller/full bpf network filter#1057

Draft
Zenithar wants to merge 8 commits intomainfrom
zenithar/chaos-controller/full_bpf_network_filter
Draft

Zenithar/chaos controller/full bpf network filter#1057
Zenithar wants to merge 8 commits intomainfrom
zenithar/chaos-controller/full_bpf_network_filter

Conversation

@Zenithar
Copy link
Copy Markdown
Contributor

@Zenithar Zenithar commented Apr 8, 2026

What does this PR do?

  • Adds new functionality
  • Alters existing functionality

Replaces the legacy iptables/u32-based network disruption packet filtering with a full eBPF (TC classifier) implementation for both ingress and egress traffic paths.

Key changes

  • New bpfdisrupt packageEngine that manages the BPF data plane: clsact qdisc lifecycle, IFB device for ingress redirect, BPF program attachment (TC egress classifier + ingress DirectAction), and LPM trie map population for target CIDR matching.
  • New eBPF C program (ebpf/network-disruption/disruption.bpf.c) — TC classifier that matches packets against an LPM trie of disruption rules (CIDR + port + protocol), supporting both IPv4 and IPv6.
  • BPF map config tool (ebpf/network-disruption/main.go) — Userspace helper that pins and populates the LPM trie maps via libbpfgo.
  • Refactored injector/network_disruption.go — Integrates the BPF engine, replacing iptables/u32 filter chains with BPF classifiers. Simplifies the overall tc qdisc/filter setup.
  • New network/ abstractionsTrafficController and NetlinkAdapter interfaces for tc and netlink operations, with mocks for testability.
  • Comprehensive tests — Unit tests for bpfdisrupt.Engine, network disruption helpers, and controller-level BPF network disruption integration tests.
  • Updated docs — Revised network disruption documentation to reflect the BPF-based architecture.

Code Quality Checklist

  • The documentation is up to date.
  • My code is sufficiently commented and passes continuous integration checks.
  • I have signed my commit (see Contributing Docs).

Testing

  • I leveraged continuous integration testing
    • by adding new unit tests or end-to-end tests.
  • I manually tested the following steps:
    • locally.
    • as a canary deployment to a cluster.

@Zenithar Zenithar self-assigned this Apr 8, 2026
@datadog-datadog-prod-us1-2
Copy link
Copy Markdown

datadog-datadog-prod-us1-2 bot commented Apr 8, 2026

✅ Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

🎯 Code Coverage (details)
Patch Coverage: 44.63%
Overall Coverage: 38.34% (-0.15%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 0a1797e | Docs | Datadog PR Page | Was this helpful? React with 👍/👎 or give us feedback!

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