]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
dpdk: add linker flag for DPDK Bond library
authorLukas Sismis <lsismis@oisf.net>
Thu, 25 May 2023 12:00:19 +0000 (14:00 +0200)
committerVictor Julien <vjulien@oisf.net>
Mon, 5 Jun 2023 09:07:02 +0000 (11:07 +0200)
Header checking (AC_CHECK_HEADER) did not work as
DPDK 19.11 included rte_eth_bond.h file even if net/bonding
driver was disabled. However, it was still not available in
ldconfig configuration. For this reason Bond PMD is checked with
ldconfig tool.
However when installing the DPDK library manually, the user needs to
update the entries in ldconfig to be able to find the Bond PMD.

Ticket: #6099

configure.ac

index 4d66c55d0a965dacaabbf9cc8362850510edbfe3..77a90b88dcd1087944192bad5c5809aadabcd2fe 100644 (file)
     ])
 
   # DPDK support
+    enable_dpdk_bond_pmd="no"
     AC_ARG_ENABLE(dpdk,
             AS_HELP_STRING([--enable-dpdk], [Enable DPDK support [default=no]]),
                         [enable_dpdk=$enableval],[enable_dpdk=no])
         fi
         CFLAGS="${CFLAGS} `pkg-config --cflags libdpdk`"
         LIBS="${LIBS} -Wl,-R,`pkg-config --libs-only-L libdpdk | cut -c 3-` -lnuma `pkg-config --libs libdpdk`"
+
+        if test ! -z "$(ldconfig -p | grep librte_net_bond)"; then
+            AC_DEFINE([HAVE_DPDK_BOND],[1],(DPDK Bond PMD support enabled))
+            enable_dpdk_bond_pmd="yes"
+            LIBS="${LIBS} -lrte_net_bond" # 20.11+
+        elif test ! -z "$(ldconfig -p | grep librte_pmd_bond)"; then
+            AC_DEFINE([HAVE_DPDK_BOND],[1],(DPDK Bond PMD support enabled))
+            enable_dpdk_bond_pmd="yes"
+            LIBS="${LIBS} -lrte_pmd_bond"
+        else
+            echo
+            echo "  WARNING: DPDK Bond PMD was not found on your system, "
+            echo "  you will be unable to use DPDK Bond PMD."
+            echo "  You can try to \"sudo ldconfig\" and reconfigure again"
+            echo "  or compile and install DPDK with Bond support enabled."
+            echo
+        fi
     ])
 
   # Netmap support
@@ -2629,6 +2647,7 @@ SURICATA_BUILD_CONF="Suricata Configuration:
   Profiling rules enabled:                 ${enable_profiling_rules}
 
   Plugin support (experimental):           ${plugin_support}
+  DPDK Bond PMD:                           ${enable_dpdk_bond_pmd}
 
 Development settings:
   Coccinelle / spatch:                     ${enable_coccinelle}