public inbox for [email protected]
 help / color / mirror / Atom feed
* [RFC 0/3] io_uring zerocopy receive
@ 2022-01-24  9:43 Hao Xu
  2022-01-24  9:43 ` [PATCH 1/3] net-zerocopy: split zerocopy receive to several parts Hao Xu
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Hao Xu @ 2022-01-24  9:43 UTC (permalink / raw)
  To: netdev, io-uring
  Cc: Jens Axboe, Pavel Begunkov, Eric Dumazet, David S . Miller,
	Jakub Kicinski, Hideaki YOSHIFUJI, David Ahern, Joseph Qi

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


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

end of thread, other threads:[~2022-01-24 15:43 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-24  9:43 [RFC 0/3] io_uring zerocopy receive Hao Xu
2022-01-24  9:43 ` [PATCH 1/3] net-zerocopy: split zerocopy receive to several parts Hao Xu
2022-01-24 14:09   ` kernel test robot
2022-01-24  9:43 ` [PATCH 2/3] net-zerocopy: remove static for tcp_zerocopy_receive() Hao Xu
2022-01-24  9:43 ` [PATCH 3/3] io_uring: zerocopy receive Hao Xu
2022-01-24 15:01   ` kernel test robot
2022-01-24 15:42   ` kernel test robot

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