[RFC 0/3] io_uring zerocopy receive

Hao Xu
2022-01-24T09:43:35Z

Integrate the current zerocopy receive solution to io_uring for eazier
use. The current calling process is:
1) mmap a range of virtual address
2) poll() to wait for data ready of the sockfd
3) call getsockopt() to map the address in 1) to physical pages
4) access the data.

By integrating it to io_uring, 2) and 3) can be merged:
1) mmap a range of virtual address
2) prepare a sqe and submit
3) get a cqe which indicates data is ready and mapped
4) access the data

which reduce one system call and make users be unaware of 3)

Also provide a test case which basically reuses
tools/testing/selftests/net/tcp_mmap.c:
https://github.com/HowHsu/liburing/tree/zc_receive

server side:
taskset -c 1-2 ./zc_receive -s -4 -z -M $((4096+12))

client side:
taskset -c 3 ./tcp_mmap -H '127.0.0.1' -z -4 -M $((4096+12))

no much difference of the result since no functionality change.

Hao Xu (3):
net-zerocopy: split zerocopy receive to several parts
net-zerocopy: remove static for tcp_zerocopy_receive()
io_uring: zerocopy receive

fs/io_uring.c | 72 ++++++++++++++++++
include/net/tcp.h | 8 ++
include/uapi/linux/io_uring.h | 1 +
net/ipv4/tcp.c | 134 ++++++++++++++++++++--------------
4 files changed, 159 insertions(+), 56 deletions(-)

--
2.25.1