public inbox for [email protected]
 help / color / mirror / Atom feed
From: David Wei <[email protected]>
To: [email protected]
Cc: Jens Axboe <[email protected]>,
	Pavel Begunkov <[email protected]>,
	lizetao <[email protected]>
Subject: [PATCH v3 0/2] io_uring/zcrx: recvzc read limit
Date: Sun, 23 Feb 2025 20:13:17 -0800	[thread overview]
Message-ID: <[email protected]> (raw)

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


             reply	other threads:[~2025-02-24  4:13 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-24  4:13 David Wei [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox