[PATCH 1/7] configure: check if uring_cmd support is present

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxx>
---
 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




[Index of Archives]     [Linux Kernel]     [Linux SCSI]     [Linux IDE]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux