Welcome! Log In Create A New Profile

Advanced

[PATCH 2 of 8] Added variables and defined a new flag for io_uring module

SoYun Seong
November 24, 2020 03:46AM
# HG changeset patch
# User SoYun Seong <thdbsdox12@gmail.com>
# Date 1606128433 0
# Mon Nov 23 10:47:13 2020 +0000
# Node ID 3bbe4905410b04bdaad4c956f6fdb7d0612ddf5b
# Parent 1cb2b354e262e10a8e8606e238ca0fa279f70709
Added variables and defined a new flag for io_uring module.

For io_uring event module, added member variables to ngx_event_s structure. ‘uring_res’ is used to pass the result of IO to a read or write event. ‘uring_pending’ means the total requested IO count of the event and ‘uring_rq_size’ means the total IO size of the event. Both variables is used to check completion of the request. ‘uring_iov’ is used to do asynchronous vector IO. ‘uring_splice_pipe’ is used to process asynchronous sendfile. Also added an io_uring event flag and defined requested IO type for io_uring.

diff -r 1cb2b354e262 -r 3bbe4905410b src/event/ngx_event.h
--- a/src/event/ngx_event.h Mon Nov 23 10:08:50 2020 +0000
+++ b/src/event/ngx_event.h Mon Nov 23 10:47:13 2020 +0000
@@ -107,6 +107,14 @@
ngx_event_ovlp_t ovlp;
#endif

+#if (NGX_HAVE_URING)
+ int uring_res;
+ ngx_uint_t uring_pending;
+ ssize_t uring_rq_size;
+ struct iovec uring_iov[NGX_IOVS_PREALLOCATE];
+ int uring_splice_pipe[2];
+#endif
+
ngx_uint_t index;

ngx_log_t *log;
@@ -271,6 +279,11 @@
*/
#define NGX_USE_VNODE_EVENT 0x00002000

+/*
+ * The event filter is io_uring.
+ */
+#define NGX_USE_URING_EVENT 0x00004000
+

/*
* The event filter is deleted just before the closing file.
@@ -390,6 +403,19 @@
#define NGX_IOCP_CONNECT 2
#endif

+#if (NGX_HAVE_URING)
+#define NGX_URING_ACCEPT 0
+#define NGX_URING_READ 1
+#define NGX_URING_READV 2
+#define NGX_URING_SEND 3
+#define NGX_URING_WRITEV 4
+#define NGX_URING_SPLICE_TO_PIPE 5
+#define NGX_URING_SPLICE_FROM_PIPE 6
+#define NGX_URING_READFILE 7
+#define NGX_URING_TIMEOUT 1
+#define NGX_USE_URING_SPLICE 0
+#endif
+

#if (NGX_TEST_BUILD_EPOLL)
#define NGX_EXCLUSIVE_EVENT 0
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[PATCH 2 of 8] Added variables and defined a new flag for io_uring module

SoYun Seong 288 November 24, 2020 03:46AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 222
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready