From 8165bf7125e87cc008ff3d991543cdaa9772de67 Mon Sep 17 00:00:00 2001 From: Ben Walker Date: Thu, 14 Feb 2019 12:07:42 -0700 Subject: [PATCH] build: Add support for linking to liburing liburing is a wrapper around a new Linux kernel interface for submitting I/O using user space rings. This patch simply adds the ability to link the nvme perf tool to liburing, but doesn't implement any of the new functionality yet. Change-Id: Idb741c87b6d951c013af86e30eac18d3834dd4b7 Signed-off-by: Ben Walker Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/444711 Tested-by: SPDK CI Jenkins Reviewed-by: Jim Harris Reviewed-by: Shuhei Matsumoto --- CONFIG | 6 ++++++ configure | 23 +++++++++++++++++++++++ examples/nvme/perf/Makefile | 10 ++++++++++ 3 files changed, 39 insertions(+) diff --git a/CONFIG b/CONFIG index cb3f41409..256a553fe 100644 --- a/CONFIG +++ b/CONFIG @@ -139,3 +139,9 @@ CONFIG_CUSTOMOCF=n # Build ISA-L library CONFIG_ISAL=y + +# Build with IO_URING support +CONFIG_URING=n + +# Path to custom built IO_URING library +CONFIG_URING_PATH= diff --git a/configure b/configure index 4911481ad..160f01229 100755 --- a/configure +++ b/configure @@ -77,6 +77,9 @@ function usage() echo " No path required." echo " ftl Required to build FTL module." echo " No path required." + echo " uring Required to support I/O uring on Linux. If no argument, searches" + echo " the standard installation directory. If an argument is provided, it is" + echo " considered a directory containing liburing.a and io_uring.h." echo "" echo "Environment variables:" echo "" @@ -314,6 +317,18 @@ for i in "$@"; do --without-isal) CONFIG[ISAL]=n ;; + --with-uring=*) + CONFIG[URING]=y + CONFIG[URING_PATH]=$(readlink -f ${i#*=}) + ;; + --with-uring) + CONFIG[URING]=y + CONFIG[URING_PATH]= + ;; + --without-uring) + CONFIG[URING]=n + CONFIG[URING_PATH]= + ;; --) break ;; @@ -491,6 +506,14 @@ elif [[ "${CONFIG[PGO_USE]}" = "y" ]]; then fi fi +if [[ "${CONFIG[URING]}" = "y" ]]; then + if [[ -n "${CONFIG[URING_PATH]}" ]]; then + if [ ! -d "${CONFIG[URING_PATH]}" ]; then + echo "${CONFIG[URING_PATH]}: directory not found" + exit 1 + fi + 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. diff --git a/examples/nvme/perf/Makefile b/examples/nvme/perf/Makefile index bfdd0de99..11e1ea5d3 100644 --- a/examples/nvme/perf/Makefile +++ b/examples/nvme/perf/Makefile @@ -41,6 +41,16 @@ SYS_LIBS += -laio CFLAGS += -DHAVE_LIBAIO endif +ifeq ($(CONFIG_URING),y) +SYS_LIBS += -luring +CFLAGS += -DHAVE_URING +ifeq ($(strip $(CONFIG_URING_PATH)),) +else +CFLAGS += -I$(CONFIG_URING_PATH) +LDFLAGS += -L$(CONFIG_URING_PATH) +endif +endif + install: $(APP) $(INSTALL_EXAMPLE)