[ovs-dev] [PATCH] build: check libibverbs deps before linking with dpdk

Harold Huang baymaxhuang at gmail.com
Wed Nov 10 04:10:07 UTC 2021


When I build ovs-dpdk without mlx4/mlx5 driver, the configure log is as
follows:

checking for DPDK... yes
checking for faulty pkg-config version... no
checking for rte_config.h... yes
checking whether RTE_LIBRTE_VHOST_NUMA is declared... yes
checking for library containing get_mempolicy... -lnuma
checking whether RTE_EAL_NUMA_AWARE_HUGEPAGES is declared... yes
checking for library containing get_mempolicy... (cached) -lnuma
checking whether RTE_LIBRTE_PMD_PCAP is declared... yes
checking for library containing pcap_dump_close... -lpcap
checking whether RTE_LIBRTE_PMD_AF_XDP is declared... no
checking whether RTE_LIBRTE_VHOST_NUMA is declared... (cached) yes
checking whether RTE_LIBRTE_MLX5_PMD is declared... no
checking whether RTE_LIBRTE_MLX4_PMD is declared... no
checking for library containing dlopen... -ldl
checking whether linking with dpdk works... no
configure: error: Could not find DPDK library in default search path,
update PKG_CONFIG_PATH for pkg-config to find the .pc file in non-standard
location

The error log is puzzled because I indeed have configured PKG_CONFIG_PATH
in the right way. After checking the config.log we found libibverbs is
needed when linking with dpdk:

configure:31517: checking whether linking with dpdk works
configure:31533: gcc -o conftest -g -O2 -DHAVE_AVX512F -mno-avx512f
-I/usr/local/include -include rte_config.h -march=native -mno-avx512f
 conftest.c -Wl,--whole-archive -L/usr/local/lib64 -l:librte_common_cpt.a
