Skip to content

Commit

Permalink
cmake,rpm,deb: update to accommodate SPDK v17.10
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
tchaikov committed Nov 28, 2017
1 parent c05e842 commit 4b6925e
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 6 deletions.
1 change: 1 addition & 0 deletions ceph.spec.in
Expand Up @@ -132,6 +132,7 @@ BuildRequires: libcurl-devel
BuildRequires: libudev-devel
BuildRequires: libtool
BuildRequires: libxml2-devel
BuildRequires: libuuid-devel
BuildRequires: make
BuildRequires: parted
BuildRequires: perl
Expand Down
5 changes: 4 additions & 1 deletion cmake/modules/BuildDPDK.cmake
Expand Up @@ -85,7 +85,10 @@ macro(build_dpdk)
# create the directory so cmake won't complain when looking at the imported
# target
file(MAKE_DIRECTORY ${DPDK_INCLUDE_DIR})
foreach(c eal mempool mempool_ring mempool_stack ring)
foreach(c
pci bus_pci
eal
mempool mempool_ring mempool_stack ring)
add_library(dpdk::${c} STATIC IMPORTED)
add_dependencies(dpdk::${c} dpdk-ext)
set(dpdk_${c}_LIBRARY
Expand Down
11 changes: 7 additions & 4 deletions cmake/modules/BuildSPDK.cmake
Expand Up @@ -6,6 +6,7 @@ macro(build_spdk)
find_package(CUnit REQUIRED)
if(LINUX)
find_package(aio REQUIRED)
find_package(uuid REQUIRED)
endif()
include(ExternalProject)
ExternalProject_Add(spdk-ext
Expand All @@ -19,18 +20,20 @@ macro(build_spdk)
BUILD_IN_SOURCE 1
INSTALL_COMMAND "true")
ExternalProject_Get_Property(spdk-ext source_dir)
foreach(c nvme log env_dpdk util)
foreach(c nvme log lvol env_dpdk util)
add_library(spdk::${c} STATIC IMPORTED)
add_dependencies(spdk::${c} spdk-ext)
set_target_properties(spdk::${c} PROPERTIES
IMPORTED_LOCATION "${source_dir}/build/lib/${CMAKE_STATIC_LIBRARY_PREFIX}spdk_${c}${CMAKE_STATIC_LIBRARY_SUFFIX}"
INTERFACE_INCLUDE_DIRECTORIES "${source_dir}/include")
list(APPEND SPDK_LIBRARIES spdk::${c})
endforeach()
list(APPEND iface_libs ${DPDK_LIBRARIES} rt)
set_target_properties(spdk::env_dpdk PROPERTIES
INTERFACE_LINK_LIBRARIES "${iface_libs}")
INTERFACE_LINK_LIBRARIES "${DPDK_LIBRARIES};rt")
if(LINUX)
set_target_properties(spdk::lvol PROPERTIES
INTERFACE_LINK_LIBRARIES ${UUID_LIBRARIES})
endif()
set(SPDK_INCLUDE_DIR "${source_dir}/include")
unset(source_dir)
unset(iface_libs)
endmacro()
2 changes: 1 addition & 1 deletion cmake/modules/Finddpdk.cmake
Expand Up @@ -11,7 +11,7 @@ find_path(DPDK_INCLUDE_DIR rte_config.h
HINTS $ENV{DPDK_DIR}/include)

set(components
cmdline eal ethdev hash kvargs mbuf
pci bus_pci cmdline eal ethdev hash kvargs mbuf
mempool mempool_ring mempool_stack
pmd_bond pmd_vmxnet3_uio pmd_ixgbe pmd_i40e pmd_ring pmd_af_packet
ring)
Expand Down
20 changes: 20 additions & 0 deletions cmake/modules/Finduuid.cmake
@@ -0,0 +1,20 @@
# Try to find libuuid
# Once done, this will define
#
# UUID_FOUND - system has Profiler
# UUID_INCLUDE_DIR - the Profiler include directories
# UUID_LIBRARIES - link these to use Profiler

if(UUID_INCLUDE_DIR AND UUID_LIBRARIES)
set(UUID_FIND_QUIETLY TRUE)
endif()

find_path(UUID_INCLUDE_DIR NAMES uuid/uuid.h)
find_library(UUID_LIBRARIES NAMES uuid)
set(UUID_LIBRARIES ${LIBUUID})

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(uuid
DEFAULT_MSG UUID_LIBRARIES UUID_INCLUDE_DIR)

mark_as_advanced(UUID_LIBRARIES UUID_INCLUDE_DIR)
4 changes: 4 additions & 0 deletions cmake/modules/patch-dpdk-conf.sh
Expand Up @@ -34,6 +34,7 @@ setconf CONFIG_RTE_LIBRTE_PDUMP n
# no vm support
setconf CONFIG_RTE_LIBRTE_EAL_VMWARE_TSC_MAP_SUPPORT n
setconf CONFIG_RTE_LIBRTE_VHOST n
setconf CONFIG_RTE_LIBRTE_VHOST_NUMA n
setconf CONFIG_RTE_LIBRTE_VMXNET3_PMD n
setconf CONFIG_RTE_LIBRTE_PMD_VHOST n
setconf CONFIG_RTE_APP_EVENTDEV n
Expand All @@ -44,3 +45,6 @@ setconf CONFIG_RTE_TEST_PMD n

# async/dpdk does not like it
setconf CONFIG_RTE_MBUF_REFCNT_ATOMIC n

# balanced allocation of hugepages
setconf CONFIG_RTE_EAL_NUMA_AWARE_HUGEPAGES n
1 change: 1 addition & 0 deletions debian/control
Expand Up @@ -60,6 +60,7 @@ Build-Depends: bc,
python3-all-dev,
python3-setuptools,
socat,
uuid-dev
uuid-runtime,
valgrind,
virtualenv | python-virtualenv,
Expand Down

0 comments on commit 4b6925e

Please sign in to comment.