Project

General

Profile

Actions

Bug #6275

open

fail af_xdp at configure time when libxdp is missing?

Added by Vincent Li over 1 year ago. Updated about 2 months ago.

Status:
New
Priority:
Normal
Assignee:
Target version:
Affected Versions:
Effort:
Difficulty:
Label:

Description

af_xdp is enabled by default in configure.ac, when libxdp is missing, the configure script continues without error, and make succeeds, but when starting suricata with --af-xdp mode, suricata failed with error about system not supporting af_xdp. configure script should fail if libxdp is missing? should af_xdp enabled by default? here is my workaround to successfully detect if libxdp is missing and fail configure script when libxdp is missing, I also disabled af_xdp by default

diff --git a/configure.ac b/configure.ac
index 0b71278fc..2c197576b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1357,7 +1357,7 @@
   # AF_XDP support
     AC_ARG_ENABLE(af-xdp,
            AS_HELP_STRING([--disable-af-xdp], [Disable AF_XDP support [default=enabled]]),
-                        [enable_af_xdp=$enableval],[enable_af_xdp=yes])
+                        [enable_af_xdp=$enableval],[enable_af_xdp=no])

     AS_IF([test "x$enable_af_xdp" = "xyes"], [
         # Check for the availability of elf
@@ -1366,13 +1366,13 @@
         # Conditionally check headers, only when found will it 'continue'
         AS_IF([test "x$enable_af_xdp" = "xyes"],
             # Check for the availability of libxdp
-            AC_CHECK_HEADERS([xdp/xsk.h],,[enable_af_xdp=no])
-            AC_CHECK_LIB([xdp],[xsk_umem__create],,[enable_af_xdp=no]))
+            AC_CHECK_HEADERS([xdp/xsk.h],,[enable_af_xdp=no]))

         AS_IF([test "x$enable_af_xdp" = "xyes"],
             # Check for the availability of libbpf
             AC_CHECK_HEADERS([bpf/libbpf.h],,[enable_af_xdp=no])
-            AC_CHECK_LIB([bpf],[bpf_object__open],,[enable_af_xdp=no]))
+            AC_CHECK_LIB([bpf],[bpf_object__open],,[enable_af_xdp=no]),
+            AC_MSG_ERROR([libxdp not found]))

Actions #1

Updated by Vincent Li over 1 year ago

  • Subject changed from fail af_xdp at configure time when libxdp missing? to fail af_xdp at configure time when libxdp is missing?
Actions #2

Updated by Jason Ish over 1 year ago

  • Assignee changed from OISF Dev to Jason Ish
  • Target version changed from TBD to 7.0.1

What should happen by default is if the AF_XDP dependencies are found, the support will built. If they are not found, they will not be built. So on a normal configure this should not error out.

However, we are not erroring out on an explicit --enable-af-xdp which we should.

Actions #3

Updated by Victor Julien over 1 year ago

  • Target version changed from 7.0.1 to 7.0.2
Actions #4

Updated by Victor Julien about 1 year ago

  • Target version changed from 7.0.2 to 7.0.3
Actions #5

Updated by Victor Julien about 1 year ago

  • Target version changed from 7.0.3 to 8.0.0-beta1
Actions #6

Updated by Jason Ish about 2 months ago

  • Assignee changed from Jason Ish to OISF Dev
Actions

Also available in: Atom PDF