Skip to content

Commit

Permalink
Add comment about default flags
Browse files Browse the repository at this point in the history
  • Loading branch information
Jake-Shadle committed Jan 22, 2025
1 parent 1ddc0ec commit 0c520b1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/net/xdp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,12 @@ pub fn spawn(workers: XdpWorkers, config: Arc<crate::Config>) -> Result<XdpLoop,
// Now that all the io loops are running, attach the eBPF program to route
// packets to the bound sockets
let mut ebpf_prog = workers.ebpf_prog;

// We use the default flags here, which means that the program will be attached
// in driver mode if the NIC + driver is capable of it, otherwise it will fallback
// to SKB mode. This allows maximum compatibility, and we already provide
// flags to force zerocopy, which relies on driver mode, so the user can use
// that if they don't want the fallback behavior
let xdp_link =
ebpf_prog.attach(workers.nic, quilkin_xdp::aya::programs::XdpFlags::default())?;

Expand Down

0 comments on commit 0c520b1

Please sign in to comment.