public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Sachin Sant <sachinp@linux.ibm.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v2 0/3] io_uring READ(V), WRITE(v) operation tests
Date: Tue, 24 Mar 2026 10:52:38 +0530	[thread overview]
Message-ID: <20260324052241.21455-1-sachinp@linux.ibm.com> (raw)

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


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

             reply	other threads:[~2026-03-24  5:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-24  5:22 Sachin Sant [this message]
2026-03-24  5:22 ` [LTP] [PATCH v2 1/3] io_uring: Test IORING READ and WRITE operations Sachin Sant
2026-03-24  5:22 ` [LTP] [PATCH v2 2/3] io_uring: Test READV and WRITEV operations Sachin Sant
2026-03-24  5:22 ` [LTP] [PATCH v2 3/3] io_uring: Refactor io_uring01 to use common code Sachin Sant

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=20260324052241.21455-1-sachinp@linux.ibm.com \
    --to=sachinp@linux.ibm.com \
    --cc=ltp@lists.linux.it \
    /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