The common_async_dpdk library depends on the dpdk librte_eal file.
If the static library is used, the dependency is transferred to
libceph-common. By default, libceph-common uses the PUBLIC keyword,
the keyword PUBLIC determines that both the application and
libceph-common link to dpdk librte_eal.a. As a result, the global
variables in dpdk librte_eal.a has two copies. So link DPDK shared
libs to avoid DPDK initialization failure.
Fixes: https://tracker.ceph.com/issues/42861
Signed-off-by: Chunsong Feng <fengchunsong@huawei.com>
Signed-off-by: luorixin <luorixin@huawei.com>
set(dpdk_LIBRARIES) does not reset this variable, it leaves it
unchanged.
if pkg-config manages to find DPDK libraries, dpdk_LIBRARIES would be
set with a string like "rte_node;rte_graph;..." by
pkg_check_modules(dpdk QUIET libdpdk).
but we would want to set this variable to the import paths of the
required libraries. so reset it before appending them to this variable.
this change helps to address the build failure when building Ceph with
DPDK installed into system along with its .pc file.
Signed-off-by: Kefu Chai <kchai@redhat.com>
find_package(dpdk...) is used by seastar to find DPDK if Seastar_DPDK is
enabled. but `build_dpdk()` only exposes `dpdk::dpdk`, and it does not
set the variables like `dpdk_INCLUDE_DIRS` and `dpdk_LIBRARIES` when it
gets called. so we need to adapt Finddpdk to query them from `dpdk::dpdk`
target.
Signed-off-by: Kefu Chai <kchai@redhat.com>
dpdk_LIBRARIES should not be a list of dpdk library target, it should be
a list of paths to them. this also align with the definition of
`Finddpdk.cmake` in seastar project. so, if `Seastar_DPDK` is defined,
we should be able to offer the expected `dpdk_LIBRARIES` for seastar, as
our `Finddpdk.cmake` has higher priority than the one in seastar, and is
used when `find_package(dpdk...)` is called.
Signed-off-by: Kefu Chai <kchai@redhat.com>
* add Findcryptopp.cmake back
cryptopp support was dropped in #20015, but it's required by
src/msg/async/dpdk/TCP.h, which `#include <cryptopp/md5.h>`
so, to fix the FTBFS of WITH_DPDK=ON, we need to bring
Findcryptopp.cmake back. it was also removed in #20015.
* pass "-march=core2" when building sources which include dpdk headers.
i was wrong that the headers shipped by distro are generic.
the headers use the sse instructions for speedup memcpy, see
/usr/include/x86_64-linux-gnu/dpdk/rte_memcpy.h .
* also, we need to include the arch specific include directory
for building with dpdk.
Signed-off-by: Kefu Chai <kchai@redhat.com>
* add dpdk::dpdk if dpdk is built or found, as seastar checks for
it before adding its component libraries. if user installs libdpdk
and builds WITH_SEASTAR=ON or WITH_DPDK=ON, cmake fails to configure
the building system without this fix.
* add dpdk::cflags target for populating the -march=<arch> compile
option.
* also use pkg-config for finding dpdk.
* link common_async_dpdk against dpdk::dpdk instead
please note, the reason why we can remove the "-march=native" compile
option from Finddpdk.cmake, is that the distro shipped header files
are "generic" in the sense of "-march=<ARCH>", they do not enable
the arch specific intrinsic by default, hence the source files
including them do not need specific compiler options.
Signed-off-by: Kefu Chai <kchai@redhat.com>
-march=native causes gcc to use opcodes according to whichever CPU happens to
be installed in the build host, which can be different for every build. This
makes it impossible to achieve a reproducible build.
Also, if the build host has a very new CPU, running the resulting binaries on
older CPUs (of the same family, i.e. x86_64) could result in segmentation
fault.
References: http://tracker.ceph.com/issues/24948
Signed-off-by: Nathan Cutler <ncutler@suse.com>
* cmake/modules/BuildSPDK.cmake: add lvol
* cmake/modules/BuildDPDK.cmake: add pci and bus_pci
* ceph.spec.in, cmake/modules/BuildSPDK.cmake, debian/control:
re-introduce libuuid dependency, as 17.07 added lvol. and the latter
depends on uuid.
* cmake/modules/BuildSPDK.cmake: avoid introducing local variable of
`iface_libs`.
* cmake/modules/patch-dpdk-conf.sh: disable
CONFIG_RTE_EAL_NUMA_AWARE_HUGEPAGES, this option introduces the
balanced allocation of memory. but it also requires libnuma-dev.
let's disable it for now.
Signed-off-by: Kefu Chai <kchai@redhat.com>