Commit Graph

20 Commits

Author SHA1 Message Date
Clément Péron
96a8b4d846 cmake: dpdk: only append common dir if it has been found
Signed-off-by: Clément Péron <peron.clem@gmail.com>
2022-01-13 14:40:17 +01:00
Clément Péron
c37f15f54d cmake: dpdk: use STREQUAL and not EQUAL when comparing strings
Signed-off-by: Clément Péron <peron.clem@gmail.com>
2022-01-13 14:32:34 +01:00
Clément Péron
a24a4a0563 cmake: dpdk: fix typo in HINTS when looking for DPDK
Signed-off-by: Clément Péron <peron.clem@gmail.com>
2022-01-13 14:32:30 +01:00
Chunsong Feng
6fdb468b85 cmake: link DPDK shared libraries to avoid DPDK initialization failure
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>
2021-10-14 20:45:34 +08:00
Kefu Chai
edacb6eab4 cmake: prefer static library when finding DPDK
Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-07-31 16:29:28 +08:00
Kefu Chai
ee378a3405 cmake: initialize dpdk_LIBRARIES with empty list
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>
2021-07-31 15:53:03 +08:00
Yingxin Cheng
ab84158fc0 crimson: link required dpdk components for seastar
see https://github.com/scylladb/seastar/blob/
809b3ef875e7edb7c56643812dc8347ff9a82cee/cmake/Finddpdk.cmake#L60-L85

Signed-off-by: Yingxin Cheng <yingxin.cheng@intel.com>
2019-11-13 15:53:31 +08:00
Kefu Chai
a123c85256 cmake: enable Finddpdk to find DPDK to be built
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>
2019-10-24 17:54:05 +08:00
Kefu Chai
aa25f6202f cmake: define dpdk_LIBRARIES properly
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>
2019-10-24 15:15:51 +08:00
Kefu Chai
c976f580e7 cmake: fix the build WITH_DPDK=ON
* 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>
2018-09-05 13:53:57 +08:00
Kefu Chai
303e3c4a6c cmake: fix Finddpdk.cmake
* 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>
2018-08-17 15:16:22 +08:00
Nathan Cutler
18dc98e3f0 cmake: do not build DPDK with -march=native
-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>
2018-08-17 14:09:08 +08:00
Kefu Chai
be300380ce cmake: Finddpdk: add dpdk::${component} libs
Signed-off-by: Kefu Chai <kchai@redhat.com>
2018-07-22 09:55:23 +08:00
Kefu Chai
b3ceafe7d8 cmake,rpm,deb: update to accommodate SPDK v17.10
* 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>
2017-11-29 18:03:23 +08:00
Kefu Chai
e8add075ec cmake: add rte_mempool_{ring,stack} to Finddpdk.cmake
* also refactor it a little bit

Signed-off-by: Kefu Chai <kchai@redhat.com>
2017-11-18 10:44:56 +08:00
Ilsoo Byun
8134620ad4 os/bluestore: fix build errors when spdk is on
- remove pthread library link from dpdk cmake
- fix the bugs of NVMEDevice

Signed-off-by: Ilsoo Byun <ilsoo.byun@sk.com>
2017-07-05 01:42:10 -04:00
Pan Liu
2c2cae16cf dpdk: make compilation successful when use dpdk v16.11
Signed-off-by: Pan Liu <pan.liu@istuary.com>
2017-01-02 16:41:08 +08:00
Pan Liu
1ed6a37611 bluestore: fixed compilation error when enable spdk
Signed-off-by: Pan Liu <pan.liu@istuary.com>
2016-12-27 12:42:44 +08:00
Haomai Wang
eae7d5a645 msg/async: add dpdk stack plugin
Signed-off-by: Haomai Wang <haomai@xsky.com>
2016-11-09 11:39:20 +08:00
Kefu Chai
8c2bb7e5c6 cmake: add Find{dpdk,pciaccess}.cmake
to ready the SPDK support

Signed-off-by: Kefu Chai <kchai@redhat.com>
2016-02-04 14:03:21 +08:00