From 2bea803cbd62ade93b06e279d3093d65cc1834d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Toke=20H=C3=B8iland-J=C3=B8rgensen?= Date: Thu, 9 Jan 2025 21:17:28 +0100 Subject: [PATCH] libxdp: Print a warning if there are not enough free slots in the dispatcher MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- lib/libxdp/libxdp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/libxdp/libxdp.c b/lib/libxdp/libxdp.c index 9127454a..fd235842 100644 --- a/lib/libxdp/libxdp.c +++ b/lib/libxdp/libxdp.c @@ -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);