public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [RFC] [PATCH 0/2] io_uring READ(V), WRITE(v) operation tests
@ 2026-03-18 11:03 Sachin Sant
  2026-03-18 11:03 ` [LTP] [RFC] [PATCH 1/2] io_uring: Test IORING READ and WRITE operations Sachin Sant
  2026-03-18 11:03 ` [LTP] [RFC] [PATCH 2/2] io_uring: Test READV and WRITEV operations Sachin Sant
  0 siblings, 2 replies; 5+ messages in thread
From: Sachin Sant @ 2026-03-18 11:03 UTC (permalink / raw)
  To: ltp

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.

These patches have been tested successfully on ppc64le
arch (fedora and SLES flavours)

Code is available
at https://github.com/sacsant/ltp/tree/uring_fio

Test run:

$  ./io_uring03
tst_tmpdir.c:308: TINFO: Using /tmp/LTP_io_XN0m3T as tmpdir (tmpfs filesystem)
tst_test.c:2059: TINFO: LTP version: 20210524-3958-g3203be536
......
tst_test.c:1887: TINFO: Overall timeout per run is 0h 00m 30s
io_uring03.c:195: TINFO: Testing IORING_OP_WRITE
io_uring03.c:199: TPASS: IORING_OP_WRITE completed successfully
io_uring03.c:205: TINFO: Testing IORING_OP_READ
io_uring03.c:210: TPASS: IORING_OP_READ completed successfully
io_uring03.c:214: TPASS: Data integrity verified
io_uring03.c:236: TINFO: Testing partial I/O operations
io_uring03.c:247: TPASS: Partial write (first half) succeeded
io_uring03.c:252: TPASS: Partial write (second half) succeeded
io_uring03.c:260: TPASS: Full read after partial writes succeeded
io_uring03.c:264: TPASS: Partial I/O data integrity verified

Summary:
passed   7
failed   0
broken   0
skipped  0
warnings 0
$ ./io_uring04
tst_tmpdir.c:308: TINFO: Using /tmp/LTP_io_ekmpZP as tmpdir (tmpfs filesystem)
tst_test.c:2059: TINFO: LTP version: 20210524-3958-g3203be536
.......
tst_test.c:1887: TINFO: Overall timeout per run is 0h 00m 30s
io_uring04.c:218: TINFO: Testing IORING_OP_WRITEV and IORING_OP_READV
io_uring04.c:226: TINFO: Writing 4096 bytes using 4 vectors
io_uring04.c:230: TPASS: IORING_OP_WRITEV completed successfully
io_uring04.c:235: TINFO: Reading 4096 bytes using 4 vectors
io_uring04.c:239: TPASS: IORING_OP_READV completed successfully
io_uring04.c:258: TPASS: Data integrity verified across all 4 vectors
io_uring04.c:270: TINFO: Testing partial vector operations
io_uring04.c:284: TPASS: Partial IORING_OP_WRITEV (2 vectors) succeeded
io_uring04.c:294: TPASS: Partial IORING_OP_READV (2 vectors) succeeded
io_uring04.c:305: TPASS: Partial vector data integrity verified
io_uring04.c:319: TINFO: Testing vectors with varying sizes
io_uring04.c:352: TPASS: IORING_OP_WRITEV with varying sizes succeeded
io_uring04.c:359: TPASS: IORING_OP_READV with varying sizes succeeded
io_uring04.c:365: TPASS: Varying size vector data integrity verified

Summary:
passed   9
failed   0
broken   0
skipped  0
warnings 0
$


Sachin Sant (2):
  io_uring: Test IORING READ and WRITE operations
  io_uring: Test READV and WRITEV operations

 runtest/syscalls                              |   2 +
 testcases/kernel/syscalls/io_uring/.gitignore |   2 +
 .../kernel/syscalls/io_uring/io_uring03.c     | 145 ++++++++++
 .../kernel/syscalls/io_uring/io_uring04.c     | 248 ++++++++++++++++++
 .../syscalls/io_uring/io_uring_common.h       | 227 ++++++++++++++++
 5 files changed, 624 insertions(+)
 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [LTP] [RFC] [PATCH 1/2] io_uring: Test IORING READ and WRITE operations
  2026-03-18 11:03 [LTP] [RFC] [PATCH 0/2] io_uring READ(V), WRITE(v) operation tests Sachin Sant
