mlx5dv_create_flow_action_packet_reformat is a function in <infiniband/mlx5dv.h>.
error shows:undefined reference to `mlx5dv_create_flow_action_packet_reformat'.
Why can't I link the mlx5dv_create_flow_action_packet_reformat function.
Does Which mean that I need to download some dependency packages?
—————————————————————————————————————————— My Makefile:
ROOTDIR=$(shell git rev-parse --show-toplevel)
RTE_SDK=/home/cxx/dpdk-18.11
R2P2LIB_DIR=$(ROOTDIR)/r2p2
RAFT_DIR=$(shell git rev-parse --show-toplevel)/../raft
include $(ROOTDIR)/netstack/dp/dir.mk
include $(ROOTDIR)/netstack/net/dir.mk
include $(R2P2LIB_DIR)/dir.mk
CC=gcc
CFLAGS += -g -O3 -I$(ROOTDIR)/netstack/inc -I$(R2P2LIB_DIR)/inc -I$(RTE_SDK)/x86_64-native-linuxapp-gcc/include -I$(RAFT_DIR)/include -DNO_BATCH #-DACCELERATED #-DRAFT_STATS
ifeq ($(WITH_RAFT), 1)
CFLAGS += -DWITH_RAFT
endif
ifeq ($(LB_REPLIES), 1)
CFLAGS += -DLB_REPLIES
endif
ifeq ($(SKIP_NO_SE), 1)
CFLAGS += -DSKIP_NO_SE
endif
ifeq ($(ACCELERATED), 1)
CFLAGS += -DACCELERATED
endif
ifeq ($(SWITCH_AGG), 1)
CFLAGS += -DSWITCH_AGG
endif
ifeq ($(SMART_LB), 1)
CFLAGS += -DSMART_LB
endif
ifeq ($(VIEW_CHANGE_EXP), 1)
CFLAGS += -DVIEW_CHANGE_EXP
endif
ifdef PACKET_LOSS
CFLAGS += -DPACKET_LOSS=$(PACKET_LOSS)
endif
WERROR_FLAGS := -W -Wall -Wstrict-prototypes -Wmissing-prototypes
WERROR_FLAGS += -Wmissing-declarations -Wold-style-definition -Wpointer-arith
WERROR_FLAGS += -Wcast-align -Wnested-externs -Wcast-qual
WERROR_FLAGS += -Wformat-nonliteral -Wformat-security
WERROR_FLAGS += -Wundef -Wwrite-strings
CFLAGS += $(WERROR_FLAGS) -mavx2
LDFLAGS= -Wl,--whole-archive -Wl,-ldpdk -Wl,--no-whole-archive -lrt -lpthread -lm -ldl -L$(RTE_SDK)/x86_64-native-linuxapp-gcc/lib -lconfig -lnuma -lgcov --coverage -lpcap
SRCS_C := $(addprefix $(ROOTDIR)/netstack/dp/, $(DP_SRC)) $(addprefix $(ROOTDIR)/netstack/net/, $(NET_SRC)) $(addprefix $(R2P2LIB_DIR)/, $(R2P2_SRC_C))
OBJS_C := $(patsubst %.c, %.o, $(SRCS_C))
ifeq ($(WITH_RAFT), 1)
OBJS_C += $(RAFT_DIR)/libraft.a
endif
all:
make r2p2-echo
make r2p2-echo-fdir
make synthetic-time
make synthetic-time-fdir
make r2p2-router
make udp-echo
make udp-synthetic
debug: cleanstate debug.o $(OBJS_C)
$(CC) -o $@ debug.o $(OBJS_C) $(LDFLAGS)
r2p2-echo: cleanstate r2p2-echo.o $(OBJS_C)
$(CC) -o $@ r2p2-echo.o $(OBJS_C) $(LDFLAGS)
r2p2-echo-fdir: CFLAGS += -DFDIR
r2p2-echo-fdir: cleanstate r2p2-echo.o $(OBJS_C)
$(CC) -o $@ r2p2-echo.o $(OBJS_C) $(LDFLAGS)
stss: cleanstate r2p2-stss.o $(OBJS_C)
$(CC) -o $@ r2p2-stss.o $(OBJS_C) $(LDFLAGS)
synthetic-size: cleanstate r2p2-synthetic-size.o $(OBJS_C)
$(CC) -o $@ r2p2-synthetic-size.o $(OBJS_C) $(LDFLAGS)
synthetic-time: cleanstate r2p2-synthetic-time.o $(OBJS_C)
$(CC) -o $@ r2p2-synthetic-time.o $(OBJS_C) $(LDFLAGS)
synthetic-time-fdir: CFLAGS += -DFDIR
synthetic-time-fdir: cleanstate r2p2-synthetic-time.o $(OBJS_C)
$(CC) -o $@ r2p2-synthetic-time.o $(OBJS_C) $(LDFLAGS)
r2p2-router: CFLAGS += -DROUTER
r2p2-router: cleanstate r2p2-router.o $(OBJS_C)
$(CC) -o $@ r2p2-router.o $(OBJS_C) $(LDFLAGS)
udp-echo: cleanstate udp-echo.o $(OBJS_C)
$(CC) -o $@ udp-echo.o $(OBJS_C) $(LDFLAGS)
udp-synthetic: cleanstate udp-synthetic.o $(OBJS_C)
$(CC) -o $@ udp-synthetic.o $(OBJS_C) $(LDFLAGS)
cleanstate:
make -C $(R2P2LIB_DIR) clean
make clean
rm -f $(ROOTDIR)/netstack/net/*.o
rm -f $(ROOTDIR)/netstack/dp/*.o
clean:
rm -f *.o
distclean:
make clean
rm -f synthetic-time-fdir synthetic-time r2p2-router udp-echo
make -n for l2fwd show:
[cxx@tcsys-node1 l2fwd]$ make -n
mkdir -p /home/cxx/dpdk-18.11/examples/l2fwd/build
make -C /home/cxx/dpdk-18.11/examples/l2fwd/build -f /home/cxx/dpdk-18.11/examples/l2fwd/Makefile \
S=/home/cxx/dpdk-18.11/examples/l2fwd O=/home/cxx/dpdk-18.11/examples/l2fwd/build SRCDIR=/home/cxx/dpdk-18.11/examples/l2fwd
[ -d ./ ] || mkdir -p ./
[ -d ./ ] || mkdir -p ./
set -e; echo " LD l2fwd"; gcc -o l2fwd -m64 -pthread -march=native -DRTE_MACHINE_CPUFLAG_SSE -DRTE_MACHINE_CPUFLAG_SSE2 -DRTE_MACHINE_CPUFLAG_SSE3 -DRTE_MACHINE_CPUFLAG_SSSE3 -DRTE_MACHINE_CPUFLAG_SSE4_1 -DRTE_MACHINE_CPUFLAG_SSE4_2 -DRTE_MACHINE_CPUFLAG_AES -DRTE_MACHINE_CPUFLAG_PCLMULQDQ -DRTE_MACHINE_CPUFLAG_AVX -DRTE_MACHINE_CPUFLAG_RDRAND -DRTE_MACHINE_CPUFLAG_FSGSBASE -DRTE_MACHINE_CPUFLAG_F16C -DRTE_MACHINE_CPUFLAG_AVX2 -I/home/cxx/dpdk-18.11/examples/l2fwd/build/include -I/home/cxx/dpdk-18.11/x86_64-native-linuxapp-gcc/include -include /home/cxx/dpdk-18.11/x86_64-native-linuxapp-gcc/include/rte_config.h -D_GNU_SOURCE -O3 -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wold-style-definition -Wpointer-arith -Wcast-align -Wnested-externs -Wcast-qual -Wformat-nonliteral -Wformat-security -Wundef -Wwrite-strings -Wdeprecated -Wno-address-of-packed-member main.o -L/home/cxx/dpdk-18.11/x86_64-native-linuxapp-gcc/lib -Wl,-lrte_flow_classify -Wl,--whole-archive -Wl,-lrte_pipeline -Wl,--no-whole-archive -Wl,--whole-archive -Wl,-lrte_table -Wl,--no-whole-archive -Wl,--whole-archive -Wl,-lrte_port -Wl,--no-whole-archive -Wl,-lrte_pdump -Wl,-lrte_distributor -Wl,-lrte_ip_frag -Wl,-lrte_meter -Wl,-lrte_lpm -Wl,--whole-archive -Wl,-lrte_acl -Wl,--no-whole-archive -Wl,-lrte_jobstats -Wl,-lrte_metrics -Wl,-lrte_bitratestats -Wl,-lrte_latencystats -Wl,-lrte_power -Wl,-lrte_efd -Wl,-lrte_bpf -Wl,--whole-archive -Wl,-lrte_cfgfile -Wl,-lrte_gro -Wl,-lrte_gso -Wl,-lrte_hash -Wl,-lrte_member -Wl,-lrte_vhost -Wl,-lrte_kvargs -Wl,-lrte_mbuf -Wl,-lrte_net -Wl,-lrte_ethdev -Wl,-lrte_bbdev -Wl,-lrte_cryptodev -Wl,-lrte_security -Wl,-lrte_compressdev -Wl,-lrte_eventdev -Wl,-lrte_rawdev -Wl,-lrte_timer -Wl,-lrte_mempool -Wl,-lrte_mempool_ring -Wl,-lrte_ring -Wl,-lrte_pci -Wl,-lrte_eal -Wl,-lrte_cmdline -Wl,-lrte_reorder -Wl,-lrte_sched -Wl,-lrte_kni -Wl,-lrte_common_cpt -Wl,-lrte_common_octeontx -Wl,-lrte_common_dpaax -Wl,-lrte_bus_pci -Wl,-lrte_bus_vdev -Wl,-lrte_bus_dpaa -Wl,-lrte_bus_fslmc -Wl,-lrte_mempool_bucket -Wl,-lrte_mempool_stack -Wl,-lrte_mempool_dpaa -Wl,-lrte_mempool_dpaa2 -Wl,-lrte_pmd_af_packet -Wl,-lrte_pmd_ark -Wl,-lrte_pmd_atlantic -Wl,-lrte_pmd_avf -Wl,-lrte_pmd_avp -Wl,-lrte_pmd_axgbe -Wl,-lrte_pmd_bnxt -Wl,-lrte_pmd_bond -Wl,-lrte_pmd_cxgbe -Wl,-lrte_pmd_dpaa -Wl,-lrte_pmd_dpaa2 -Wl,-lrte_pmd_e1000 -Wl,-lrte_pmd_ena -Wl,-lrte_pmd_enetc -Wl,-lrte_pmd_enic -Wl,-lrte_pmd_fm10k -Wl,-lrte_pmd_failsafe -Wl,-lrte_pmd_i40e -Wl,-lrte_pmd_ixgbe -Wl,-lrte_pmd_kni -Wl,-lrte_pmd_lio -Wl,-lrte_pmd_mlx5 -Wl,-libverbs -Wl,-lmlx5 -Wl,-lmnl -Wl,-lrte_pmd_nfp -Wl,-lrte_pmd_null -Wl,-lrte_pmd_qede -Wl,-lrte_pmd_ring -Wl,-lrte_pmd_softnic -Wl,-lrte_pmd_sfc_efx -Wl,-lrte_pmd_tap -Wl,-lrte_pmd_thunderx_nicvf -Wl,-lrte_pmd_vdev_netvsc -Wl,-lrte_pmd_virtio -Wl,-lrte_pmd_vhost -Wl,-lrte_pmd_ifc -Wl,-lrte_pmd_vmxnet3_uio -Wl,-lrte_bus_vmbus -Wl,-lrte_pmd_netvsc -Wl,-lrte_pmd_bbdev_null -Wl,-lrte_pmd_null_crypto -Wl,-lrte_pmd_octeontx_crypto -Wl,-lrte_pmd_crypto_scheduler -Wl,-lrte_pmd_dpaa2_sec -Wl,-lrte_pmd_dpaa_sec -Wl,-lrte_pmd_caam_jr -Wl,-lrte_pmd_virtio_crypto -Wl,-lrte_pmd_octeontx_zip -Wl,-lrte_pmd_qat -Wl,-lrte_pmd_skeleton_event -Wl,-lrte_pmd_sw_event -Wl,-lrte_pmd_dsw_event -Wl,-lrte_pmd_octeontx_ssovf -Wl,-lrte_pmd_dpaa_event -Wl,-lrte_pmd_dpaa2_event -Wl,-lrte_mempool_octeontx -Wl,-lrte_pmd_octeontx -Wl,-lrte_pmd_opdl_event -Wl,-lrte_pmd_skeleton_rawdev -Wl,-lrte_pmd_dpaa2_cmdif -Wl,-lrte_pmd_dpaa2_qdma -Wl,-lrte_bus_ifpga -Wl,-lrte_pmd_ifpga_rawdev -Wl,--no-whole-archive -Wl,-lrt -Wl,-lm -Wl,-lnuma -Wl,-ldl -Wl,-export-dynamic -Wl,-export-dynamic -L/home/cxx/dpdk-18.11/examples/l2fwd/build/lib -L/home/cxx/dpdk-18.11/x86_64-native-linuxapp-gcc/lib -Wl,--as-needed -Wl,-Map=l2fwd.map -Wl,--cref && echo "cmd_l2fwd = gcc -o l2fwd -m64 -pthread -march=native -DRTE_MACHINE_CPUFLAG_SSE -DRTE_MACHINE_CPUFLAG_SSE2 -DRTE_MACHINE_CPUFLAG_SSE3 -DRTE_MACHINE_CPUFLAG_SSSE3 -DRTE_MACHINE_CPUFLAG_SSE4_1 -DRTE_MACHINE_CPUFLAG_SSE4_2 -DRTE_MACHINE_CPUFLAG_AES -DRTE_MACHINE_CPUFLAG_PCLMULQDQ -DRTE_MACHINE_CPUFLAG_AVX -DRTE_MACHINE_CPUFLAG_RDRAND -DRTE_MACHINE_CPUFLAG_FSGSBASE -DRTE_MACHINE_CPUFLAG_F16C -DRTE_MACHINE_CPUFLAG_AVX2 -I/home/cxx/dpdk-18.11/examples/l2fwd/build/include -I/home/cxx/dpdk-18.11/x86_64-native-linuxapp-gcc/include -include /home/cxx/dpdk-18.11/x86_64-native-linuxapp-gcc/include/rte_config.h -D_GNU_SOURCE -O3 -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wold-style-definition -Wpointer-arith -Wcast-align -Wnested-externs -Wcast-qual -Wformat-nonliteral -Wformat-security -Wundef -Wwrite-strings -Wdeprecated -Wno-address-of-packed-member main.o -L/home/cxx/dpdk-18.11/x86_64-native-linuxapp-gcc/lib -Wl,-lrte_flow_classify -Wl,--whole-archive -Wl,-lrte_pipeline -Wl,--no-whole-archive -Wl,--whole-archive -Wl,-lrte_table -Wl,--no-whole-archive -Wl,--whole-archive -Wl,-lrte_port -Wl,--no-whole-archive -Wl,-lrte_pdump -Wl,-lrte_distributor -Wl,-lrte_ip_frag -Wl,-lrte_meter -Wl,-lrte_lpm -Wl,--whole-archive -Wl,-lrte_acl -Wl,--no-whole-archive -Wl,-lrte_jobstats -Wl,-lrte_metrics -Wl,-lrte_bitratestats -Wl,-lrte_latencystats -Wl,-lrte_power -Wl,-lrte_efd -Wl,-lrte_bpf -Wl,--whole-archive -Wl,-lrte_cfgfile -Wl,-lrte_gro -Wl,-lrte_gso -Wl,-lrte_hash -Wl,-lrte_member -Wl,-lrte_vhost -Wl,-lrte_kvargs -Wl,-lrte_mbuf -Wl,-lrte_net -Wl,-lrte_ethdev -Wl,-lrte_bbdev -Wl,-lrte_cryptodev -Wl,-lrte_security -Wl,-lrte_compressdev -Wl,-lrte_eventdev -Wl,-lrte_rawdev -Wl,-lrte_timer -Wl,-lrte_mempool -Wl,-lrte_mempool_ring -Wl,-lrte_ring -Wl,-lrte_pci -Wl,-lrte_eal -Wl,-lrte_cmdline -Wl,-lrte_reorder -Wl,-lrte_sched -Wl,-lrte_kni -Wl,-lrte_common_cpt -Wl,-lrte_common_octeontx -Wl,-lrte_common_dpaax -Wl,-lrte_bus_pci -Wl,-lrte_bus_vdev -Wl,-lrte_bus_dpaa -Wl,-lrte_bus_fslmc -Wl,-lrte_mempool_bucket -Wl,-lrte_mempool_stack -Wl,-lrte_mempool_dpaa -Wl,-lrte_mempool_dpaa2 -Wl,-lrte_pmd_af_packet -Wl,-lrte_pmd_ark -Wl,-lrte_pmd_atlantic -Wl,-lrte_pmd_avf -Wl,-lrte_pmd_avp -Wl,-lrte_pmd_axgbe -Wl,-lrte_pmd_bnxt -Wl,-lrte_pmd_bond -Wl,-lrte_pmd_cxgbe -Wl,-lrte_pmd_dpaa -Wl,-lrte_pmd_dpaa2 -Wl,-lrte_pmd_e1000 -Wl,-lrte_pmd_ena -Wl,-lrte_pmd_enetc -Wl,-lrte_pmd_enic -Wl,-lrte_pmd_fm10k -Wl,-lrte_pmd_failsafe -Wl,-lrte_pmd_i40e -Wl,-lrte_pmd_ixgbe -Wl,-lrte_pmd_kni -Wl,-lrte_pmd_lio -Wl,-lrte_pmd_mlx5 -Wl,-libverbs -Wl,-lmlx5 -Wl,-lmnl -Wl,-lrte_pmd_nfp -Wl,-lrte_pmd_null -Wl,-lrte_pmd_qede -Wl,-lrte_pmd_ring -Wl,-lrte_pmd_softnic -Wl,-lrte_pmd_sfc_efx -Wl,-lrte_pmd_tap -Wl,-lrte_pmd_thunderx_nicvf -Wl,-lrte_pmd_vdev_netvsc -Wl,-lrte_pmd_virtio -Wl,-lrte_pmd_vhost -Wl,-lrte_pmd_ifc -Wl,-lrte_pmd_vmxnet3_uio -Wl,-lrte_bus_vmbus -Wl,-lrte_pmd_netvsc -Wl,-lrte_pmd_bbdev_null -Wl,-lrte_pmd_null_crypto -Wl,-lrte_pmd_octeontx_crypto -Wl,-lrte_pmd_crypto_scheduler -Wl,-lrte_pmd_dpaa2_sec -Wl,-lrte_pmd_dpaa_sec -Wl,-lrte_pmd_caam_jr -Wl,-lrte_pmd_virtio_crypto -Wl,-lrte_pmd_octeontx_zip -Wl,-lrte_pmd_qat -Wl,-lrte_pmd_skeleton_event -Wl,-lrte_pmd_sw_event -Wl,-lrte_pmd_dsw_event -Wl,-lrte_pmd_octeontx_ssovf -Wl,-lrte_pmd_dpaa_event -Wl,-lrte_pmd_dpaa2_event -Wl,-lrte_mempool_octeontx -Wl,-lrte_pmd_octeontx -Wl,-lrte_pmd_opdl_event -Wl,-lrte_pmd_skeleton_rawdev -Wl,-lrte_pmd_dpaa2_cmdif -Wl,-lrte_pmd_dpaa2_qdma -Wl,-lrte_bus_ifpga -Wl,-lrte_pmd_ifpga_rawdev -Wl,--no-whole-archive -Wl,-lrt -Wl,-lm -Wl,-lnuma -Wl,-ldl -Wl,-export-dynamic -Wl,-export-dynamic -L/home/cxx/dpdk-18.11/examples/l2fwd/build/lib -L/home/cxx/dpdk-18.11/x86_64-native-linuxapp-gcc/lib -Wl,--as-needed -Wl,-Map=l2fwd.map -Wl,--cref " > ./.l2fwd.cmd
touch _postbuild
echo " INSTALL-APP l2fwd"
[ -d /home/cxx/dpdk-18.11/examples/l2fwd/build/app ] || mkdir -p /home/cxx/dpdk-18.11/examples/l2fwd/build/app
cp -f l2fwd /home/cxx/dpdk-18.11/examples/l2fwd/build/app
echo " INSTALL-MAP l2fwd.map"
[ -d /home/cxx/dpdk-18.11/examples/l2fwd/build/app ] || mkdir -p /home/cxx/dpdk-18.11/examples/l2fwd/build/app
cp -f l2fwd.map /home/cxx/dpdk-18.11/examples/l2fwd/build/app
touch _install
true
touch _postinstall
The issue with application r2p2-echo
Makefile flags, as it only include DPDK headers via -I$(RTE_SDK)/x86_64-native-linuxapp-gcc/include
. Based on the logs DPDK is been built Mellanox PMD drivers which have an inherent dependency on libverbs to provide the definition for mlx5_glue_*
.
Following are the ways to fix the issue
CONFIG_RTE_LIBRTE_MLX5_PMD=n
in rte_config
. Then rebuild the application.pkg-config
one can fetch the appropriate CFLAGS and LDFLAGS.Solution with pkg-config:
CFLAGS update:
CFLAGS += -g -O3 -I$(ROOTDIR)/netstack/inc -I$(R2P2LIB_DIR)/inc $(pkg-config --cflags --static libdpdk) -I$(RAFT_DIR)/include -DNO_BATCH #-DACCELERATED #-DRAFT_STATS
and
for LDFLAGS
r2p2-echo: cleanstate r2p2-echo.o $(OBJS_C)
$(CC) -o $@ r2p2-echo.o $(OBJS_C) $(LDFLAGS) $(pkg-config --static --libs libdpdk)
Solution for DPDK version less than 19.11 LTS:
make static -n or make -n
for example/l2fwd
.[EDIT-1] makefile modification
diff --git a/dpdk-apps/Makefile b/dpdk-apps/Makefile
index 3da318d..40a1e2f 100644
--- a/dpdk-apps/Makefile
+++ b/dpdk-apps/Makefile
@@ -31,7 +31,14 @@ include $(R2P2LIB_DIR)/dir.mk
CC=gcc
-CFLAGS += -g -O3 -I$(ROOTDIR)/netstack/inc -I$(R2P2LIB_DIR)/inc -I$(RTE_SDK)/x86_64-native-linuxapp-gcc/include -I$(RAFT_DIR)/include -DNO_BATCH #-DACCELERATED #-DRAFT_STATS
+CFLAGS += -g -O3 -I$(ROOTDIR)/netstack/inc -I$(R2P2LIB_DIR)/inc -I$(RAFT_DIR)/include -DNO_BATCH #-DACCELERATED #-DRAFT_STATS
+
+DPDK_VERSION:=$(shell pkg-config --modversion libdpdk)
+ifneq ("$(DPDK_VERSION)", "")
+ CFLAGS += ${shell pkg-config --cflags --static libdpdk}
+else
+ CFLAGS += -I$(RTE_SDK)/x86_64-native-linuxapp-gcc/include
+endif
ifeq ($(WITH_RAFT), 1)
CFLAGS += -DWITH_RAFT
@@ -72,7 +79,13 @@ WERROR_FLAGS += -Wformat-nonliteral -Wformat-security
WERROR_FLAGS += -Wundef -Wwrite-strings
CFLAGS += $(WERROR_FLAGS) -mavx2
-LDFLAGS= -Wl,--whole-archive -Wl,-ldpdk -Wl,--no-whole-archive -lrt -lpthread -lm -ldl -L$(RTE_SDK)/x86_64-native-linuxapp-gcc/lib -lconfig -lnuma -lgcov --coverage -lpcap
+
+ifneq ("$(DPDK_VERSION)", "")
+ LDFLAGS += ${shell pkg-config --libs --static libdpdk}
+else
+ LDFLAGS= -Wl,--whole-archive -Wl,-ldpdk -Wl,--no-whole-archive -lrt -lpthread -lm -ldl -L$(RTE_SDK)/x86_64-native-linuxapp-gcc/lib -lconfig -lnuma -lgcov --coverage -lpcap
+endif
+LDFLAGS += -lconfig -lgcov --coverage -lpcap
SRCS_C := $(addprefix $(ROOTDIR)/netstack/dp/, $(DP_SRC)) $(addprefix $(ROOTDIR)/netstack/net/, $(NET_SRC)) $(addprefix $(R2P2LIB_DIR)/, $(R2P2_SRC_C))
OBJS_C := $(patsubst %.c, %.o, $(SRCS_C))
Note: there are errors which are associated to DPDK and Linux header versions which needs updating too for the project .