Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/common/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,13 @@

// If enabled, uses a newer bpf_loop() function when choosing a source port for a new connection.
// This allows for a much higher source port range. However, it requires a more recent kernel.
#define USE_NEW_LOOP
#define USE_NEW_LOOP

// Whether to enable chaining multiple XDP programs with this tool (1 = enable. 0 = disable).
#define XDP_MULTIPROG_ENABLED 1

// The XDP program's run priority (used for running multiple XDP programs together).
#define XDP_MULTIPROG_PRIORITY 20

// The action that indicates it should go onto the next program (default XDP_PASS).
#define XDP_MULTIPROG_ACTION XDP_PASS
4 changes: 4 additions & 0 deletions src/loader/utils/xdp.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ int attach_xdp(struct xdp_program *prog, char** mode, int ifidx, int detach, int
{
int err;

// Before attaching, set chaining options.
xdp_program__set_run_prio(prog, XDP_MULTIPROG_PRIORITY);
xdp_program__set_chain_call_enabled(prog, XDP_MULTIPROG_ACTION, XDP_MULTIPROG_ENABLED);

u32 attach_mode = XDP_MODE_NATIVE;

*mode = "DRV/native";
Expand Down