Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DAOS-17207 build: Update spdk to v24.09 #63

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "spdk"]
path = src
url = https://github.com/spdk/spdk.git
78 changes: 78 additions & 0 deletions 0000RWF_NOWAIT.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
diff --git a/CONFIG b/CONFIG
index 89c34e90b..02ce04692 100644
--- a/CONFIG
+++ b/CONFIG
@@ -256,3 +256,6 @@ CONFIG_COPY_FILE_RANGE=n

# liblz4 is available
CONFIG_HAVE_LZ4=n
+
+# aio_rw_flags are enabled
+CONFIG_HAVE_AIO_RW_FLAGS=n
diff --git a/configure b/configure
index 26c9b0f4d..d8daedc37 100755
--- a/configure
+++ b/configure
@@ -860,6 +860,22 @@ if [[ $sys_name != "Linux" ]]; then
fi
fi

+if echo -e '#include <linux/fs.h>\n' \
+ '#include <libaio.h>\n' \
+ '#include <stddef.h>\n' \
+ '#ifndef RWF_NOWAIT\n' \
+ '#error "No RWF_NOWAIT is defined"\n' \
+ '#endif\n' \
+ 'int main(int argc, char **argv) {\n' \
+ 'return offsetof(struct iocb, aio_rw_flags);\n}\n' \
+ | "${BUILD_CMD[@]}" -c - ; then
+ echo HAVE_AIO_RW_FLAGS=YES
+ CONFIG[HAVE_AIO_RW_FLAGS]="y"
+else
+ echo HAVE_AIO_RW_FLAGS=NO
+ CONFIG[HAVE_AIO_RW_FLAGS]="n"
+fi
+
if [ "${CONFIG[RDMA]}" = "y" ]; then
if [[ ! "${CONFIG[RDMA_PROV]}" == "verbs" ]] && [[ ! "${CONFIG[RDMA_PROV]}" == "mlx5_dv" ]]; then
echo "Invalid RDMA provider specified, must be \"verbs\" or \"mlx5_dv\""
diff --git a/module/bdev/aio/bdev_aio.c b/module/bdev/aio/bdev_aio.c
index b51d6c83a..01914fb9d 100644
--- a/module/bdev/aio/bdev_aio.c
+++ b/module/bdev/aio/bdev_aio.c
@@ -64,7 +64,7 @@ struct file_disk {
struct spdk_bdev disk;
char *filename;
int fd;
-#ifdef RWF_NOWAIT
+#ifdef SPDK_CONFIG_HAVE_AIO_RW_FLAGS
bool use_nowait;
#endif
TAILQ_ENTRY(file_disk) link;
@@ -116,7 +116,7 @@ bdev_aio_open(struct file_disk *disk)
{
int fd;
int io_flag = disk->readonly ? O_RDONLY : O_RDWR;
-#ifdef RWF_NOWAIT
+#ifdef SPDK_CONFIG_HAVE_AIO_RW_FLAGS
struct stat st;
#endif

@@ -134,7 +134,7 @@ bdev_aio_open(struct file_disk *disk)

disk->fd = fd;

-#ifdef RWF_NOWAIT
+#ifdef SPDK_CONFIG_HAVE_AIO_RW_FLAGS
/* Some aio operations can block, for example if number outstanding
* I/O exceeds number of block layer tags. But not all files can
* support RWF_NOWAIT flag. So use RWF_NOWAIT on block devices only.
@@ -212,7 +212,7 @@ bdev_aio_submit_io(enum spdk_bdev_io_type type, struct file_disk *fdisk,
io_set_eventfd(iocb, aio_ch->group_ch->efd);
}
iocb->data = aio_task;
-#ifdef RWF_NOWAIT
+#ifdef SPDK_CONFIG_HAVE_AIO_RW_FLAGS
if (fdisk->use_nowait) {
iocb->aio_rw_flags = RWF_NOWAIT;
}
88 changes: 0 additions & 88 deletions 0001-setup.sh-Speed-up-the-VMD-device-unbind-by-running-i.patch

This file was deleted.

13 changes: 13 additions & 0 deletions 0001PythonPip.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/python/Makefile b/python/Makefile
index b45c42328..4a5fb474b 100644
--- a/python/Makefile
+++ b/python/Makefile
@@ -7,7 +7,7 @@
SPDK_ROOT_DIR := $(abspath $(CURDIR)/..)
include $(SPDK_ROOT_DIR)/mk/spdk.common.mk

-setup_cmd = pip install --prefix=$(CONFIG_PREFIX)
+setup_cmd = python3 -m pip install --prefix=$(CONFIG_PREFIX)
ifneq ($(DESTDIR),)
setup_cmd += --root $(DESTDIR)
endif
111 changes: 0 additions & 111 deletions 0002-configure-add-CONFIG_HAVE_ARC4RANDOM.patch

This file was deleted.

2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
//@Library(value="pipeline-lib@your_branch") _

/* groovylint-disable-next-line CompileStatic */
packageBuildingPipelineDAOSTest(['distros': ['el8', 'el9', 'leap15', 'ubuntu20.04'],
packageBuildingPipelineDAOSTest(['distros': ['el8', 'el9', 'leap15'],
'test-tag': 'pr'])
12 changes: 11 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# SPDX-License-Identifier: BSD-2-Clause-Patent
# Copyright (c) 2019-2024 Intel Corporation
# Copyright (c) 2025 Google LLC

NAME := spdk
SRC_EXT := gz
SOURCE = https://github.com/spdk/$(NAME)/archive/v$(VERSION).tar.$(SRC_EXT)
SOURCE = $(NAME)-$(VERSION).tar.$(SRC_EXT)

# this needs to be formalized into packaging/Makefile_packaging.mk
#GIT_COMMIT := 7232c450f97cf925a521a60ef2561eca4b65c41a
Expand All @@ -30,3 +31,12 @@ include packaging/Makefile_packaging.mk
# git diff $(VERSION)..$(GIT_COMMIT) \
# > ../$@
# git add $@

$(NAME)-$(VERSION).tar.gz: $(shell git ls-files src --recurse-submodules)
echo Creating $@
echo $(basename $@)
rm -f $@
cd src && ../archive.sh ../ $(NAME) $(VERSION) tar
gzip $(basename $@)

tarball: $(NAME)-$(VERSION).tar.tz
46 changes: 46 additions & 0 deletions archive.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/bin/bash
#
# Usage: archive.sh <dir> <name> <version> <extension>
#
# Create an archive of the HEAD commit of a local Git repository, including
# submodules.
#
# - Must run at the root of the Git repository.
# - Must have all submodules recursively initialized and updated.
# - Whitespaces are prohibited in any of the parameters.
#
# For example,
#
# archive.sh /a/b/c daos 1.2.3 tar
#
# produces /a/b/c/daos-1.2.3.tar.
#

set -e

dir=$1
name=$2
version=$3
ext=$4

# Use a temporary directory for all intermediate files.
unset tmp
trap 'if [ -n "${tmp}" ]; then rm -rf "${tmp}"; fi' EXIT
tmp=$(mktemp -d)

file_extless="${name}-${version}"
file="${file_extless}.${ext}"
sm_file_prefix="${file_extless}-submodule"

# Create an archive, which doesn't include any submodule.
git archive --prefix "${name}-${version}/" -o "${tmp}/${file}" HEAD

# Add all submodules to the archive.
# shellcheck disable=SC2086,SC2016
git submodule --quiet foreach --recursive \
'tarfile='${tmp}/${sm_file_prefix}'-$name.'${ext}' && \
git archive --prefix '${name}-${version}'/$displaypath/ -o ${tarfile} $sha1 && \
tar -Af '"${tmp}/${file}"' ${tarfile}'

# Publish the archive.
mv "${tmp}/${file}" "${dir}/${file}"
Loading