-l:librte_common_dpaax.a -l:librte_common_iavf.a
-l:librte_common_octeontx.a -l:librte_common_octeontx2.a
-l:librte_common_sfc_efx.a -l:librte_bus_dpaa.a -l:librte_bus_fslmc.a
-l:librte_bus_ifpga.a -l:librte_bus_pci.a -l:librte_bus_vdev.a
-l:librte_bus_vmbus.a -l:librte_common_qat.a -l:librte_mempool_bucket.a
-l:librte_mempool_dpaa.a -l:librte_mempool_dpaa2.a
-l:librte_mempool_octeontx.a -l:librte_mempool_octeontx2.a
-l:librte_mempool_ring.a -l:librte_mempool_stack.a
-l:librte_net_af_packet.a -l:librte_net_ark.a -l:librte_net_atlantic.a
-l:librte_net_avp.a -l:librte_net_axgbe.a -l:librte_net_bond.a
-l:librte_net_bnx2x.a -l:librte_net_bnxt.a -l:librte_net_cxgbe.a
-l:librte_net_dpaa.a -l:librte_net_dpaa2.a -l:librte_net_e1000.a
-l:librte_net_ena.a -l:librte_net_enetc.a -l:librte_net_enic.a
-l:librte_net_failsafe.a -l:librte_net_fm10k.a -l:librte_net_i40e.a
-l:librte_net_hinic.a -l:librte_net_hns3.a -l:librte_net_iavf.a
-l:librte_net_ice.a -l:librte_net_igc.a -l:librte_net_ixgbe.a
-l:librte_net_kni.a -l:librte_net_liquidio.a -l:librte_net_memif.a
-l:librte_net_netvsc.a -l:librte_net_nfp.a -l:librte_net_null.a
-l:librte_net_octeontx.a -l:librte_net_octeontx2.a -l:librte_net_pcap.a
-l:librte_net_pfe.a -l:librte_net_qede.a -l:librte_net_ring.a
-l:librte_net_sfc.a -l:librte_net_softnic.a -l:librte_net_tap.a
-l:librte_net_thunderx.a -l:librte_net_txgbe.a -l:librte_net_vdev_netvsc.a
-l:librte_net_vhost.a -l:librte_net_virtio.a -l:librte_net_vmxnet3.a
-l:librte_raw_dpaa2_cmdif.a -l:librte_raw_dpaa2_qdma.a -l:librte_raw_ioat.a
-l:librte_raw_ntb.a -l:librte_raw_octeontx2_dma.a
-l:librte_raw_octeontx2_ep.a -l:librte_raw_skeleton.a
-l:librte_compress_octeontx.a -l:librte_compress_zlib.a
-l:librte_regex_octeontx2.a -l:librte_vdpa_ifc.a -l:librte_baseband_null.a
-l:librte_baseband_turbo_sw.a -l:librte_baseband_fpga_lte_fec.a
-l:librte_baseband_fpga_5gnr_fec.a -l:librte_baseband_acc100.a
-l:librte_node.a -l:librte_graph.a -l:librte_bpf.a
-l:librte_flow_classify.a -l:librte_pipeline.a -l:librte_table.a
-l:librte_port.a -l:librte_fib.a -l:librte_ipsec.a -l:librte_vhost.a
-l:librte_stack.a -l:librte_security.a -l:librte_sched.a
-l:librte_reorder.a -l:librte_rib.a -l:librte_regexdev.a -l:librte_rawdev.a
-l:librte_pdump.a -l:librte_power.a -l:librte_member.a -l:librte_lpm.a
-l:librte_latencystats.a -l:librte_kni.a -l:librte_jobstats.a
-l:librte_ip_frag.a -l:librte_gso.a -l:librte_gro.a -l:librte_eventdev.a
-l:librte_efd.a -l:librte_distributor.a -l:librte_cryptodev.a
-l:librte_compressdev.a -l:librte_cfgfile.a -l:librte_bitratestats.a
-l:librte_bbdev.a -l:librte_acl.a -l:librte_timer.a -l:librte_hash.a
-l:librte_metrics.a -l:librte_cmdline.a -l:librte_pci.a -l:librte_ethdev.a
-l:librte_meter.a -l:librte_net.a -l:librte_mbuf.a -l:librte_mempool.a
-l:librte_rcu.a -l:librte_ring.a -l:librte_eal.a -l:librte_telemetry.a
-l:librte_kvargs.a -Wl,--no-whole-archive -Wl,--export-dynamic
-Wl,--as-needed -lrte_node -lrte_graph -lrte_bpf -lrte_flow_classify
-lrte_pipeline -lrte_table -lrte_port -lrte_fib -lrte_ipsec -lrte_vhost
-lrte_stack -lrte_security -lrte_sched -lrte_reorder -lrte_rib
-lrte_regexdev -lrte_rawdev -lrte_pdump -lrte_power -lrte_member -lrte_lpm
-lrte_latencystats -lrte_kni -lrte_jobstats -lrte_ip_frag -lrte_gso
-lrte_gro -lrte_eventdev -lrte_efd -lrte_distributor -lrte_cryptodev
-lrte_compressdev -lrte_cfgfile -lrte_bitratestats -lrte_bbdev -lrte_acl
-lrte_timer -lrte_hash -lrte_metrics -lrte_cmdline -lrte_pci -lrte_ethdev
-lrte_meter -lrte_net -lrte_mbuf -lrte_mempool -lrte_rcu -lrte_ring
-lrte_eal -lrte_telemetry -lrte_kvargs -pthread -lm -ldl -lnuma -lz -lpcap
-libverbs  -ldl -lpcap -lnuma -lnuma -latomic -lpthread -lrt -lm  -lunbound
>&5
/usr/bin/ld: cannot find -libverbs
collect2: error: ld returned 1 exit status
configure:31533: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "openvswitch"
| #define PACKAGE_TARNAME "openvswitch"
| #define PACKAGE_VERSION "2.15.0"
| #define PACKAGE_STRING "openvswitch 2.15.0"
| #define PACKAGE_BUGREPORT "bugs at openvswitch.org"
| #define PACKAGE_URL ""
| #define PACKAGE "openvswitch"
| #define VERSION "2.15.0"
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define __EXTENSIONS__ 1
| #define _ALL_SOURCE 1
| #define _GNU_SOURCE 1
| #define _POSIX_PTHREAD_SEMANTICS 1
| #define _TANDEM_SOURCE 1
| #define HAVE_DLFCN_H 1
| #define LT_OBJDIR ".libs/"
| #define HAVE_PTHREAD_SPIN_LOCK 1
| #define HAVE_DECL_STRERROR_R 1
| #define HAVE_STRERROR_R 1
| #define STRERROR_R_CHAR_P 1
| #define HAVE_NETLINK 1
| #define HAVE_OPENSSL 1
| #define OPENSSL_SUPPORTS_SNI 1
| #define HAVE_LIBCAPNG 1
| #define HAVE_DECL_SYS_SIGLIST 1
| #define HAVE_DECL_MALLOC_TRIM 1
| #define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 1
| #define HAVE_STRUCT_MMSGHDR_MSG_LEN 1
| #define HAVE_STRUCT_SOCKADDR_IN6_SIN6_SCOPE_ID 1
| #define HAVE_MLOCKALL 1
| #define HAVE_STRNLEN 1
| #define HAVE_GETLOADAVG 1
| #define HAVE_STATVFS 1
| #define HAVE_GETMNTENT_R 1
| #define HAVE_SENDMMSG 1
| #define HAVE_CLOCK_GETTIME 1
| #define HAVE_MNTENT_H 1
| #define HAVE_SYS_STATVFS_H 1
| #define HAVE_LINUX_TYPES_H 1
| #define HAVE_LINUX_IF_ETHER_H 1
| #define HAVE_LINUX_NET_NAMESPACE_H 1
| #define HAVE_STDATOMIC_H 1
| #define HAVE_BITS_FLOATN_COMMON_H 1
| #define HAVE_BACKTRACE 1
| #define HAVE_LINUX_PERF_EVENT_H 1
| #define HAVE_VALGRIND_VALGRIND_H 1
| #define HAVE_THREAD_LOCAL 1
| #define HAVE_GCC4_ATOMICS 1
| #define ATOMIC_ALWAYS_LOCK_FREE_1B 1
| #define ATOMIC_ALWAYS_LOCK_FREE_2B 1
| #define ATOMIC_ALWAYS_LOCK_FREE_4B 1
| #define ATOMIC_ALWAYS_LOCK_FREE_8B 1
| #define HAVE_GLIBC_PTHREAD_SETNAME_NP 1
| #define HAVE_CXX11 1
| #define HAVE_POSIX_MEMALIGN 1
| #define HAVE_UNBOUND 1
| #define HAVE_STDIO_H 1
| #define HAVE_STRING_H 1
| #define HAVE_NLA_BITFIELD32 1
| #define HAVE_TCA_ACT_FLAGS 1
| #define HAVE_STRUCT_TCF_T_FIRSTUSE 1
| #define HAVE_TCA_VLAN_PUSH_VLAN_PRIORITY 1
| #define HAVE_TCA_MPLS_TTL 1
| #define HAVE_TCA_TUNNEL_KEY_ENC_TTL 1
| #define HAVE_TCA_PEDIT_KEY_EX_HDR_TYPE_UDP 1
| #define HAVE_TCA_SKBEDIT_FLAGS 1
| #define HAVE_SCTP_CONNTRACK_HEARTBEATS 1
| #define HAVE_VIRTIO_TYPES 1
| #define HAVE_RTE_CONFIG_H 1
| #define HAVE_DECL_RTE_LIBRTE_VHOST_NUMA 1
| #define HAVE_DECL_RTE_EAL_NUMA_AWARE_HUGEPAGES 1
| #define VHOST_NUMA 1
| /* end confdefs.h.  */
| #include <rte_config.h>
|                         #include <rte_eal.h>
| int
| main ()
| {
| int rte_argc; char ** rte_argv;
|                         rte_eal_init(rte_argc, rte_argv);
|   ;
|   return 0;
| }
configure:31538: result: no
configure:31540: error: Could not find DPDK library in default search path,
update PKG_CONFIG_PATH for pkg-config to find the .pc file in non-standard
location