@ 2026-03-18 11:03 ` Sachin Sant
  2026-03-19 16:49   ` Cyril Hrubis
  2026-03-18 11:03 ` [LTP] [RFC] [PATCH 2/2] io_uring: Test READV and WRITEV operations Sachin Sant
  1 sibling, 1 reply; 5+ messages in thread
From: Sachin Sant @ 2026-03-18 11:03 UTC (permalink / raw)
  To: ltp

This test validates basic read and write operations using io_uring.
It tests:
 1. IORING_OP_WRITE - Writing data to a file
 2. IORING_OP_READ - Reading data from a file
 3. Data integrity verification

This patch also introduces a header file for common functions.

Signed-off-by: Sachin Sant <sachinp@linux.ibm.com>
---
 runtest/syscalls                              |   1 +
 testcases/kernel/syscalls/io_uring/.gitignore |   1 +
 .../kernel/syscalls/io_uring/io_uring03.c     | 145 +++++++++++
 .../syscalls/io_uring/io_uring_common.h       | 227 ++++++++++++++++++
 4 files changed, 374 insertions(+)
 create mode 100644 testcases/kernel/syscalls/io_uring/io_uring03.c
 create mode 100644 testcases/kernel/syscalls/io_uring/io_uring_common.h

diff --git a/runtest/syscalls b/runtest/syscalls
index 2179e007c..7dc80fe29 100644
--- a/runtest/syscalls
+++ b/runtest/syscalls
@@ -1898,6 +1898,7 @@ membarrier01 membarrier01
 
 io_uring01 io_uring01
 io_uring02 io_uring02
+io_uring03 io_uring03
 
 # Tests below may cause kernel memory leak
 perf_event_open03 perf_event_open03
diff --git a/testcases/kernel/syscalls/io_uring/.gitignore b/testcases/kernel/syscalls/io_uring/.gitignore
index 749db17db..9382ae413 100644
--- a/testcases/kernel/syscalls/io_uring/.gitignore
+++ b/testcases/kernel/syscalls/io_uring/.gitignore
@@ -1,2 +1,3 @@
 /io_uring01
 /io_uring02
+/io_uring03
diff --git a/testcases/kernel/syscalls/io_uring/io_uring03.c b/testcases/kernel/syscalls/io_uring/io_uring03.c
new file mode 100644
index 000000000..53d4feae5
--- /dev/null
+++ b/testcases/kernel/syscalls/io_uring/io_uring03.c
@@ -0,0 +1,145 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (C) 2026 IBM
+ * Author: Sachin Sant <sachinp@linux.ibm.com>
+ *
+ * Test IORING_OP_READ and IORING_OP_WRITE operations.
+ *
+ * This test validates basic read and write operations using io_uring.
+ * It tests:
+ * 1. IORING_OP_WRITE - Writing data to a file
+ * 2. IORING_OP_READ - Reading data from a file
+ * 3. Data integrity verification
+ */
+
+#include "io_uring_common.h"
+
+#define TEST_FILE "io_uring_test_file"
+#define QUEUE_DEPTH 2
+#define BLOCK_SZ 4096
+
+static char write_buf[BLOCK_SZ];
+static char read_buf[BLOCK_SZ];
+static struct io_uring_submit s;
+static sigset_t sig;
+
+static void test_write_read(void)
+{
+	int fd;
+	size_t i;
+
+	/* Prepare write buffer with pattern */
+	for (i = 0; i < BLOCK_SZ; i++)
+		write_buf[i] = 'A' + (i % 26);
+
+	/* Open file for writing */
+	fd = SAFE_OPEN(TEST_FILE, O_RDWR | O_CREAT | O_TRUNC, 0644);
+
+	/* Test IORING_OP_WRITE */
+	tst_res(TINFO, "Testing IORING_OP_WRITE");
+	io_uring_submit_sqe(&s, fd, IORING_OP_WRITE, write_buf, BLOCK_SZ, 0);
+
+	if (io_uring_wait_cqe(&s, BLOCK_SZ, IORING_OP_WRITE, &sig) == 0)
+		tst_res(TPASS, "IORING_OP_WRITE completed successfully");
+
+	/* Sync to ensure data is written */
+	SAFE_FSYNC(fd);
+
+	/* Test IORING_OP_READ */
+	tst_res(TINFO, "Testing IORING_OP_READ");
+	memset(read_buf, 0, BLOCK_SZ);
+	io_uring_submit_sqe(&s, fd, IORING_OP_READ, read_buf, BLOCK_SZ, 0);
+
+	if (io_uring_wait_cqe(&s, BLOCK_SZ, IORING_OP_READ, &sig) == 0)
+		tst_res(TPASS, "IORING_OP_READ completed successfully");
+
+	/* Verify data integrity */
+	if (memcmp(write_buf, read_buf, BLOCK_SZ) == 0) {
+		tst_res(TPASS, "Data integrity verified");
+	} else {
+		tst_res(TFAIL, "Data mismatch after read");
+		for (i = 0; i < BLOCK_SZ && i < 64; i++) {
+			if (write_buf[i] != read_buf[i]) {
+				tst_res(TINFO, "First mismatch at offset %zu: "
+					"wrote 0x%02x, read 0x%02x",
+					i, write_buf[i], read_buf[i]);
+				break;
+			}
+		}
+	}
+
+	SAFE_CLOSE(fd);
+}
+
+static void test_partial_io(void)
+{
+	int fd;
+	size_t half = BLOCK_SZ / 2;
+	size_t i;
+
+	tst_res(TINFO, "Testing partial I/O operations");
+
+	/* Prepare buffer */
+	for (i = 0; i < BLOCK_SZ; i++)
+		write_buf[i] = 'a' + (i % 26);
+
+	fd = SAFE_OPEN(TEST_FILE, O_RDWR | O_CREAT | O_TRUNC, 0644);
+
+	/* Write first half */
+	io_uring_submit_sqe(&s, fd, IORING_OP_WRITE, write_buf, half, 0);
+	if (io_uring_wait_cqe(&s, half, IORING_OP_WRITE, &sig) == 0)
+		tst_res(TPASS, "Partial write (first half) succeeded");
+
+	/* Write second half */
+	io_uring_submit_sqe(&s, fd, IORING_OP_WRITE, write_buf + half,
+			    half, half);
+	if (io_uring_wait_cqe(&s, half, IORING_OP_WRITE, &sig) == 0)
+		tst_res(TPASS, "Partial write (second half) succeeded");
+
+	SAFE_FSYNC(fd);
+
+	/* Read back in one operation */
+	memset(read_buf, 0, BLOCK_SZ);
+	io_uring_submit_sqe(&s, fd, IORING_OP_READ, read_buf, BLOCK_SZ, 0);
+	if (io_uring_wait_cqe(&s, BLOCK_SZ, IORING_OP_READ, &sig) == 0)
+		tst_res(TPASS, "Full read after partial writes succeeded");
+
+	/* Verify */
+	if (memcmp(write_buf, read_buf, BLOCK_SZ) == 0)
+		tst_res(TPASS, "Partial I/O data integrity verified");
+	else
+		tst_res(TFAIL, "Partial I/O data mismatch");
+
+	SAFE_CLOSE(fd);
+}
+
+static void run(void)
+{
+	io_uring_setup_queue(&s, QUEUE_DEPTH);
+	test_write_read();
+	test_partial_io();
+	io_uring_cleanup_queue(&s, QUEUE_DEPTH);
+}
+
+static void setup(void)
+{
+	io_uring_setup_supported_by_kernel();
+	sigemptyset(&sig);
+	memset(&s, 0, sizeof(s));
+}
+
+static struct tst_test test = {
+	.test_all = run,
+	.setup = setup,
+	.needs_tmpdir = 1,
+	.save_restore = (const struct tst_path_val[]) {
+		{"/proc/sys/kernel/io_uring_disabled", "0",
+			TST_SR_SKIP_MISSING | TST_SR_TCONF_RO},
+		{}
+	},
+	.tags = (const struct tst_tag[]) {
+		{"linux-git", "5d17b4a4b48c"},
+		{"linux-git", "2b188cc1bb85"},
+		{}
+	}
+};
diff --git a/testcases/kernel/syscalls/io_uring/io_uring_common.h b/testcases/kernel/syscalls/io_uring/io_uring_common.h
new file mode 100644
index 000000000..df05a0759
--- /dev/null
+++ b/testcases/kernel/syscalls/io_uring/io_uring_common.h
@@ -0,0 +1,227 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (C) 2026 IBM
+ * Author: Sachin Sant <sachinp@linux.ibm.com>
+ *
+ * Common definitions and helper functions for io_uring tests
+ */
+
+#ifndef IO_URING_COMMON_H
+#define IO_URING_COMMON_H
+
+#include <stdlib.h>
+#include <string.h>
+#include <fcntl.h>
+#include "config.h"
+#include "tst_test.h"
+#include "lapi/io_uring.h"
+
+/* Common structures for io_uring ring management */
+struct io_sq_ring {
+	unsigned int *head;
+	unsigned int *tail;
+	unsigned int *ring_mask;
+	unsigned int *ring_entries;
+	unsigned int *flags;
+	unsigned int *array;
+};
+
+struct io_cq_ring {
+	unsigned int *head;
+	unsigned int *tail;
+	unsigned int *ring_mask;
+	unsigned int *ring_entries;
+	struct io_uring_cqe *cqes;
+};
+
+struct io_uring_submit {
+	int ring_fd;
+	struct io_sq_ring sq_ring;
+	struct io_uring_sqe *sqes;
+	struct io_cq_ring cq_ring;
+	void *sq_ptr;
+	size_t sq_ptr_size;
+	void *cq_ptr;
+	size_t cq_ptr_size;
+};
+
+/*
+ * Setup io_uring instance with specified queue depth
+ * Returns 0 on success, -1 on failure
+ */
+static inline int io_uring_setup_queue(struct io_uring_submit *s,
+				       unsigned int queue_depth)
+{
+	struct io_sq_ring *sring = &s->sq_ring;
+	struct io_cq_ring *cring = &s->cq_ring;
+	struct io_uring_params p;
+
+	memset(&p, 0, sizeof(p));
+	s->ring_fd = io_uring_setup(queue_depth, &p);
+	if (s->ring_fd < 0) {
+		tst_brk(TBROK | TERRNO, "io_uring_setup() failed");
+		return -1;
+	}
+
+	s->sq_ptr_size = p.sq_off.array + p.sq_entries * sizeof(unsigned int);
+
+	/* Map submission queue ring buffer */
+	s->sq_ptr = SAFE_MMAP(0, s->sq_ptr_size, PROT_READ | PROT_WRITE,
+			      MAP_SHARED | MAP_POPULATE, s->ring_fd,
+			      IORING_OFF_SQ_RING);
+
+	/* Save submission queue pointers */
+	sring->head = s->sq_ptr + p.sq_off.head;
+	sring->tail = s->sq_ptr + p.sq_off.tail;
+	sring->ring_mask = s->sq_ptr + p.sq_off.ring_mask;
+	sring->ring_entries = s->sq_ptr + p.sq_off.ring_entries;
+	sring->flags = s->sq_ptr + p.sq_off.flags;
+	sring->array = s->sq_ptr + p.sq_off.array;
+
+	/* Map submission queue entries */
+	s->sqes = SAFE_MMAP(0, p.sq_entries * sizeof(struct io_uring_sqe),
+			    PROT_READ | PROT_WRITE, MAP_SHARED | MAP_POPULATE,
+			    s->ring_fd, IORING_OFF_SQES);
+
+	s->cq_ptr_size = p.cq_off.cqes +
+			 p.cq_entries * sizeof(struct io_uring_cqe);
+
+	/* Map completion queue ring buffer */
+	s->cq_ptr = SAFE_MMAP(0, s->cq_ptr_size, PROT_READ | PROT_WRITE,
+			      MAP_SHARED | MAP_POPULATE, s->ring_fd,
+			      IORING_OFF_CQ_RING);
+
+	/* Save completion queue pointers */
+	cring->head = s->cq_ptr + p.cq_off.head;
+	cring->tail = s->cq_ptr + p.cq_off.tail;
+	cring->ring_mask = s->cq_ptr + p.cq_off.ring_mask;
+	cring->ring_entries = s->cq_ptr + p.cq_off.ring_entries;
+	cring->cqes = s->cq_ptr + p.cq_off.cqes;
+
+	return 0;
+}
+
+/*
+ * Cleanup io_uring instance and unmap all memory regions
+ */
+static inline void io_uring_cleanup_queue(struct io_uring_submit *s,
+					  unsigned int queue_depth)
+{
+	if (s->sqes)
+		SAFE_MUNMAP(s->sqes, queue_depth * sizeof(struct io_uring_sqe));
+	if (s->cq_ptr)
+		SAFE_MUNMAP(s->cq_ptr, s->cq_ptr_size);
+	if (s->sq_ptr)
+		SAFE_MUNMAP(s->sq_ptr, s->sq_ptr_size);
+	if (s->ring_fd > 0)
+		SAFE_CLOSE(s->ring_fd);
+}
+
+/*
+ * Submit a single SQE to the submission queue
+ * For basic read/write operations (non-vectored)
+ */
+static inline void io_uring_submit_sqe(struct io_uring_submit *s, int fd,
+				       int opcode, void *buf, size_t len,
+				       off_t offset)
+{
+	struct io_sq_ring *sring = &s->sq_ring;
+	unsigned int tail, index;
+	struct io_uring_sqe *sqe;
+
+	tail = *sring->tail;
+	index = tail & *sring->ring_mask;
+	sqe = &s->sqes[index];
+
+	memset(sqe, 0, sizeof(*sqe));
+	sqe->opcode = opcode;
+	sqe->fd = fd;
+	sqe->addr = (unsigned long)buf;
+	sqe->len = len;
+	sqe->off = offset;
+	sqe->user_data = opcode;
+
+	sring->array[index] = index;
+	tail++;
+
+	/* Update tail to make SQE visible to kernel */
+	*sring->tail = tail;
+}
+
+/*
+ * Submit a vectored SQE to the submission queue
+ * For readv/writev operations
+ */
+static inline void io_uring_submit_sqe_vec(struct io_uring_submit *s, int fd,
+					   int opcode, struct iovec *iovs,
+					   int nr_vecs, off_t offset)
+{
+	struct io_sq_ring *sring = &s->sq_ring;
+	unsigned int tail, index;
+	struct io_uring_sqe *sqe;
+
+	tail = *sring->tail;
+	index = tail & *sring->ring_mask;
+	sqe = &s->sqes[index];
+
+	memset(sqe, 0, sizeof(*sqe));
+	sqe->opcode = opcode;
+	sqe->fd = fd;
+	sqe->addr = (unsigned long)iovs;
+	sqe->len = nr_vecs;
+	sqe->off = offset;
+	sqe->user_data = opcode;
+
+	sring->array[index] = index;
+	tail++;
+
+	/* Update tail to make SQE visible to kernel */
+	*sring->tail = tail;
+}
+
+/*
+ * Wait for and validate a completion queue entry
+ * Returns 0 on success, -1 on failure
+ */
+static inline int io_uring_wait_cqe(struct io_uring_submit *s,
+				    int expected_res, int expected_opcode,
+				    sigset_t *sig)
+{
+	struct io_cq_ring *cring = &s->cq_ring;
+	struct io_uring_cqe *cqe;
+	unsigned int head;
+	int ret;
+
+	ret = io_uring_enter(s->ring_fd, 1, 1, IORING_ENTER_GETEVENTS, sig);
+	if (ret < 0) {
+		tst_res(TFAIL | TERRNO, "io_uring_enter() failed");
+		return -1;
+	}
+
+	head = *cring->head;
+	if (head == *cring->tail) {
+		tst_res(TFAIL, "No completion event received");
+		return -1;
+	}
+
+	cqe = &cring->cqes[head & *cring->ring_mask];
+
+	if (cqe->user_data != (uint64_t)expected_opcode) {
+		tst_res(TFAIL, "Unexpected user_data: got %llu, expected %d",
+			cqe->user_data, expected_opcode);
+		*cring->head = head + 1;
+		return -1;
+	}
+
+	if (cqe->res != expected_res) {
+		tst_res(TFAIL, "Operation failed: res=%d, expected=%d",
+			cqe->res, expected_res);
+		*cring->head = head + 1;
+		return -1;
+	}
+
+	*cring->head = head + 1;
+	return 0;
+}
+
+#endif /* IO_URING_COMMON_H */
-- 
2.39.1


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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [LTP] [RFC] [PATCH 2/2] io_uring: Test READV and WRITEV operations
  2026-03-18 11:03 [LTP] [RFC] [PATCH 0/2] io_uring READ(V), WRITE(v) operation tests Sachin Sant
  2026-03-18 11:03 ` [LTP] [RFC] [PATCH 1/2] io_uring: Test IORING READ and WRITE operations Sachin Sant
