[LTP] [PATCH v2 0/3] io_uring READ(V), WRITE(v) operation tests
Sachin Sant
sachinp@linux.ibm.com
Tue Mar 24 06:22:38 CET 2026
This patch series adds a set of test case to validate
IOURING READ & WRITE (io_uring03), READV & WRITEV (io_uring04)
operations. The patch also adds a common header file to
avoid code duplication.
This patch series also refactors existing test io_uring01
to use the common structures and function defined in header.
Signed-off-by: Sachin Sant <sachinp@linux.ibm.com>
---
V2 changes:
- Use guarded buffer(including iovec) allocation
- Move setup/cleanup code from run to appropriate path
- Add a function to map the OP to the enum name
- Define and use generic cleanup functions
- Add a buffer size 0 in the middle of the iovec
- Simplify setup_io_uring_test to use common code.
- Link to V1: https://lore.kernel.org/ltp/20260320124742.75946-1-sachinp@linux.ibm.com/T/#t
Changes after RFC patch series:
- Addressed review comments
- Refactored io_uring01 test to use common code
- Removed git tags
- Link to RFC: https://lore.kernel.org/ltp/20260318110328.52031-1-sachinp@linux.ibm.com/T/#t
Test run:
$ ./testcases/bin/io_uring03
tst_buffers.c:57: TINFO: Test is using guarded buffers
tst_tmpdir.c:308: TINFO: Using /tmp/LTP_io_o1kf2Z as tmpdir (tmpfs filesystem)
....
tst_kconfig.c:88: TINFO: Parsing kernel config '/proc/config.gz'
tst_kconfig.c:676: TINFO: CONFIG_FAULT_INJECTION kernel option detected which might slow the execution
tst_test.c:1887: TINFO: Overall timeout per run is 0h 02m 00s
io_uring03.c:62: TINFO: Testing IORING_OP_WRITE
io_uring_common.h:310: TPASS: OP=IORING_OP_WRITE (17) fd=4 buf=0x7fff83b0f000 len=4096 offset=0
io_uring03.c:68: TINFO: Testing IORING_OP_READ
io_uring_common.h:310: TPASS: OP=IORING_OP_READ (16) fd=4 buf=0x7fff83aef000 len=4096 offset=0
io_uring03.c:40: TPASS: Basic I/O data integrity verified
io_uring03.c:83: TINFO: Testing partial I/O operations
io_uring_common.h:310: TPASS: OP=IORING_OP_WRITE (17) fd=4 buf=0x7fff83b0f000 len=2048 offset=0
io_uring_common.h:310: TPASS: OP=IORING_OP_WRITE (17) fd=4 buf=0x7fff83b0f800 len=2048 offset=2048
io_uring_common.h:310: TPASS: OP=IORING_OP_READ (16) fd=4 buf=0x7fff83aef000 len=4096 offset=0
io_uring03.c:40: TPASS: Partial I/O data integrity verified
.....
ltcden8-lp8:/opt/ltp # ./testcases/bin/io_uring04
tst_buffers.c:57: TINFO: Test is using guarded buffers
tst_tmpdir.c:308: TINFO: Using /tmp/LTP_io_reAIwJ as tmpdir (tmpfs filesystem)
......
tst_kconfig.c:88: TINFO: Parsing kernel config '/proc/config.gz'
tst_kconfig.c:676: TINFO: CONFIG_FAULT_INJECTION kernel option detected which might slow the execution
tst_test.c:1887: TINFO: Overall timeout per run is 0h 02m 00s
io_uring04.c:102: TINFO: Testing IORING_OP_WRITEV and IORING_OP_READV
io_uring04.c:106: TINFO: Writing 4096 bytes using 4 vectors
io_uring_common.h:326: TPASS: OP=IORING_OP_WRITEV (02) fd=4 iovs=0x7fffb832ffc0 nvecs=4 offset=0 expected_size=4096
io_uring04.c:112: TINFO: Reading 4096 bytes using 4 vectors
io_uring_common.h:326: TPASS: OP=IORING_OP_READV (01) fd=4 iovs=0x7fffb7bcffc0 nvecs=4 offset=0 expected_size=4096
io_uring04.c:92: TPASS: Basic vectored I/O: data integrity verified across 4 vectors
io_uring04.c:126: TINFO: Testing partial vector operations
io_uring_common.h:326: TPASS: OP=IORING_OP_WRITEV (02) fd=4 iovs=0x7fffb832ffc0 nvecs=2 offset=0 expected_size=2048
io_uring_common.h:326: TPASS: OP=IORING_OP_WRITEV (02) fd=4 iovs=0x7fffb832ffe0 nvecs=2 offset=2048 expected_size=2048
io_uring_common.h:326: TPASS: OP=IORING_OP_READV (01) fd=4 iovs=0x7fffb7bcffc0 nvecs=4 offset=0 expected_size=4096
io_uring04.c:92: TPASS: Partial vector I/O: data integrity verified across 4 vectors
io_uring04.c:154: TINFO: Testing vectors with varying sizes including zero-length buffer
io_uring_common.h:326: TPASS: OP=IORING_OP_WRITEV (02) fd=4 iovs=0x7fffb7b2ffc0 nvecs=4 offset=0 expected_size=1792
io_uring_common.h:326: TPASS: OP=IORING_OP_READV (01) fd=4 iovs=0x7fffb7aaffc0 nvecs=4 offset=0 expected_size=1792
io_uring04.c:92: TPASS: Varying size vector I/O with zero-length buffer: data integrity verified across 4 vectors
.....
$
---
Sachin Sant (3):
io_uring: Test IORING READ and WRITE operations
io_uring: Test READV and WRITEV operations
io_uring: Refactor io_uring01 to use common code
runtest/syscalls | 2 +
testcases/kernel/syscalls/io_uring/.gitignore | 2 +
.../kernel/syscalls/io_uring/io_uring01.c | 145 ++-------
.../kernel/syscalls/io_uring/io_uring03.c | 140 +++++++++
.../kernel/syscalls/io_uring/io_uring04.c | 216 ++++++++++++++
.../syscalls/io_uring/io_uring_common.h | 278 ++++++++++++++++++
6 files changed, 660 insertions(+), 123 deletions(-)
create mode 100644 testcases/kernel/syscalls/io_uring/io_uring03.c
create mode 100644 testcases/kernel/syscalls/io_uring/io_uring04.c
create mode 100644 testcases/kernel/syscalls/io_uring/io_uring_common.h
--
2.39.1
More information about the ltp
mailing list