The following patch can fix this problem and make the configure error log
cleaner:

Signed-off-by: Harold Huang <baymaxhuang at gmail.com>
---
 acinclude.m4 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/acinclude.m4 b/acinclude.m4
index 8ab690f47..73a8861d6 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -461,17 +461,17 @@ AC_DEFUN([OVS_CHECK_DPDK], [
     AC_CHECK_DECL([RTE_NET_MLX5], [dnl found
       AC_CHECK_DECL([RTE_IBVERBS_LINK_DLOPEN], [], [dnl not found
         OVS_FIND_DEPENDENCY([mlx5dv_create_wq], [mlx5], [libmlx5])
-        OVS_FIND_DEPENDENCY([verbs_init_cq], [ibverbs], [libibverbs])
       ], [[#include <rte_config.h>]])
     ], [], [[#include <rte_config.h>]])

     AC_CHECK_DECL([RTE_NET_MLX4], [dnl found
       AC_CHECK_DECL([RTE_IBVERBS_LINK_DLOPEN], [], [dnl not found
         OVS_FIND_DEPENDENCY([mlx4dv_init_obj], [mlx4], [libmlx4])
-        OVS_FIND_DEPENDENCY([verbs_init_cq], [ibverbs], [libibverbs])
       ], [[#include <rte_config.h>]])
     ], [], [[#include <rte_config.h>]])

+    OVS_FIND_DEPENDENCY([verbs_init_cq], [ibverbs], [libibverbs])
+
     # DPDK uses dlopen to load plugins.
     OVS_FIND_DEPENDENCY([dlopen], [dl], [libdl])

--
2.18.2


More information about the dev mailing list