Commit 97022803 authored by Jim Harris's avatar Jim Harris
Browse files

reduce: add configure option



--with-reduce required to build reduce.  This depends on
libpmem being installed.

We still need to work out details in pkgdep.sh and
vm_setup.sh.  Some distributions like Ubuntu still
require configuring extra package repositories to
get libpmem packages.

Signed-off-by: default avatarJim Harris <james.r.harris@intel.com>
Change-Id: I4e056ce1da9a1fecb4458f8f5e7ff5d61c422533

Reviewed-on: https://review.gerrithub.io/430646


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
parent f28f8133
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -96,6 +96,9 @@ CONFIG_VIRTIO=y
CONFIG_PMDK=n
CONFIG_PMDK_DIR=

# Build with "reduce" (SPDK block compression)
CONFIG_REDUCE=n

# Build with VPP
CONFIG_VPP=n
CONFIG_VPP_DIR=
+16 −0
Original line number Diff line number Diff line
@@ -48,6 +48,8 @@ function usage()
	echo "                           No path required."
	echo " pmdk                      Required to build persistent memory bdev."
	echo "                           example: /usr/share/pmdk"
	echo " reduce                    Required to build \"reduce\" (SPDK block compression)."
	echo "                           No path required."
	echo " vpp                       Required to build VPP net module."
	echo "                           example: /vpp_repo/build-root/install-vpp-native/vpp"
	echo " rbd                       [disabled]"
@@ -220,6 +222,12 @@ for i in "$@"; do
		--without-pmdk)
			CONFIG[PMDK]=n
			;;
		--with-reduce)
			CONFIG[REDUCE]=y
			;;
		--without-reduce)
			CONFIG[REDUCE]=n
			;;
		--with-vpp)
			CONFIG[VPP]=y
			;;
@@ -367,6 +375,14 @@ if [[ "${CONFIG[CRYPTO]}" = "y" ]]; then
	fi
fi

if [[ "${CONFIG[REDUCE]}" = "y" ]]; then
	if [ ! -f /usr/include/libpmem.h ]; then
		echo --with-reduce requires libpmem.
		echo Please install then re-run this script.
		exit 1
	fi
fi

# We are now ready to generate final configuration. But first do sanity
# check to see if all keys in CONFIG array have its reflection in CONFIG file.
if [ $(egrep -c "^\s*CONFIG_[[:alnum:]_]+=" CONFIG) -ne ${#CONFIG[@]} ]; then
+3 −1
Original line number Diff line number Diff line
@@ -36,13 +36,15 @@ include $(SPDK_ROOT_DIR)/mk/spdk.common.mk

DIRS-y += bdev blob blobfs conf copy event json jsonrpc \
          log lvol net rpc sock thread trace util nvme nvmf scsi ioat \
	  ut_mock iscsi reduce
	  ut_mock iscsi
ifeq ($(OS),Linux)
DIRS-y += nbd
DIRS-$(CONFIG_VHOST) += vhost
DIRS-$(CONFIG_VIRTIO) += virtio
endif

DIRS-$(CONFIG_REDUCE) += reduce

# If CONFIG_ENV is pointing at a directory in lib, build it.
# Out-of-tree env implementations must be built separately by the user.
ENV_NAME := $(notdir $(CONFIG_ENV))
+2 −0
Original line number Diff line number Diff line
@@ -37,6 +37,8 @@
#include "spdk/string.h"
#include "spdk_internal/log.h"

#include "libpmem.h"

/* Always round up the size of the PM region to the nearest cacheline. */
#define REDUCE_PM_SIZE_ALIGNMENT	64

+1 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ SPDK_TEST_EVENT=1
SPDK_TEST_BLOBFS=0
SPDK_TEST_PMDK=0
SPDK_TEST_LVOL=0
SPDK_TEST_REDUCE=0
SPDK_RUN_ASAN=1
SPDK_RUN_UBSAN=1
# Reduce the size of the hugepages
Loading