diff options
author | Mohammed Hawari <mohammed@hawari.fr> | 2020-11-20 18:37:14 +0100 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2020-12-07 14:08:22 +0000 |
commit | fe909a6288e028863233f521c33391191fb57f2f (patch) | |
tree | f74aadd31b8b149182a7acee0959aa13a2a29bc4 | |
parent | e061dad55e75ea5d5db20ceda28f557971dd9483 (diff) |
dpdk: support mlx drivers linked with rdma-core
Change-Id: I8b8e4420f7643df95c27f4a4764809e8ddd2d12e
Signed-off-by: Mohammed Hawari <mohammed@hawari.fr>
Type: improvement
-rw-r--r-- | build/external/packages/dpdk.mk | 16 | ||||
-rw-r--r-- | build/external/packages/ipsec-mb.mk | 1 | ||||
-rw-r--r-- | build/external/packages/rdma-core.mk | 12 | ||||
-rw-r--r-- | src/plugins/dpdk/CMakeLists.txt | 12 |
4 files changed, 31 insertions, 10 deletions
diff --git a/build/external/packages/dpdk.mk b/build/external/packages/dpdk.mk index cbaa0f4fc50..5b5f9eead59 100644 --- a/build/external/packages/dpdk.mk +++ b/build/external/packages/dpdk.mk @@ -20,6 +20,7 @@ DPDK_MLX5_COMMON_PMD ?= n DPDK_TAP_PMD ?= n DPDK_FAILSAFE_PMD ?= n DPDK_MACHINE ?= default +DPDK_MLX_IBV_LINK ?= static dpdk_version ?= 20.08 dpdk_base_url ?= http://fast.dpdk.org/rel @@ -28,7 +29,7 @@ dpdk_tarball_md5sum_20.08 := 64badd32cd6bc0761befc8f2402c2148 dpdk_tarball_md5sum := $(dpdk_tarball_md5sum_$(dpdk_version)) dpdk_url := $(dpdk_base_url)/$(dpdk_tarball) dpdk_tarball_strip_dirs := 1 - +dpdk_depends := rdma-core $(if $(ARCH_X86_64), ipsec-mb) # Debug or release DPDK_BUILD_TYPE:=release @@ -90,15 +91,23 @@ DPDK_LIBS_DISABLED := acl, \ rib, \ table +DPDK_MLX_CONFIG_FLAG := + # Adjust disabled pmd and libs depending on user provided variables ifeq ($(DPDK_MLX4_PMD), n) DPDK_DRIVERS_DISABLED += ,net/mlx4 +else + DPDK_MLX_CONFIG_FLAG := -Dibverbs_link=${DPDK_MLX_IBV_LINK} endif ifeq ($(DPDK_MLX5_PMD), n) DPDK_DRIVERS_DISABLED += ,net/mlx5 +else + DPDK_MLX_CONFIG_FLAG := -Dibverbs_link=${DPDK_MLX_IBV_LINK} endif ifeq ($(DPDK_MLX5_COMMON_PMD), n) DPDK_DRIVERS_DISABLED += ,common/mlx5 +else + DPDK_MLX_CONFIG_FLAG := -Dibverbs_link=${DPDK_MLX_IBV_LINK} endif ifeq ($(DPDK_TAP_PMD), n) DPDK_DRIVERS_DISABLED += ,net/tap @@ -148,7 +157,8 @@ DPDK_MESON_ARGS = \ "-Ddisable_libs=$(DPDK_LIBS_DISABLED)" \ -Db_pie=true \ -Dmachine=$(DPDK_MACHINE) \ - --buildtype=$(DPDK_BUILD_TYPE) + --buildtype=$(DPDK_BUILD_TYPE) \ + ${DPDK_MLX_CONFIG_FLAG} PIP_DOWNLOAD_DIR = $(CURDIR)/downloads/ @@ -160,7 +170,7 @@ define dpdk_config_cmds source ../dpdk-meson-venv/bin/activate && \ (if ! ls $(PIP_DOWNLOAD_DIR)meson* ; then pip3 download -d $(PIP_DOWNLOAD_DIR) -f $(DL_CACHE_DIR) meson==0.54 setuptools wheel; fi) && \ pip3 install --no-index --find-links=$(PIP_DOWNLOAD_DIR) meson==0.54 && \ - meson setup $(dpdk_src_dir) \ + PKG_CONFIG_PATH=$(dpdk_install_dir)/lib/pkgconfig meson setup $(dpdk_src_dir) \ $(dpdk_build_dir) \ $(DPDK_MESON_ARGS) \ | tee $(dpdk_config_log) && \ diff --git a/build/external/packages/ipsec-mb.mk b/build/external/packages/ipsec-mb.mk index fcbfa15ac33..bed25c3eda7 100644 --- a/build/external/packages/ipsec-mb.mk +++ b/build/external/packages/ipsec-mb.mk @@ -22,6 +22,7 @@ ipsec-mb_tarball_md5sum_0.55 := deca674bca7ae2282890e1fa7f953609 ipsec-mb_tarball_md5sum := $(ipsec-mb_tarball_md5sum_$(ipsec-mb_version)) ipsec-mb_tarball_strip_dirs := 1 ipsec-mb_url := http://github.com/01org/intel-ipsec-mb/archive/$(ipsec-mb_tarball) +ipsec-mb_depends := nasm define ipsec-mb_config_cmds @true diff --git a/build/external/packages/rdma-core.mk b/build/external/packages/rdma-core.mk index e7525202214..65c9c8aa65e 100644 --- a/build/external/packages/rdma-core.mk +++ b/build/external/packages/rdma-core.mk @@ -29,18 +29,21 @@ endif BUILD_FILES := include/ \ lib/statics/libibverbs.a \ lib/statics/libmlx5.a \ - util/librdma_util.a + lib/statics/libmlx4.a \ + lib/pkgconfig/ \ + util/librdma_util.a \ + ccan/libccan.a define rdma-core_config_cmds cd $(rdma-core_build_dir) && \ $(CMAKE) -G Ninja $(rdma-core_src_dir) \ - -DENABLE_STATIC=1 -DENABLE_RESOLVE_NEIGH=0 -DNO_PYVERBS=1 -DENABLE_VALGRIND=0 -DIN_PLACE=1 \ - -DCMAKE_BUILD_TYPE=$(RDMA_BUILD_TYPE) \ + -DENABLE_STATIC=1 -DENABLE_RESOLVE_NEIGH=0 -DNO_PYVERBS=1 -DENABLE_VALGRIND=0\ + -DCMAKE_BUILD_TYPE=$(RDMA_BUILD_TYPE) -DCMAKE_INSTALL_PREFIX=$(rdma-core_install_dir) \ -DCMAKE_C_FLAGS='-fPIC -fvisibility=hidden' > $(rdma-core_config_log) endef define rdma-core_build_cmds - $(CMAKE) --build $(rdma-core_build_dir) -- libibverbs.a librdma_util.a libmlx5.a > $(rdma-core_build_log) + $(CMAKE) --build $(rdma-core_build_dir) -- libccan.a libibverbs.a librdma_util.a libmlx5.a libmlx4.a > $(rdma-core_build_log) endef define rdma-core_install_cmds @@ -48,6 +51,7 @@ define rdma-core_install_cmds tar -C $(rdma-core_build_dir) -hc $(BUILD_FILES) | tar -C $(rdma-core_install_dir) -xv > $(rdma-core_install_log) find $(rdma-core_install_dir) -name '*.a' -exec mv -v {} $(rdma-core_install_dir)/lib \; >> $(rdma-core_install_log) rmdir -v $(rdma-core_install_dir)/util $(rdma-core_install_dir)/lib/statics >> $(rdma-core_install_log) + sed '/Libs.private:/ s/$$/ -lrdma_util -lccan/' -i $(rdma-core_install_dir)/lib/pkgconfig/libibverbs.pc endef $(eval $(call package,rdma-core)) diff --git a/src/plugins/dpdk/CMakeLists.txt b/src/plugins/dpdk/CMakeLists.txt index e662dc9a1db..1dd7507c0b0 100644 --- a/src/plugins/dpdk/CMakeLists.txt +++ b/src/plugins/dpdk/CMakeLists.txt @@ -86,12 +86,18 @@ list(APPEND DPDK_LINK_LIBRARIES ${NUMA_LIB}) # Mellanox libraries ############################################################################## if(DPDK_RTE_LIBRTE_MLX4_PMD OR DPDK_RTE_LIBRTE_MLX5_PMD) - vpp_plugin_find_library(dpdk MNL_LIB "mnl") - list(APPEND DPDK_LINK_LIBRARIES "${MNL_LIB}") if (DPDK_RTE_IBVERBS_LINK_DLOPEN) message(STATUS "DPDK depends on libmnl (Mellanox PMD requirement)") + vpp_plugin_find_library(dpdk MNL_LIB "mnl") + list(APPEND DPDK_LINK_LIBRARIES "${MNL_LIB}") else() - message(WARNING "unsupported DPDK configuration: DPDK Mellanox PMD requires RTE_IBVERBS_LINK_DLOPEN") + message(WARNING "EXPERIMENTAL: DPDK plugin without dlopen mode") + vpp_plugin_find_library(dpdk IBVERBS_LIB "libibverbs.a") + vpp_plugin_find_library(dpdk MLX5_LIB "libmlx5.a") + vpp_plugin_find_library(dpdk MLX4_LIB "libmlx4.a") + vpp_plugin_find_library(dpdk CCAN_LIB "libccan.a") + vpp_plugin_find_library(dpdk RDMA_UTIL_LIB "rdma_util") + string_append(DPDK_LINK_FLAGS "-Wl,--whole-archive,${IBVERBS_LIB},${MLX5_LIB},${MLX4_LIB},${CCAN_LIB},${RDMA_UTIL_LIB},--no-whole-archive") endif() endif() |