public inbox for [email protected]
 help / color / mirror / Atom feed
* [PATCH v3 0/2] io_uring/zcrx: recvzc read limit
@ 2025-02-24  4:13 David Wei
  2025-02-24  4:13 ` [PATCH v3 1/2] io_uring/zcrx: add a read limit to recvzc requests David Wei
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: David Wei @ 2025-02-24  4:13 UTC (permalink / raw)
  To: io-uring; +Cc: Jens Axboe, Pavel Begunkov, lizetao

Currently multishot recvzc requests have no read limit and will remain
active so as long as the socket remains open. But, there are sometimes a
need to do a fixed length read e.g. peeking at some data in the socket.

Add a length limit to recvzc requests `len`. A value of 0 means no limit
which is the previous behaviour. A positive value N specifies how many
bytes to read from the socket.

Also add a new selftest case.

Changes in v3:
--------------
* Remove all references to 'singleshot'
* Use 0 to mean no limit
* Remove unused var `limit`
* Complete recvzc req early when len == 0
* Revert return codes in io_zcrx_tcp_recvmsg()
* Check explicitly that ret > 0

Changes in v2:
--------------
* Consistently use u32/unsigned int for len
* Remove nowait semantics, request will not complete until requested len
  has been received
* Always set REQ_F_APOLL_MULTISHOT
* Fix return codes from io_recvzc request
* Fix changing len if set to UINT_MAX in io_zcrx_recv_skb()
* Use read_desc->count

David Wei (2):
  io_uring/zcrx: add a read limit to recvzc requests
  io_uring/zcrx: add selftest case for recvzc with read limit

 io_uring/net.c                                | 16 +++++--
 io_uring/zcrx.c                               | 13 ++++--
 io_uring/zcrx.h                               |  2 +-
 .../selftests/drivers/net/hw/iou-zcrx.c       | 43 ++++++++++++++++---
 .../selftests/drivers/net/hw/iou-zcrx.py      | 27 +++++++++++-
 5 files changed, 85 insertions(+), 16 deletions(-)

-- 
2.43.5


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

end of thread, other threads:[~2025-02-24 22:38 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-24  4:13 [PATCH v3 0/2] io_uring/zcrx: recvzc read limit David Wei
2025-02-24  4:13 ` [PATCH v3 1/2] io_uring/zcrx: add a read limit to recvzc requests David Wei
2025-02-24 13:11   ` Pavel Begunkov
2025-02-24 15:46     ` David Wei
2025-02-24  4:13 ` [PATCH v3 2/2] io_uring/zcrx: add selftest case for recvzc with read limit David Wei
2025-02-24 14:35 ` [PATCH v3 0/2] io_uring/zcrx: recvzc " Jens Axboe
2025-02-24 19:56   ` Jens Axboe
2025-02-24 20:33     ` David Wei
2025-02-24 22:38       ` Jens Axboe

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