Skip to content

Commit

Permalink
libxdp: Print a warning if there are not enough free slots in the dis…
Browse files Browse the repository at this point in the history
…patcher

Just returning E2BIG with no error message when the dispatcher is full
is a bit confusing. Add a warning message to indicate the source of the
error.

Signed-off-by: Toke Høiland-Jørgensen <[email protected]>
  • Loading branch information
tohojo committed Jan 9, 2025
1 parent 9059c20 commit 2bea803
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/libxdp/libxdp.c
Original file line number Diff line number Diff line change
Expand Up @@ -2928,8 +2928,10 @@ static struct xdp_multiprog *xdp_multiprog__generate(struct xdp_program **progs,

num_new_progs += remove_progs ? -num_progs : num_progs;

if (num_new_progs > MAX_DISPATCHER_ACTIONS)
if (num_new_progs > MAX_DISPATCHER_ACTIONS) {
pr_warn("Not enough free slots in the dispatcher.\n");
return ERR_PTR(-E2BIG);
}

pr_debug("Generating multi-prog dispatcher for %zu programs\n",
num_new_progs);
Expand Down

0 comments on commit 2bea803

Please sign in to comment.