Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add initial XDP skeleton #1052

Merged
merged 5 commits into from
Jan 8, 2025
Merged

Add initial XDP skeleton #1052

merged 5 commits into from
Jan 8, 2025

Conversation

Jake-Shadle
Copy link
Collaborator

This adds the initial XDP integration skeleton to make future PRs easier to review (hopefully). This PR doesn't "do" anything, but is meant to be small and easier to digest, future PRs will be more substantial.

There are two new crates:

crates/ebpf

This is the actual eBPF program that is loaded into the kernel and attached to a NIC so that it can determine if packets received need to be routed to quilkin or not. This is in a separate workspace because its build requirements are different from the rest of this repo, namely that it requires a different target, bpfel-unknown-none, and nightly due to needing build the core crate. For now, there is a bash script that can be used to build it, but this first pass just puts the final binary artifact in the repo since it is quite small and means CI has to do less work, but can be built from source later if we really want that.

crates/xdp

This is a shim crate that basically wraps the two main crates involved with XDP, aya, which is the external rust crate used to load and manage eBPF programs, and xdp the crate I've been working on that is used to create and handle AF_XDP sockets in userspace. The idea with having this separate crate is that quilkin itself will have a smaller surface area for interacting with XDP itself so that it's easier to make changes/remove it in the future and just generally reduce churn in quilkin itself.

This commit adds the eBPF program used to determine if packets should be routed to quilkin's AF_XDP sockets
crates/xdp/src/lib.rs Show resolved Hide resolved
Cargo.toml Outdated Show resolved Hide resolved
@quilkin-bot
Copy link
Collaborator

Build Succeeded 🥳

Build Id: 3471c90a-5f7e-4ac5-a7ed-861afec7411e

The following development images have been built, and will exist for the next 30 days:

To build this version:

git fetch [email protected]:googleforgames/quilkin.git pull/1052/head:pr_1052 && git checkout pr_1052
cargo build

@XAMPPRocky XAMPPRocky merged commit 481dcd2 into main Jan 8, 2025
12 checks passed
@Jake-Shadle Jake-Shadle deleted the xdp branch January 8, 2025 10:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants