[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <09f51486-5c27-6fd8-d3c5-0edadef30f81@gmail.com>
Date: Tue, 11 Apr 2023 13:39:34 +0100
From: Pavel Begunkov <asml.silence@...il.com>
To: Breno Leitao <leitao@...ian.org>, Keith Busch <kbusch@...nel.org>
Cc: axboe@...nel.dk, davem@...emloft.net, dccp@...r.kernel.org,
dsahern@...nel.org, edumazet@...gle.com, io-uring@...r.kernel.org,
kuba@...nel.org, leit@...com, linux-kernel@...r.kernel.org,
marcelo.leitner@...il.com, matthieu.baerts@...sares.net,
mptcp@...ts.linux.dev, netdev@...r.kernel.org, pabeni@...hat.com,
willemdebruijn.kernel@...il.com
Subject: Re: [PATCH RFC] io_uring: Pass whole sqe to commands
On 4/11/23 13:22, Breno Leitao wrote:
> On Fri, Apr 07, 2023 at 12:51:44PM -0600, Keith Busch wrote:
>>> @@ -63,14 +63,15 @@ EXPORT_SYMBOL_GPL(io_uring_cmd_done);
>>> int io_uring_cmd_prep_async(struct io_kiocb *req)
>>> {
>>> struct io_uring_cmd *ioucmd = io_kiocb_to_cmd(req, struct io_uring_cmd);
>>> - size_t cmd_size;
>>> + size_t size = sizeof(struct io_uring_sqe);
>>>
>>> BUILD_BUG_ON(uring_cmd_pdu_size(0) != 16);
>>> BUILD_BUG_ON(uring_cmd_pdu_size(1) != 80);
>>
>> One minor suggestion. The above is the only user of uring_cmd_pdu_size() now,
>> which is kind of a convoluted way to enfoce the offset of the 'cmd' field. It
>> may be more clear to replace these with:
>
> I agree with you here. Basically it is a bug if the payload (pdu) size is
> is different than 16 for single SQE or != 80 for extended SQE.
>
> So, basically it is checking for two things:
> * the cmd offset is 48
> * the io_uring_sqe struct is 64
>
> Since this is a uapi, I am not confidence that they will change at all.
> I can replace the code with your suggestion.
>
>> BUILD_BUG_ON(offsetof(struct io_uring_sqe, cmd) == 48);
>
> It should be "offset(struct io_uring_sqe, cmd) != 48)", right?
Which is already checked, see io_uring_init()
--
Pavel Begunkov
Powered by blists - more mailing lists