Linux io-uring development
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Pavel Begunkov <asml.silence@gmail.com>,
	David Wei <dw@davidwei.uk>,
	io-uring@vger.kernel.org
Subject: Re: [PATCH v2 1/2] io_uring/zcrx: add single shot recvzc
Date: Fri, 21 Feb 2025 18:07:47 -0700	[thread overview]
Message-ID: <16aef2a7-d20e-48a1-aa5d-747619c8a2c9@kernel.dk> (raw)
In-Reply-To: <f8409430-a83d-4bda-a654-3f9bedb36bbc@gmail.com>

On 2/21/25 6:01 PM, Pavel Begunkov wrote:
> On 2/22/25 00:08, Jens Axboe wrote:
>> Just a few minor drive-by nits.
>>
>>> @@ -1250,6 +1251,12 @@ int io_recvzc_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)
>>>       zc->ifq = req->ctx->ifq;
>>>       if (!zc->ifq)
>>>           return -EINVAL;
>>> +    zc->len = READ_ONCE(sqe->len);
>>> +    if (zc->len == UINT_MAX)
>>> +        return -EINVAL;
>>> +    /* UINT_MAX means no limit on readlen */
>>> +    if (!zc->len)
>>> +        zc->len = UINT_MAX;
>>
>> Why not just make UINT_MAX allowed, meaning no limit? Would avoid two
>> branches here, and as far as I can tell not really change anything in
>> terms of API niceness.
> 
> I think 0 goes better as a special uapi value. It doesn't alter the
> uapi, and commonly understood as "no limits", which is the opposite
> to the other option, especially since UINT_MAX is not a max value for
> an unlimited request, I'd easily expect it to drive more than 4GB.

Yeah that's certainly better, and as you say also has the same (forced)
semantics for multishot.

-- 
Jens Axboe

  reply	other threads:[~2025-02-22  1:07 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-21 20:51 [PATCH v2 0/2] io_uring zc rx fixed len recvzc David Wei
2025-02-21 20:51 ` [PATCH v2 1/2] io_uring/zcrx: add single shot recvzc David Wei
2025-02-22  0:08   ` Jens Axboe
2025-02-22  1:01     ` Pavel Begunkov
2025-02-22  1:07       ` Jens Axboe [this message]
2025-02-23 22:35         ` David Wei
2025-02-24 12:49           ` Pavel Begunkov
2025-02-23 22:39     ` David Wei
2025-02-22  0:40   ` Pavel Begunkov
2025-02-22  0:52     ` Jens Axboe
2025-02-22  1:06       ` Pavel Begunkov
2025-02-22  1:09         ` Jens Axboe
2025-02-22  1:15           ` Pavel Begunkov
2025-02-22  1:09         ` Pavel Begunkov
2025-02-23 22:43     ` David Wei
2025-02-22  0:56   ` Pavel Begunkov
2025-02-23 22:44     ` David Wei
2025-02-22  8:54   ` lizetao
2025-02-24  0:17     ` David Wei
2025-02-21 20:51 ` [PATCH v2 2/2] io_uring/zcrx: add selftest case for " David Wei

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 \
    --in-reply-to=16aef2a7-d20e-48a1-aa5d-747619c8a2c9@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=asml.silence@gmail.com \
    --cc=dw@davidwei.uk \
    --cc=io-uring@vger.kernel.org \
    /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