@ 2026-03-18 11:03 ` Sachin Sant
  1 sibling, 0 replies; 5+ messages in thread
From: Sachin Sant @ 2026-03-18 11:03 UTC (permalink / raw)
  To: ltp

This test validates vectored read and write operations using io_uring.
It tests:
 1. IORING_OP_WRITEV - Writing data using multiple buffers (scatter)
 2. IORING_OP_READV - Reading data into multiple buffers (gather)
 3. Data integrity verification across multiple iovecs
 4. Edge cases with different iovec configurations

Signed-off-by: Sachin Sant <sachinp@linux.ibm.com>
---
 runtest/syscalls                              |   1 +
 testcases/kernel/syscalls/io_uring/.gitignore |   1 +
 .../kernel/syscalls/io_uring/io_uring04.c     | 248 ++++++++++++++++++
 3 files changed, 250 insertions(+)
 create mode 100644 testcases/kernel/syscalls/io_uring/io_uring04.c

diff --git a/runtest/syscalls b/runtest/syscalls
index 7dc80fe29..100ae7706 100644
--- a/runtest/syscalls
+++ b/runtest/syscalls
@@ -1899,6 +1899,7 @@ membarrier01 membarrier01
 io_uring01 io_uring01
 io_uring02 io_uring02
 io_uring03 io_uring03
+io_uring03 io_uring04
 
 # Tests below may cause kernel memory leak
 perf_event_open03 perf_event_open03
diff --git a/testcases/kernel/syscalls/io_uring/.gitignore b/testcases/kernel/syscalls/io_uring/.gitignore
index 9382ae413..36cd24662 100644
--- a/testcases/kernel/syscalls/io_uring/.gitignore
+++ b/testcases/kernel/syscalls/io_uring/.gitignore
@@ -1,3 +1,4 @@
 /io_uring01
 /io_uring02
 /io_uring03
+/io_uring04
diff --git a/testcases/kernel/syscalls/io_uring/io_uring04.c b/testcases/kernel/syscalls/io_uring/io_uring04.c
new file mode 100644
index 000000000..fa61f0962
--- /dev/null
+++ b/testcases/kernel/syscalls/io_uring/io_uring04.c
@@ -0,0 +1,248 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (C) 2026 IBM
+ * Author: Sachin Sant <sachinp@linux.ibm.com>
+ *
+ * Test IORING_OP_READV and IORING_OP_WRITEV operations.
+ *
+ * This test validates vectored read and write operations using io_uring.
+ * It tests:
+ * 1. IORING_OP_WRITEV - Writing data using multiple buffers (scatter)
+ * 2. IORING_OP_READV - Reading data into multiple buffers (gather)
+ * 3. Data integrity verification across multiple iovecs
+ * 4. Edge cases with different iovec configurations
+ */
+
+#include "io_uring_common.h"
+
+#define TEST_FILE "io_uring_test_file"
+#define QUEUE_DEPTH 2
+#define NUM_VECS 4
+#define VEC_SIZE 1024
+
+static char write_bufs[NUM_VECS][VEC_SIZE];
+static char read_bufs[NUM_VECS][VEC_SIZE];
+static struct iovec write_iovs[NUM_VECS];
+static struct iovec read_iovs[NUM_VECS];
+static struct io_uring_submit s;
+static sigset_t sig;
+
+static void prepare_write_buffers(void)
+{
+	size_t i, j;
+
+	for (i = 0; i < NUM_VECS; i++) {
+		for (j = 0; j < VEC_SIZE; j++) {
+			/* Each vector has a different pattern */
+			write_bufs[i][j] = 'A' + i + (j % 26);
+		}
+		write_iovs[i].iov_base = write_bufs[i];
+		write_iovs[i].iov_len = VEC_SIZE;
+	}
+}
+
+static void prepare_read_buffers(void)
+{
+	size_t i;
+
+	for (i = 0; i < NUM_VECS; i++) {
+		memset(read_bufs[i], 0, VEC_SIZE);
+		read_iovs[i].iov_base = read_bufs[i];
+		read_iovs[i].iov_len = VEC_SIZE;
+	}
+}
+
+static void test_writev_readv(void)
+{
+	int fd;
+	size_t i, j;
+	int total_size = NUM_VECS * VEC_SIZE;
+
+	tst_res(TINFO, "Testing IORING_OP_WRITEV and IORING_OP_READV");
+
+	prepare_write_buffers();
+	prepare_read_buffers();
+
+	fd = SAFE_OPEN(TEST_FILE, O_RDWR | O_CREAT | O_TRUNC, 0644);
+
+	/* Test IORING_OP_WRITEV */
+	tst_res(TINFO, "Writing %d bytes using %d vectors", total_size, NUM_VECS);
+	io_uring_submit_sqe_vec(&s, fd, IORING_OP_WRITEV, write_iovs,
+				NUM_VECS, 0);
+
+	if (io_uring_wait_cqe(&s, total_size, IORING_OP_WRITEV, &sig) == 0)
+		tst_res(TPASS, "IORING_OP_WRITEV completed successfully");
+
+	SAFE_FSYNC(fd);
+
+	/* Test IORING_OP_READV */
+	tst_res(TINFO, "Reading %d bytes using %d vectors", total_size, NUM_VECS);
+	io_uring_submit_sqe_vec(&s, fd, IORING_OP_READV, read_iovs,
+				NUM_VECS, 0);
+
+	if (io_uring_wait_cqe(&s, total_size, IORING_OP_READV, &sig) == 0)
+		tst_res(TPASS, "IORING_OP_READV completed successfully");
+
+	/* Verify data integrity for each vector */
+	for (i = 0; i < NUM_VECS; i++) {
+		if (memcmp(write_bufs[i], read_bufs[i], VEC_SIZE) != 0) {
+			tst_res(TFAIL, "Data mismatch in vector %zu", i);
+			for (j = 0; j < VEC_SIZE && j < 64; j++) {
+				if (write_bufs[i][j] != read_bufs[i][j]) {
+					tst_res(TINFO, "Vector %zu: first mismatch at "
+						"offset %zu: wrote 0x%02x, read 0x%02x",
+						i, j, write_bufs[i][j], read_bufs[i][j]);
+					break;
+				}
+			}
+			SAFE_CLOSE(fd);
+			return;
+		}
+	}
+
+	tst_res(TPASS, "Data integrity verified across all %d vectors", NUM_VECS);
+	SAFE_CLOSE(fd);
+}
+
+static void test_partial_vectors(void)
+{
+	int fd;
+	struct iovec partial_write[2];
+	struct iovec partial_read[2];
+	size_t i;
+	int expected_size;
+
+	tst_res(TINFO, "Testing partial vector operations");
+
+	prepare_write_buffers();
+	prepare_read_buffers();
+
+	fd = SAFE_OPEN(TEST_FILE, O_RDWR | O_CREAT | O_TRUNC, 0644);
+
+	/* Write using only 2 vectors */
+	partial_write[0] = write_iovs[0];
+	partial_write[1] = write_iovs[1];
+	expected_size = 2 * VEC_SIZE;
+
+	io_uring_submit_sqe_vec(&s, fd, IORING_OP_WRITEV, partial_write, 2, 0);
+	if (io_uring_wait_cqe(&s, expected_size, IORING_OP_WRITEV, &sig) == 0)
+		tst_res(TPASS, "Partial IORING_OP_WRITEV (2 vectors) succeeded");
+
+	SAFE_FSYNC(fd);
+
+	/* Read back using 2 vectors */
+	partial_read[0] = read_iovs[0];
+	partial_read[1] = read_iovs[1];
+
+	io_uring_submit_sqe_vec(&s, fd, IORING_OP_READV, partial_read, 2, 0);
+	if (io_uring_wait_cqe(&s, expected_size, IORING_OP_READV, &sig) == 0)
+		tst_res(TPASS, "Partial IORING_OP_READV (2 vectors) succeeded");
+
+	/* Verify only the first 2 vectors */
+	for (i = 0; i < 2; i++) {
+		if (memcmp(write_bufs[i], read_bufs[i], VEC_SIZE) != 0) {
+			tst_res(TFAIL, "Partial vector data mismatch at vector %zu", i);
+			SAFE_CLOSE(fd);
+			return;
+		}
+	}
+
+	tst_res(TPASS, "Partial vector data integrity verified");
+	SAFE_CLOSE(fd);
+}
+
+static void test_varying_sizes(void)
+{
+	int fd;
+	struct iovec var_write[3];
+	struct iovec var_read[3];
+	char buf1[512], buf2[1024], buf3[256];
+	char rbuf1[512], rbuf2[1024], rbuf3[256];
+	size_t i;
+	int expected_size = 512 + 1024 + 256;
+
+	tst_res(TINFO, "Testing vectors with varying sizes");
+
+	/* Prepare buffers with different sizes */
+	for (i = 0; i < 512; i++)
+		buf1[i] = 'X';
+	for (i = 0; i < 1024; i++)
+		buf2[i] = 'Y';
+	for (i = 0; i < 256; i++)
+		buf3[i] = 'Z';
+
+	var_write[0].iov_base = buf1;
+	var_write[0].iov_len = 512;
+	var_write[1].iov_base = buf2;
+	var_write[1].iov_len = 1024;
+	var_write[2].iov_base = buf3;
+	var_write[2].iov_len = 256;
+
+	memset(rbuf1, 0, 512);
+	memset(rbuf2, 0, 1024);
+	memset(rbuf3, 0, 256);
+
+	var_read[0].iov_base = rbuf1;
+	var_read[0].iov_len = 512;
+	var_read[1].iov_base = rbuf2;
+	var_read[1].iov_len = 1024;
+	var_read[2].iov_base = rbuf3;
+	var_read[2].iov_len = 256;
+
+	fd = SAFE_OPEN(TEST_FILE, O_RDWR | O_CREAT | O_TRUNC, 0644);
+
+	/* Write with varying sizes */
+	io_uring_submit_sqe_vec(&s, fd, IORING_OP_WRITEV, var_write, 3, 0);
+	if (io_uring_wait_cqe(&s, expected_size, IORING_OP_WRITEV, &sig) == 0)
+		tst_res(TPASS, "IORING_OP_WRITEV with varying sizes succeeded");
+
+	SAFE_FSYNC(fd);
+
+	/* Read back with varying sizes */
+	io_uring_submit_sqe_vec(&s, fd, IORING_OP_READV, var_read, 3, 0);
+	if (io_uring_wait_cqe(&s, expected_size, IORING_OP_READV, &sig) == 0)
+		tst_res(TPASS, "IORING_OP_READV with varying sizes succeeded");
+
+	/* Verify each buffer */
+	if (memcmp(buf1, rbuf1, 512) == 0 &&
+	    memcmp(buf2, rbuf2, 1024) == 0 &&
+	    memcmp(buf3, rbuf3, 256) == 0) {
+		tst_res(TPASS, "Varying size vector data integrity verified");
+	} else {
+		tst_res(TFAIL, "Varying size vector data mismatch");
+	}
+
+	SAFE_CLOSE(fd);
+}
+
+static void run(void)
+{
+	io_uring_setup_queue(&s, QUEUE_DEPTH);
+	test_writev_readv();
+	test_partial_vectors();
+	test_varying_sizes();
+	io_uring_cleanup_queue(&s, QUEUE_DEPTH);
+}
+
+static void setup(void)
+{
+	io_uring_setup_supported_by_kernel();
+	sigemptyset(&sig);
+	memset(&s, 0, sizeof(s));
+}
+
+static struct tst_test test = {
+	.test_all = run,
+	.setup = setup,
+	.needs_tmpdir = 1,
+	.save_restore = (const struct tst_path_val[]) {
+		{"/proc/sys/kernel/io_uring_disabled", "0",
+			TST_SR_SKIP_MISSING | TST_SR_TCONF_RO},
+		{}
+	},
+	.tags = (const struct tst_tag[]) {
+		{"linux-git", "2b188cc1bb85"},
+		{"linux-git", "f67676d160c6"},
+		{}
+	}
+};
-- 
2.39.1


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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [LTP] [RFC] [PATCH 1/2] io_uring: Test IORING READ and WRITE operations
  2026-03-18 11:03 ` [LTP] [RFC] [PATCH 1/2] io_uring: Test IORING READ and WRITE operations Sachin Sant
