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