From: Ankit Kumar <ankit.kumar@samsung.com>
To: axboe@kernel.dk
Cc: fio@vger.kernel.org, krish.reddy@samsung.com,
joshi.k@samsung.com, anuj20.g@samsung.com,
Ankit Kumar <ankit.kumar@samsung.com>
Subject: [PATCH 1/7] configure: check if uring_cmd support is present
Date: Mon, 23 May 2022 18:40:33 +0530 [thread overview]
Message-ID: <20220523131039.17697-2-ankit.kumar@samsung.com> (raw)
In-Reply-To: <20220523131039.17697-1-ankit.kumar@samsung.com>
The new ioengine io_uring_cmd can be used to send uring passthrough
commands. Check if we have the infrastructure to support it.
To submit nvme passthrough commands, FIO will require libnvme.
This will generate two config flags:
- CONFIG_URING_CMD
- CONFIG_LIBNVME
CONFIG_URING_CMD is a prerequisite for libnvme
Signed-off-by: Ankit Kumar <ankit.kumar@samsung.com>
---
Makefile | 4 ++++
configure | 45 +++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 49 insertions(+)
diff --git a/Makefile b/Makefile
index ed66305a..08f0d6fa 100644
--- a/Makefile
+++ b/Makefile
@@ -235,6 +235,10 @@ ifeq ($(CONFIG_TARGET_OS), Linux)
cmdprio_SRCS = engines/cmdprio.c
ifdef CONFIG_HAS_BLKZONED
SOURCE += oslib/linux-blkzoned.c
+endif
+ifdef CONFIG_LIBNVME
+ LIBS += $(LIBNVME_LIBS)
+ CFLAGS += $(LIBNVME_CFLAGS)
endif
LIBS += -lpthread -ldl
LDFLAGS += -rdynamic
diff --git a/configure b/configure
index 95b60bb7..a09364f4 100755
--- a/configure
+++ b/configure
@@ -2561,6 +2561,46 @@ fi
print_config "Zoned block device capacity" "$rep_capacity"
fi
+##########################################
+# Check IORING_OP_URING_CMD
+cat > $TMPC << EOF
+#include <linux/io_uring.h>
+int main(int argc, char **argv)
+{
+ return IORING_OP_URING_CMD;
+}
+EOF
+if compile_prog "" "" "uring cmd"; then
+ output_sym "CONFIG_URING_CMD"
+ uring_cmd="yes"
+else
+ uring_cmd="no"
+fi
+print_config "uring_cmd" "$uring_cmd"
+
+##########################################
+# Check if we have libnvme support
+# uring_cmd is a prerequisite
+# For sending nvme passthrough commands we need the opcodes
+# and nvme_uring_cmd structure introduced in 5.19 kernel
+if test "$uring_cmd" = "yes"; then
+ cat > $TMPC << EOF
+#include <nvme/ioctl.h>
+int main(int argc, char **argv)
+{
+ return NVME_URING_CMD_IO;
+}
+EOF
+ if compile_prog "" "-lnvme" "libnvme"; then
+ libnvme="yes"
+ libnvme_cflags=$(pkg-config --cflags libnvme)
+ libnvme_libs=$(pkg-config --libs libnvme)
+ else
+ libnvme="no"
+ fi
+fi
+print_config "libnvme" "$libnvme"
+
##########################################
# libzbc probe
cat > $TMPC << EOF
@@ -3212,6 +3252,11 @@ if test "$xnvme" = "yes" ; then
echo "LIBXNVME_CFLAGS=$xnvme_cflags" >> $config_host_mak
echo "LIBXNVME_LIBS=$xnvme_libs" >> $config_host_mak
fi
+if test "$libnvme" = "yes" ; then
+ output_sym "CONFIG_LIBNVME"
+ echo "LIBNVME_CFLAGS=$libnvme_cflags" >> $config_host_mak
+ echo "LIBNVME_LIBS=$libnvme_libs" >> $config_host_mak
+fi
if test "$dynamic_engines" = "yes" ; then
output_sym "CONFIG_DYNAMIC_ENGINES"
fi
--
2.17.1
next prev parent reply other threads:[~2022-05-23 16:28 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20220523131607epcas5p3dbb26f3b6f62fc8bcbe219304d60a7d1@epcas5p3.samsung.com>
2022-05-23 13:10 ` [PATCH 0/7] add support for uring passthrough commands Ankit Kumar
2022-05-23 13:10 ` Ankit Kumar [this message]
2022-05-23 13:10 ` [PATCH 2/7] io_uring.h: add IORING_SETUP_SQE128 and IORING_SETUP_CQE32 Ankit Kumar
2022-05-23 13:10 ` [PATCH 3/7] engines/io_uring: add new I/O engine for uring passthrough support Ankit Kumar
2022-05-23 16:44 ` Jens Axboe
2022-05-23 18:20 ` Ankit Kumar
2022-05-23 13:10 ` [PATCH 4/7] docs: document options for io_uring_cmd I/O engine Ankit Kumar
2022-05-23 13:10 ` [PATCH 5/7] zbd: Check for direct flag only if its block device Ankit Kumar
2022-05-25 10:07 ` Shinichiro Kawasaki
2022-05-25 10:46 ` Ankit Kumar
2022-05-23 13:10 ` [PATCH 6/7] engines/io_uring: Enable zone device support for io_uring_cmd I/O engine Ankit Kumar
2022-05-23 13:10 ` [PATCH 7/7] examples: add 2 example job file for io_uring_cmd engine Ankit Kumar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220523131039.17697-2-ankit.kumar@samsung.com \
--to=ankit.kumar@samsung.com \
--cc=anuj20.g@samsung.com \
--cc=axboe@kernel.dk \
--cc=fio@vger.kernel.org \
--cc=joshi.k@samsung.com \
--cc=krish.reddy@samsung.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox