From: Jens Axboe <axboe@kernel.dk>
To: Pavel Begunkov <asml.silence@gmail.com>,
io-uring@vger.kernel.org,
Vadim Fedorenko <vadim.fedorenko@linux.dev>
Cc: netdev@vger.kernel.org, Eric Dumazet <edumazet@google.com>,
Kuniyuki Iwashima <kuniyu@amazon.com>,
Paolo Abeni <pabeni@redhat.com>,
Willem de Bruijn <willemb@google.com>,
"David S . Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
Richard Cochran <richardcochran@gmail.com>,
Stanislav Fomichev <sdf@fomichev.me>,
Jason Xing <kerneljasonxing@gmail.com>
Subject: Re: [PATCH v3 5/5] io_uring/netcmd: add tx timestamping cmd support
Date: Thu, 12 Jun 2025 08:31:33 -0600 [thread overview]
Message-ID: <ae60dd48-9e21-4a9d-a8d8-d98a2e8e6c8f@kernel.dk> (raw)
In-Reply-To: <7bfe8094-17d7-47d0-bb13-eec0621d813d@gmail.com>
On 6/12/25 8:26 AM, Pavel Begunkov wrote:
>>> diff --git a/include/uapi/linux/io_uring.h b/include/uapi/linux/io_uring.h
>>> index cfd17e382082..5c89e6f6d624 100644
>>> --- a/include/uapi/linux/io_uring.h
>>> +++ b/include/uapi/linux/io_uring.h
>>> @@ -968,6 +968,15 @@ enum io_uring_socket_op {
>>> SOCKET_URING_OP_SIOCOUTQ,
>>> SOCKET_URING_OP_GETSOCKOPT,
>>> SOCKET_URING_OP_SETSOCKOPT,
>>> + SOCKET_URING_OP_TX_TIMESTAMP,
>>> +};
>>> +
>>> +#define IORING_CQE_F_TIMESTAMP_HW ((__u32)1 << IORING_CQE_BUFFER_SHIFT)
>>> +#define IORING_TIMESTAMP_TSTYPE_SHIFT (IORING_CQE_BUFFER_SHIFT + 1)
>>
>> Don't completely follow this, would at the very least need a comment.
>> Whether it's a HW or SW timestamp is flagged in the upper 16 bits, just
>> like a provided buffer ID. But since we don't use buffer IDs here, then
>> it's up for grabs. Do we have other commands that use the upper flags
>> space for command private flags?
>
> Probably not, but the place is better than the lower half, which
> has common flags like F_MORE, especially since the patch is already
> using it to store the type.
Just pondering whether it should be formalized, but probably no point as
each opcode should be free to use the space as it wants.
>> The above makes sense, but then what is IORING_TIMESTAMP_TSTYPE_SHIFT?
>
> It's a shift for where the timestamp type is stored, HW vs SW is
> not a timestamp type. I don't get the question.
Please add a spec like comment on top of it explaining the usage of the
upper bits in the flags field, then. I try to keep the io_uring.h uapi
header pretty well commented and documented.
--
Jens Axboe
next prev parent reply other threads:[~2025-06-12 14:31 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-12 9:09 [PATCH v3 0/5] io_uring cmd for tx timestamps Pavel Begunkov
2025-06-12 9:09 ` [PATCH v3 1/5] net: timestamp: add helper returning skb's tx tstamp Pavel Begunkov
2025-06-12 21:20 ` Willem de Bruijn
2025-06-12 9:09 ` [PATCH v3 2/5] io_uring/poll: introduce io_arm_apoll() Pavel Begunkov
2025-06-12 9:09 ` [PATCH v3 3/5] io_uring/cmd: allow multishot polled commands Pavel Begunkov
2025-06-12 9:09 ` [PATCH v3 4/5] io_uring: add mshot helper for posting CQE32 Pavel Begunkov
2025-06-12 9:09 ` [PATCH v3 5/5] io_uring/netcmd: add tx timestamping cmd support Pavel Begunkov
2025-06-12 14:12 ` Jens Axboe
2025-06-12 14:26 ` Pavel Begunkov
2025-06-12 14:31 ` Jens Axboe [this message]
2025-06-12 15:01 ` Pavel Begunkov
2025-06-12 21:35 ` Willem de Bruijn
2025-06-13 18:29 ` Pavel Begunkov
2025-06-12 9:15 ` [PATCH v3 0/5] io_uring cmd for tx timestamps Pavel Begunkov
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=ae60dd48-9e21-4a9d-a8d8-d98a2e8e6c8f@kernel.dk \
--to=axboe@kernel.dk \
--cc=asml.silence@gmail.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=io-uring@vger.kernel.org \
--cc=kerneljasonxing@gmail.com \
--cc=kuba@kernel.org \
--cc=kuniyu@amazon.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=richardcochran@gmail.com \
--cc=sdf@fomichev.me \
--cc=vadim.fedorenko@linux.dev \
--cc=willemb@google.com \
/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