Recent changes (master)
The following changes since commit 2c69e8e9b67c0e8967cb1b9e67a74ef55ef9d027:
test: run QEMU tests on push and pull request (2026-06-23 16:36:52 -0400)
are available in the Git repository at:
git://git.kernel.dk/fio.git master
for you to fetch changes up to d72bcf71534b5ac82359e3b987ff109b0de57af0:
t/io_uring_cmd: better default for fio executable (2026-06-24 13:25:19 -0400)
----------------------------------------------------------------
Jungwon Lee (2):
engines/io_uring: Separate NVMe-specific logic engines/io_uring: Add bsg support for io_uring_cmd engine
Kyoungrul Kim (1):
engines/sg: extract BE accessor helpers into shared sg.h
Vincent Fu (6):
Merge branch 'upstream-io_uring-bsg' of https://github.com/ljw8161/fio
engines/io_uring: add missing curly braces
t/io_uring_cmd: rename from t/nvmept.py
t/io_uring_cmd: support more cmd_types
t/io_uring_cmd: add a writefua/readfua test t/io_uring_cmd: better default for fio executable
HOWTO.rst | 2 +-
Makefile | 5 +-
configure | 17 ++
engines/bsg.c | 169 ++++++++++++++
engines/bsg.h | 67 ++++++
engines/io_uring.c | 468 ++++++++++++++++++++++++++-------------
engines/sg.c | 37 +---
engines/sg.h | 47 ++++
examples/uring-cmd-bsg.fio | 31 +++
examples/uring-cmd-bsg.png | Bin 0 -> 146241 bytes
fio.1 | 2 +-
t/{nvmept.py => io_uring_cmd.py} | 43 +++-
t/run-fio-tests.py | 2 +-
13 files changed, 682 insertions(+), 208 deletions(-)
create mode 100644 engines/bsg.c
create mode 100644 engines/bsg.h
create mode 100644 engines/sg.h
create mode 100644 examples/uring-cmd-bsg.fio
create mode 100644 examples/uring-cmd-bsg.png
rename t/{nvmept.py => io_uring_cmd.py} (90%)---
Diff of recent changes:
HOWTO.rst +1 -1
@@ -2564,7 +2564,7 @@ with the caveat that when used on the command line, they must come after the .. option:: cmd_type=str : [io_uring_cmd] Specifies the type of uring passthrough command to be used. Supported - value is nvme. Default is nvme. + values are nvme and bsg. Default is nvme. .. option:: hipri
Makefile +3 -2
@@ -218,7 +218,8 @@ ifdef CONFIG_LIBBLKIO endif ifeq ($(CONFIG_TARGET_OS), Linux) SOURCE += diskutil.c fifo.c blktrace.c cgroup.c trim.c engines/sg.c \ - oslib/linux-dev-lookup.c engines/io_uring.c engines/nvme.c + oslib/linux-dev-lookup.c engines/io_uring.c engines/nvme.c \ + engines/bsg.c cmdprio_SRCS = engines/cmdprio.c ifdef CONFIG_HAS_BLKZONED SOURCE += oslib/linux-blkzoned.c
@@ -229,7 +230,7 @@ endif ifeq ($(CONFIG_TARGET_OS), Android) SOURCE += diskutil.c fifo.c blktrace.c cgroup.c trim.c profiles/tiobench.c \ oslib/linux-dev-lookup.c engines/io_uring.c engines/nvme.c \ - engines/sg.c + engines/sg.c engines/bsg.c cmdprio_SRCS = engines/cmdprio.c ifdef CONFIG_HAS_BLKZONED SOURCE += oslib/linux-blkzoned.c
configure +17 -0
@@ -2707,6 +2707,23 @@ fi print_config "NVMe uring command support" "$nvme_uring_cmd" fi +########################################## +# Check BSG_URING_CMD support +cat > $TMPC << EOF +#include <linux/bsg.h> +int main(void) +{ + return sizeof(struct bsg_uring_cmd); +} +EOF +if compile_prog "" "" "bsg uring cmd"; then + output_sym "CONFIG_BSG_URING_CMD" + bsg_uring_cmd="yes" +else + bsg_uring_cmd="no" +fi +print_config "BSG uring command support" "$bsg_uring_cmd" + ########################################## # Check if we have xnvme if test "$xnvme" != "no" ; then
engines/bsg.c new file +169 -0
169 lines not on this page · raw message
engines/bsg.h new file +67 -0
67 lines not on this page · raw message
engines/io_uring.c +313 -155
669 lines not on this page · raw message
engines/sg.c +1 -36
@@ -57,6 +57,7 @@#include "../fio.h" #include "../optgroup.h" +#include "sg.h" #ifdef FIO_HAVE_SGIO
@@ -217,42 +218,6 @@ struct sgio_data {#endif }; -static inline uint16_t sgio_get_be16 (uint8_t *buf) -{ -return be16_to_cpu (*((uint16_t *) buf)); -} - -static inline uint32_t sgio_get_be32 (uint8_t *buf) -{ -return be32_to_cpu (*((uint32_t *) buf)); -} - -static inline uint64_t sgio_get_be64 (uint8_t *buf) -{ -return be64_to_cpu (*((uint64_t *) buf)); -} - -static inline void sgio_set_be16 (uint16_t val,uint8_t *buf) -{ -uint16_t t =cpu_to_be16 (val); - -memcpy (buf, &t,sizeof (uint16_t )); -} - -static inline void sgio_set_be32 (uint32_t val,uint8_t *buf) -{ -uint32_t t =cpu_to_be32 (val); - -memcpy (buf, &t,sizeof (uint32_t )); -} - -static inline void sgio_set_be64 (uint64_t val,uint8_t *buf) -{ -uint64_t t =cpu_to_be64 (val); - -memcpy (buf, &t,sizeof (uint64_t )); -} -static inline bool sgio_unbuffered (struct thread_data *td) {return (td->o.odirect || td->o.sync_io);
engines/sg.h new file +47 -0
47 lines not on this page · raw message
examples/uring-cmd-bsg.fio new file +31 -0
@@ -0,0 +1,31 @@ +# io_uring_cmd I/O engine for block SCSI generic character device + +[global] +filename=/dev/bsg/0\:0\:0\:0 +ioengine=io_uring_cmd +cmd_type=bsg +size=1G +iodepth=32 +bs=4KB +stonewall=1 + +[rand-write] +rw=randwrite + +[rand-read] +rw=randread + +[trimwrite] +rw=trimwrite + +[writefua] +rw=write +writefua=1 + +[readfua] +rw=read +readfua=1 + +[fsync] +rw=write +fsync=1
examples/uring-cmd-bsg.png new file binary +0 -0
fio.1 +1 -1
@@ -2347,7 +2347,7 @@ should be used for the polling thread. .TP .BI (io_uring_cmd)cmd_type \fR=\fPstr Specifies the type of uring passthrough command to be used. Supported -value is nvme. Default is nvme. +values are nvme and bsg. Default is nvme. .TP .BI (libaio)userspace_reap Normally, with the libaio engine in use, fio will use the
t/io_uring_cmd.py renamed from t/nvmept.py +31 -12
111 lines not on this page · raw message
t/run-fio-tests.py +1 -1
@@ -1086,7 +1086,7 @@ TEST_LIST = [ { 'test_id': 1014, 'test_class': FioExeTest, - 'exe': 't/nvmept.py', + 'exe': 't/io_uring_cmd.py', 'parameters': ['-f', '{fio_path}', '--dut', '{nvmecdev}'], 'success': SUCCESS_DEFAULT, 'requirements': [Requirements.linux, Requirements.nvmecdev],