Skip to content

Commit

Permalink
Evade needing to compile own libxdp for skipping the dispatcher by se…
Browse files Browse the repository at this point in the history
…tting env var
  • Loading branch information
mozzieongit committed Aug 19, 2024
1 parent 31f4c2b commit 86fe06d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions xdp-server.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,11 @@ static int load_xdp_program_and_map(struct xdp_server *xdp) {
}

if (xdp->bpf_prog_should_load) {
/* err = xdp_program__attach(xdp->bpf_prog, xdp->interface_index, attach_mode, 0); */
err = xdp_program__attach_single(xdp->bpf_prog, xdp->interface_index, attach_mode);
/* TODO: I find setting environment variables from within a program
* not a good thing to do, but for the meantime this helps... */
putenv("LIBXDP_SKIP_DISPATCHER=1");
err = xdp_program__attach(xdp->bpf_prog, xdp->interface_index, attach_mode, 0);
/* err = xdp_program__attach_single(xdp->bpf_prog, xdp->interface_index, attach_mode); */
if (err) {
libxdp_strerror(err, errmsg, sizeof(errmsg));
log_msg(LOG_ERR, "xdp: could not attach xdp program to interface '%s' : %s\n",
Expand Down

0 comments on commit 86fe06d

Please sign in to comment.