Skip to contentSkip to conversation

syscall: Add io_uring test

PATCH New Vikas Kumar 3 participants 6 messages May 14, 2020 – May 18, 2020

lore
Share & tools
lore
#0 lore raw

v4 cover syscall: Add io_uring test

Added Linux asynchronous I/O API Test for io_uring_setup(), io_uring_register() and io_uring_enter(). This test intend to check basic io_uring api operation.

io_uring_setup() creates submission queue and completion queue to perform subsequent operations on the io_uring instance. io_uring_register() registers user buffers to kernel for long term usese. io_uring_enter() initiate and finish I/O using the shared sq and cq queue.

---

---

Vikas Kumar (1):
syscall: Add io_uring test

 testcases/kernel/syscalls/io_uring/Makefile   |   8 +
 .../kernel/syscalls/io_uring/io_uring01.c     | 191 ++++++++++++++++++
 2 files changed, 199 insertions(+)
 create mode 100644 testcases/kernel/syscalls/io_uring/Makefile
 create mode 100644 testcases/kernel/syscalls/io_uring/io_uring01.c
Signature · 1 line
2.17.1
#1 lore raw

PATCH v4 1/1 syscall: Add io_uring test

Added Linux asynchronous I/O API Test for io_uring_setup(), io_uring_register() and io_uring_enter().
This test will check io_uring api basic operation.

---
 testcases/kernel/syscalls/io_uring/Makefile   |   8 +
 .../kernel/syscalls/io_uring/io_uring01.c     | 191 ++++++++++++++++++
 2 files changed, 199 insertions(+)
 create mode 100644 testcases/kernel/syscalls/io_uring/Makefile
 create mode 100644 testcases/kernel/syscalls/io_uring/io_uring01.c
testcases/kernel/syscalls/io_uring/Makefile new file +8 -0
new file mode 100644
index 000000000..24cd01ba8
@@ -0,0 +1,8 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (C) 2020 ARM Embedded Technologies Private Ltd. All rights reserved.
+
+top_srcdir		?= ../../../..
+
+include $(top_srcdir)/include/mk/testcases.mk
+
+include $(top_srcdir)/include/mk/generic_leaf_target.mk
testcases/kernel/syscalls/io_uring/io_uring01.c new file +190 -0

190 lines not on this page · raw message

Signature · 1 line
2.17.1
#2 lore raw

PATCH v4 1/1 syscall: Add io_uring test

Quoted 6 lines · Vikas Kumar

Added Linux asynchronous I/O API Test for io_uring_setup(), io_uring_register() and io_uring_enter().
This test will check io_uring api basic operation.

Please don't do this unless someone gave you this explicitly.

Quoted 6 lines
testcases/kernel/syscalls/io_uring/io_uring01.c +5 -0
+int setup_io_uring_test(struct submitter *s)
+{
+	struct io_sq_ring *sring = &s->sq_ring;
+	struct io_cq_ring *cring = &s->cq_ring;
+	struct io_uring_params p;

testcases/kernel/syscalls/io_uring/io_uring01.c line 74

Quoted 10 lines
testcases/kernel/syscalls/io_uring/io_uring01.c +10 -0
+	void *ptr;
+
+	memset(&p, 0, sizeof(p));
+	s->ring_fd = io_uring_setup(QUEUE_DEPTH, &p);
+	if (s->ring_fd == -1) {
+		tst_res(TFAIL | TTERRNO, "io_uring setup return error");
+		return 1;
+	}
+
+	//submission queue ring buffer mapping

You need to follow kernel coding guidelines everywhere in the code here and so no such comments. Try to run checkpatch on this file with --strict option and you will see the problems..

This API is new and you also need to implement something like fsopen_supported_by_kernel().

I didn't do in depth reviews though..

Signature · 1 line
viresh
#3 lore raw

PATCH v4 1/1 syscall: Add io_uring test

Hi,

Quoted 9 lines · Vikas Kumar
Quoted 6 lines

Added Linux asynchronous I/O API Test for io_uring_setup(), io_uring_register() and io_uring_enter().
This test will check io_uring api basic operation.

Please don't do this unless someone gave you this explicitly.

+1. By this you say Cyril considered your patch ready, which is not true. Just on a brief look I see there needed to be some changes.

Kind regards,
Petr

#4 lore raw

PATCH v4 1/1 syscall: Add io_uring test

In reply to Viresh Kumar

On 15/05/20 9:38 am, Viresh Kumar wrote:

On 14-05-20, 22:58, Vikas Kumar wrote:

Added Linux asynchronous I/O API Test for io_uring_setup(), io_uring_register() and io_uring_enter().
This test will check io_uring api basic operation.

Please don't do this unless someone gave you this explicitly.

Sure I will remove it in next patch set its my mistake.

Thank you Viresh, Petr and Cyril for correcting my mistake.

testcases/kernel/syscalls/io_uring/io_uring01.c +0 -0

+int setup_io_uring_test(struct submitter *s)
+{

+       struct io_sq_ring *sring = &s->sq_ring;
+       struct io_cq_ring *cring = &s->cq_ring;
+       struct io_uring_params p;
+       void *ptr;
+
+       memset(&p, 0, sizeof(p));
+       s->ring_fd = io_uring_setup(QUEUE_DEPTH, &p);
+       if (s->ring_fd == -1) {

+ tst_res(TFAIL | TTERRNO, "io_uring setup return error");
+ return 1;
+ }
+
+ //submission queue ring buffer mapping

You need to follow kernel coding guidelines everywhere in the code here and so no such comments. Try to run checkpatch on this file with --strict option and you will see the problems..

This API is new and you also need to implement something like fsopen_supported_by_kernel().

I didn't do in depth reviews though..

I will implement io_uring_supported_by_kernel() and checkpatch with --strict option and send In next patch.

struct io_sq_ring, struct io_cq_ring and struct submitter

Cyril: These are local structure although derived from kernel structure so it can be local in this file in place of lapi/io_uring.h

IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you. -------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20200518/ed930870/attachment.htm>

#5 lore raw

PATCH v4 1/1 syscall: Add io_uring test

On 18-05-20, 10:03, Vikas Kumar wrote:

You reply isn't readable at all Vikas. Please read the kernel documentation on how the discussion happens over mailing lists and about not doing top-posting, importance of ">" character during a reply etc. Take help of some ARM friends who may have already done that earlier.

Signature · 1 line
viresh