@ 2026-03-19 16:49   ` Cyril Hrubis
  2026-03-20  5:06     ` Sachin Sant
  0 siblings, 1 reply; 5+ messages in thread
From: Cyril Hrubis @ 2026-03-19 16:49 UTC (permalink / raw)
  To: Sachin Sant; +Cc: ltp

Hi!
>  # Tests below may cause kernel memory leak
>  perf_event_open03 perf_event_open03
> diff --git a/testcases/kernel/syscalls/io_uring/.gitignore b/testcases/kernel/syscalls/io_uring/.gitignore
> index 749db17db..9382ae413 100644
> --- a/testcases/kernel/syscalls/io_uring/.gitignore
> +++ b/testcases/kernel/syscalls/io_uring/.gitignore
> @@ -1,2 +1,3 @@
>  /io_uring01
>  /io_uring02
> +/io_uring03
> diff --git a/testcases/kernel/syscalls/io_uring/io_uring03.c b/testcases/kernel/syscalls/io_uring/io_uring03.c
> new file mode 100644
> index 000000000..53d4feae5
> --- /dev/null
> +++ b/testcases/kernel/syscalls/io_uring/io_uring03.c
> @@ -0,0 +1,145 @@
> +// SPDX-License-Identifier: GPL-2.0-or-later
> +/*
> + * Copyright (C) 2026 IBM
> + * Author: Sachin Sant <sachinp@linux.ibm.com>
> + *
> + * Test IORING_OP_READ and IORING_OP_WRITE operations.
> + *
> + * This test validates basic read and write operations using io_uring.
> + * It tests:
> + * 1. IORING_OP_WRITE - Writing data to a file
> + * 2. IORING_OP_READ - Reading data from a file
> + * 3. Data integrity verification
> + */

