Skip to content

test: replace loopback with veth pairs in integration tests#1484

Open
cong-or wants to merge 8 commits intoaya-rs:mainfrom
cong-or:test-veth-pairs
Open

test: replace loopback with veth pairs in integration tests#1484
cong-or wants to merge 8 commits intoaya-rs:mainfrom
cong-or:test-veth-pairs

Conversation

@cong-or
Copy link
Contributor

@cong-or cong-or commented Feb 21, 2026

The integration tests used to run on loopback, but that only supports generic (SKB-mode) XDP, which doesn’t really reflect a real production setup. Now, they use a veth pair instead, which supports native XDP and behaves much more like an actual NIC.

NetNsGuard sets up the veth pair. For the traffic-heavy tests like af_xdp, PeerNsGuard moves the peer into its own namespace, assigns IPs on both ends, and installs static ARP entries to prevent random ARP traffic from interfering with the XDP redirect programs.

The cpumap_chain test stays on loopback for now, because cpumap chaining doesn’t reliably work through veth on arm64. As a result, the old 5.15 kernel version gate for generic XDP mode remains in place.

Additionally, there’s a small veth_connectivity test that sends a plain UDP packet across the pair with no BPF attached. If anything’s broken in the basic setup, it fails quickly and clearly, avoiding confusing issues down the line.


This change is Reviewable

  Loopback only supports generic-mode XDP, not the native mode used in
  production. Switch to veth pairs which support native XDP.

  - NetNsGuard creates a veth0/veth1 pair in each test namespace
  - PeerNsGuard moves veth1 into a second namespace for traffic tests
  - Lower cpumap_chain kernel gate from 5.15 to 5.9
@netlify
Copy link

netlify bot commented Feb 21, 2026

Deploy Preview for aya-rs-docs ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit c164e54
🔍 Latest deploy log https://app.netlify.com/projects/aya-rs-docs/deploys/699aebc521f59d00085f33e9
😎 Deploy Preview https://deploy-preview-1484--aya-rs-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@cong-or cong-or closed this Feb 21, 2026
@cong-or
Copy link
Contributor Author

cong-or commented Feb 21, 2026

Closes #422

@cong-or cong-or reopened this Feb 21, 2026
  The CI VM does not have iproute2. Talk to the kernel directly instead.
  cpumap chaining on veth doesn't reliably deliver packets on 5.10;
  the attachment succeeds but the packet never reaches the socket.
  cpumap chaining does not reliably deliver packets through veth on
  arm64. Use loopback instead.
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