Commit Graph

20 Commits

Author SHA1 Message Date
Kefu Chai
a56efc1610
Merge pull request #31841 from rosinL/wip-support-dpdk-numa
cmake: Add dpdk numa support

Reviewed-by: Kefu Chai <kchai@redhat.com>
2019-12-02 16:45:11 +08:00
luo rixin
32f967b420 cmake: Add shared library as dpdk dependency
librte_eal.a refers to libpthread.so and libdl.so, and libceph-common.so
refers to librte_eal.a. Many test application link libceph-common.so
without linking pthread, it will cause link error.
Such as unittest_interval_set, target_link_libraries (unittest_interval_set
ceph-common)

Signed-off-by: Chunsong Feng <fengchunsong@huawei.com>
2019-11-28 20:18:09 +08:00
Chunsong Feng
4f3606f87b cmake: Add dpdk numa support
Find and link the numa library for DPDK.

Fixes: https://tracker.ceph.com/issues/42275

Signed-off-by: Hu Ye <yehu5@huawei.com>
Signed-off-by: Chunsong Feng <fengchunsong@huawei.com>
2019-11-28 20:15:39 +08:00
Deepika Upadhyay
abf3dc0cf9 cmake/modules: look for GNU make first instead of BSD make
* BuildDPDK.cmake, BuildSPDK.cmake:
      * give priority to build with gmake
      * throw error if make not found

Signed-off-by: Deepika Upadhyay <dupadhya@redhat.com>
2019-11-25 13:16:04 +05:30
Yingxin Cheng
bf958abc0f crimson: build seastar dpdk from src/seastar/dpdk
src/spdk/dpdk and src/seastar/dpdk are both at their private branches
with project-specific modifications, so select proper dpdk source
directory according to flags WITH_SPDK and Seastar_DPDK.

Signed-off-by: Yingxin Cheng <yingxin.cheng@intel.com>
2019-11-13 15:53:43 +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
d82ea5d738 cmake: refactor BuildDPDK
* extract `do_export_dpdk()` into a separated function
* no need to check for `dpdk-ext` target before calling `build_dpdk()`,
  as the name of this target should be hidden from the caller of this
  function.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-10-24 15:15:51 +08:00
Kefu Chai
423c28fb8d cmake: update built libs of SPDK and DPDK
we need to link against these new libs for fulfilling the dependencies
required by new SPDK.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-06-13 19:35:26 +08:00
Kefu Chai
b848bce504 cmake/modules/BuildDPDK.cmake: update to adapt upstream changes
* update execenv to remove "app", the targets ending with "app" changed
  to the ones without "app" now.
* pass CC by make variables not env variables, otherwise the default
  `cc` is used

Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-06-12 15:43:05 +08:00
Kefu Chai
a0c6fb9d40 cmake: do not assume ${CMAKE_GENERATOR} == make
* modules/BuildDPDK.cmake: always use "make"
* modules/BuildSPDK.cmake: always use "make"
  DPDK only support "make". if user wants to use other generator than
  "make", we will fail to build DPDK support. so we should always use
  "make" here. and before using "make", we need to detect it.
* cmake/modules/BuildRocksDB.cmake: use cmake for build
* src/compressor/zstd/CMakeLists.txt: use cmake for build
  just use whatever generator use specifies, and use ${CMAKE_COMMAND}
  for building the specified target, no need to repeat
  ${CMAKE_GENERATOR} for building the target.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-03-21 15:45:07 +08:00
Kefu Chai
ef305c178a cmake: update dpdk drivers/modules to accomodate dpdk submodule
Signed-off-by: Kefu Chai <kchai@redhat.com>
2018-10-26 21:49:03 +08:00
Brad Hubbard
2b188a2aed cmake/modules/BuildDPDK.cmake: Build required DPDK libraries
Make sure the mbuf and ethdev libraries are created as they export
required symbols.

Fixes: http://tracker.ceph.com/issues/36341

Signed-off-by: Brad Hubbard <bhubbard@redhat.com>
2018-10-10 14:29:10 +10:00
Kefu Chai
2c823a18cb cmake: pass DPDK_DIR explicitly
so we don't rely on build_dpdk() to be a macro to set variables in
its parent scope.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2018-09-05 17:33:59 +08:00
Kefu Chai
1a6877dc04 cmake/modules/BuildDPDK.cmake: link whole-archive
we build dpdk as static library, linking against them without specifying
--whole-archive will get the constructor symbols droppped by the linker
as they are not referenced directly by the excecutable. so we need to do
so to make sure we call all the constructors.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2018-09-05 15:40:30 +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
Kefu Chai
19230378c8 cmake: specify missing settings for dpdk
* after upgrading to gcc-8, seems dpdk requires more settings to compile.
  in which, CONFIG_RTE_MAX_VFIO_GROUPS=64 is copied from config/common_base.
* librte_bus_pci.a depends on librte_pci.a, so reorder the libraries
  in DPDK_LIBRARIES.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2018-05-06 15:26:14 +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
9b3f9cd253 cmake: BuildDPDK: use ${CMAKE_MAKE_PROGRAM} when appropriate
DPDK requires GNU Make. see
spdk/dpdk/doc/guides/freebsd_gsg/build_dpdk.rst. so, we should use the
configured make program to do the job.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2017-11-21 17:47:17 +08:00
Kefu Chai
9964ac9251 cmake: BuildDPDK: do not build kernel modules
see also http://pkgs.fedoraproject.org/cgit/rpms/dpdk.git/tree/dpdk.spec

Signed-off-by: Kefu Chai <kchai@redhat.com>
2017-11-18 10:44:56 +08:00
Kefu Chai
01a9f17825 cmake: build spdk/dpdk in cmake modules
Signed-off-by: Kefu Chai <kchai@redhat.com>
Signed-off-by: wanjun.lp <wanjun.lp@alibaba-inc.com>
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
2017-11-17 15:37:53 +08:00