The second half of the comment should be doc comment (starts with /*\)
so that it's picked up by the documentation parser and exported into the
online documentation.

> +#include "io_uring_common.h"
> +
> +#define TEST_FILE "io_uring_test_file"
> +#define QUEUE_DEPTH 2
> +#define BLOCK_SZ 4096
> +
> +static char write_buf[BLOCK_SZ];
> +static char read_buf[BLOCK_SZ];
> +static struct io_uring_submit s;
> +static sigset_t sig;
> +
> +static void test_write_read(void)
> +{
> +	int fd;
> +	size_t i;
> +
> +	/* Prepare write buffer with pattern */

There a lot of comments like this that are commenting the
obvious. Comments that comment obvious does not add any value and
shouldn't be added.

> +	for (i = 0; i < BLOCK_SZ; i++)
> +		write_buf[i] = 'A' + (i % 26);

This should be done only once in the test setup.

> +	/* Open file for writing */
> +	fd = SAFE_OPEN(TEST_FILE, O_RDWR | O_CREAT | O_TRUNC, 0644);
> +
> +	/* Test IORING_OP_WRITE */
> +	tst_res(TINFO, "Testing IORING_OP_WRITE");
> +	io_uring_submit_sqe(&s, fd, IORING_OP_WRITE, write_buf, BLOCK_SZ, 0);



> +	if (io_uring_wait_cqe(&s, BLOCK_SZ, IORING_OP_WRITE, &sig) == 0)
> +		tst_res(TPASS, "IORING_OP_WRITE completed successfully");
> +
> +	/* Sync to ensure data is written */
> +	SAFE_FSYNC(fd);
> +
> +	/* Test IORING_OP_READ */
> +	tst_res(TINFO, "Testing IORING_OP_READ");
> +	memset(read_buf, 0, BLOCK_SZ);
> +	io_uring_submit_sqe(&s, fd, IORING_OP_READ, read_buf, BLOCK_SZ, 0);
> +
> +	if (io_uring_wait_cqe(&s, BLOCK_SZ, IORING_OP_READ, &sig) == 0)
> +		tst_res(TPASS, "IORING_OP_READ completed successfully");
> +
> +	/* Verify data integrity */
> +	if (memcmp(write_buf, read_buf, BLOCK_SZ) == 0) {
> +		tst_res(TPASS, "Data integrity verified");
> +	} else {
> +		tst_res(TFAIL, "Data mismatch after read");
> +		for (i = 0; i < BLOCK_SZ && i < 64; i++) {
> +			if (write_buf[i] != read_buf[i]) {
> +				tst_res(TINFO, "First mismatch at offset %zu: "
> +					"wrote 0x%02x, read 0x%02x",
> +					i, write_buf[i], read_buf[i]);
> +				break;
> +			}
> +		}
> +	}

This should really be put into a function and used in both test cases.

> +	SAFE_CLOSE(fd);
> +}
> +
> +static void test_partial_io(void)
> +{
> +	int fd;
> +	size_t half = BLOCK_SZ / 2;
> +	size_t i;
> +
> +	tst_res(TINFO, "Testing partial I/O operations");
> +
> +	/* Prepare buffer */
> +	for (i = 0; i < BLOCK_SZ; i++)
> +		write_buf[i] = 'a' + (i % 26);
> +
> +	fd = SAFE_OPEN(TEST_FILE, O_RDWR | O_CREAT | O_TRUNC, 0644);
> +
> +	/* Write first half */
> +	io_uring_submit_sqe(&s, fd, IORING_OP_WRITE, write_buf, half, 0);
> +	if (io_uring_wait_cqe(&s, half, IORING_OP_WRITE, &sig) == 0)
> +		tst_res(TPASS, "Partial write (first half) succeeded");
> +
> +	/* Write second half */
> +	io_uring_submit_sqe(&s, fd, IORING_OP_WRITE, write_buf + half,
> +			    half, half);
> +	if (io_uring_wait_cqe(&s, half, IORING_OP_WRITE, &sig) == 0)
> +		tst_res(TPASS, "Partial write (second half) succeeded");
> +
> +	SAFE_FSYNC(fd);
> +
> +	/* Read back in one operation */
> +	memset(read_buf, 0, BLOCK_SZ);
> +	io_uring_submit_sqe(&s, fd, IORING_OP_READ, read_buf, BLOCK_SZ, 0);
> +	if (io_uring_wait_cqe(&s, BLOCK_SZ, IORING_OP_READ, &sig) == 0)
> +		tst_res(TPASS, "Full read after partial writes succeeded");
> +
> +	/* Verify */
> +	if (memcmp(write_buf, read_buf, BLOCK_SZ) == 0)
> +		tst_res(TPASS, "Partial I/O data integrity verified");
> +	else
> +		tst_res(TFAIL, "Partial I/O data mismatch");
> +
> +	SAFE_CLOSE(fd);
> +}
> +
> +static void run(void)
> +{
> +	io_uring_setup_queue(&s, QUEUE_DEPTH);
> +	test_write_read();
> +	test_partial_io();
> +	io_uring_cleanup_queue(&s, QUEUE_DEPTH);
> +}
> +
> +static void setup(void)
> +{
> +	io_uring_setup_supported_by_kernel();
> +	sigemptyset(&sig);
> +	memset(&s, 0, sizeof(s));
> +}
> +
> +static struct tst_test test = {
> +	.test_all = run,
> +	.setup = setup,
> +	.needs_tmpdir = 1,
> +	.save_restore = (const struct tst_path_val[]) {
> +		{"/proc/sys/kernel/io_uring_disabled", "0",
> +			TST_SR_SKIP_MISSING | TST_SR_TCONF_RO},
> +		{}
> +	},
> +	.tags = (const struct tst_tag[]) {
> +		{"linux-git", "5d17b4a4b48c"},

This commit does not appear to exist in linux kernel git tree.

> +		{"linux-git", "2b188cc1bb85"},

And this is a commit that added io_uring. Commit hashes in tests are
used only for cases where the test is a regression test for some bug and
point to a commit that fixed the problem.

> +		{}
> +	}
> +};
> diff --git a/testcases/kernel/syscalls/io_uring/io_uring_common.h b/testcases/kernel/syscalls/io_uring/io_uring_common.h

Since you are pulling the common code into header it would be nice to
convert the io_uring01.c so that it uses the common header as well.

-- 
Cyril Hrubis
chrubis@suse.cz

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [LTP] [RFC] [PATCH 1/2] io_uring: Test IORING READ and WRITE operations
  2026-03-19 16:49   ` Cyril Hrubis
@ 2026-03-20  5:06     ` Sachin Sant
  0 siblings, 0 replies; 5+ messages in thread
From: Sachin Sant @ 2026-03-20  5:06 UTC (permalink / raw)
  To: Cyril Hrubis; +Cc: ltp



On 19/03/26 10:19 pm, Cyril Hrubis wrote:
> Hi!
>>   # Tests below may cause kernel memory leak
>>   perf_event_open03 perf_event_open03
>> diff --git a/testcases/kernel/syscalls/io_uring/.gitignore b/testcases/kernel/syscalls/io_uring/.gitignore
>> index 749db17db..9382ae413 100644
>> --- a/testcases/kernel/syscalls/io_uring/.gitignore
>> +++ b/testcases/kernel/syscalls/io_uring/.gitignore
>> @@ -1,2 +1,3 @@
>>   /io_uring01
>>   /io_uring02
>> +/io_uring03
>> diff --git a/testcases/kernel/syscalls/io_uring/io_uring03.c b/testcases/kernel/syscalls/io_uring/io_uring03.c
>> new file mode 100644
>> index 000000000..53d4feae5
>> --- /dev/null
>> +++ b/testcases/kernel/syscalls/io_uring/io_uring03.c
>> @@ -0,0 +1,145 @@
>> +// SPDX-License-Identifier: GPL-2.0-or-later
>> +/*
>> + * Copyright (C) 2026 IBM
>> + * Author: Sachin Sant <sachinp@linux.ibm.com>
>> + *
>> + * Test IORING_OP_READ and IORING_OP_WRITE operations.
>> + *
>> + * This test validates basic read and write operations using io_uring.
>> + * It tests:
>> + * 1. IORING_OP_WRITE - Writing data to a file
>> + * 2. IORING_OP_READ - Reading data from a file
>> + * 3. Data integrity verification
>> + */
> The second half of the comment should be doc comment (starts with /*\)
> so that it's picked up by the documentation parser and exported into the
> online documentation.
Ah yes, will modify.
>> +#include "io_uring_common.h"
>> +
>> +#define TEST_FILE "io_uring_test_file"
>> +#define QUEUE_DEPTH 2
>> +#define BLOCK_SZ 4096
>> +
>> +static char write_buf[BLOCK_SZ];
>> +static char read_buf[BLOCK_SZ];
>> +static struct io_uring_submit s;
>> +static sigset_t sig;
>> +
>> +static void test_write_read(void)
>> +{
>> +	int fd;
>> +	size_t i;
>> +
>> +	/* Prepare write buffer with pattern */
> There a lot of comments like this that are commenting the
> obvious. Comments that comment obvious does not add any value and
> shouldn't be added.
Will revisit the code.
>> +	for (i = 0; i < BLOCK_SZ; i++)
>> +		write_buf[i] = 'A' + (i % 26);
> This should be done only once in the test setup.
Will address this in v2.
>> +	/* Open file for writing */
>> +	fd = SAFE_OPEN(TEST_FILE, O_RDWR | O_CREAT | O_TRUNC, 0644);
>> +
>> +	/* Test IORING_OP_WRITE */
>> +	tst_res(TINFO, "Testing IORING_OP_WRITE");
>> +	io_uring_submit_sqe(&s, fd, IORING_OP_WRITE, write_buf, BLOCK_SZ, 0);
>
>
>> +	if (io_uring_wait_cqe(&s, BLOCK_SZ, IORING_OP_WRITE, &sig) == 0)
>> +		tst_res(TPASS, "IORING_OP_WRITE completed successfully");
>> +
>> +	/* Sync to ensure data is written */
>> +	SAFE_FSYNC(fd);
>> +
>> +	/* Test IORING_OP_READ */
>> +	tst_res(TINFO, "Testing IORING_OP_READ");
>> +	memset(read_buf, 0, BLOCK_SZ);
>> +	io_uring_submit_sqe(&s, fd, IORING_OP_READ, read_buf, BLOCK_SZ, 0);
>> +
>> +	if (io_uring_wait_cqe(&s, BLOCK_SZ, IORING_OP_READ, &sig) == 0)
>> +		tst_res(TPASS, "IORING_OP_READ completed successfully");
>> +
>> +	/* Verify data integrity */
>> +	if (memcmp(write_buf, read_buf, BLOCK_SZ) == 0) {
>> +		tst_res(TPASS, "Data integrity verified");
>> +	} else {
>> +		tst_res(TFAIL, "Data mismatch after read");
>> +		for (i = 0; i < BLOCK_SZ && i < 64; i++) {
>> +			if (write_buf[i] != read_buf[i]) {
>> +				tst_res(TINFO, "First mismatch at offset %zu: "
>> +					"wrote 0x%02x, read 0x%02x",
>> +					i, write_buf[i], read_buf[i]);
>> +				break;
>> +			}
>> +		}
>> +	}
> This should really be put into a function and used in both test cases.
Will address it.
>> +	SAFE_CLOSE(fd);
>> +}
>> +
>> +static void test_partial_io(void)
>> +{
>> +	int fd;
>> +	size_t half = BLOCK_SZ / 2;
>> +	size_t i;
>> +
>> +	tst_res(TINFO, "Testing partial I/O operations");
>> +
>> +	/* Prepare buffer */
>> +	for (i = 0; i < BLOCK_SZ; i++)
>> +		write_buf[i] = 'a' + (i % 26);
>> +
>> +	fd = SAFE_OPEN(TEST_FILE, O_RDWR | O_CREAT | O_TRUNC, 0644);
>> +
>> +	/* Write first half */
>> +	io_uring_submit_sqe(&s, fd, IORING_OP_WRITE, write_buf, half, 0);
>> +	if (io_uring_wait_cqe(&s, half, IORING_OP_WRITE, &sig) == 0)
>> +		tst_res(TPASS, "Partial write (first half) succeeded");
>> +
>> +	/* Write second half */
>> +	io_uring_submit_sqe(&s, fd, IORING_OP_WRITE, write_buf + half,
>> +			    half, half);
>> +	if (io_uring_wait_cqe(&s, half, IORING_OP_WRITE, &sig) == 0)
>> +		tst_res(TPASS, "Partial write (second half) succeeded");
>> +
>> +	SAFE_FSYNC(fd);
>> +
>> +	/* Read back in one operation */
>> +	memset(read_buf, 0, BLOCK_SZ);
>> +	io_uring_submit_sqe(&s, fd, IORING_OP_READ, read_buf, BLOCK_SZ, 0);
>> +	if (io_uring_wait_cqe(&s, BLOCK_SZ, IORING_OP_READ, &sig) == 0)
>> +		tst_res(TPASS, "Full read after partial writes succeeded");
>> +
>> +	/* Verify */
>> +	if (memcmp(write_buf, read_buf, BLOCK_SZ) == 0)
>> +		tst_res(TPASS, "Partial I/O data integrity verified");
>> +	else
>> +		tst_res(TFAIL, "Partial I/O data mismatch");
>> +
>> +	SAFE_CLOSE(fd);
>> +}
>> +
>> +static void run(void)
>> +{
>> +	io_uring_setup_queue(&s, QUEUE_DEPTH);
>> +	test_write_read();
>> +	test_partial_io();
>> +	io_uring_cleanup_queue(&s, QUEUE_DEPTH);
>> +}
>> +
>> +static void setup(void)
>> +{
>> +	io_uring_setup_supported_by_kernel();
>> +	sigemptyset(&sig);
>> +	memset(&s, 0, sizeof(s));
>> +}
>> +
>> +static struct tst_test test = {
>> +	.test_all = run,
>> +	.setup = setup,
>> +	.needs_tmpdir = 1,
>> +	.save_restore = (const struct tst_path_val[]) {
>> +		{"/proc/sys/kernel/io_uring_disabled", "0",
>> +			TST_SR_SKIP_MISSING | TST_SR_TCONF_RO},
>> +		{}
>> +	},
>> +	.tags = (const struct tst_tag[]) {
>> +		{"linux-git", "5d17b4a4b48c"},
> This commit does not appear to exist in linux kernel git tree.
I will double check on this. Thanks for the review.
>
>> +		{"linux-git", "2b188cc1bb85"},
> And this is a commit that added io_uring. Commit hashes in tests are
> used only for cases where the test is a regression test for some bug and
> point to a commit that fixed the problem.
Understood. Based on the review, I will then remove this code since this is
a new testcase to improve coverage and not a regression test.
>
>> +		{}
>> +	}
>> +};
>> diff --git a/testcases/kernel/syscalls/io_uring/io_uring_common.h b/testcases/kernel/syscalls/io_uring/io_uring_common.h
> Since you are pulling the common code into header it would be nice to
> convert the io_uring01.c so that it uses the common header as well.
>
Will address this in V2.

Thanks again for the review.

-- 
Thanks
- Sachin



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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-03-20  5:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-18 11:03 [LTP] [RFC] [PATCH 0/2] io_uring READ(V), WRITE(v) operation tests Sachin Sant
2026-03-18 11:03 ` [LTP] [RFC] [PATCH 1/2] io_uring: Test IORING READ and WRITE operations Sachin Sant
2026-03-19 16:49   ` Cyril Hrubis
2026-03-20  5:06     ` Sachin Sant
2026-03-18 11:03 ` [LTP] [RFC] [PATCH 2/2] io_uring: Test READV and WRITEV operations Sachin Sant

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox