public inbox for io-uring@vger.kernel.org
 help / color / mirror / Atom feed
From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
To: Pavel Begunkov <asml.silence@gmail.com>,
	 Willem de Bruijn <willemdebruijn.kernel@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 v4 1/5] net: timestamp: add helper returning skb's tx tstamp
Date: Mon, 16 Jun 2025 10:58:13 -0400	[thread overview]
Message-ID: <685031054a4b2_20ce86294c8@willemb.c.googlers.com.notmuch> (raw)
In-Reply-To: <560f6cd7-f66e-43ca-b458-ae362d0779de@gmail.com>

Pavel Begunkov wrote:
> On 6/16/25 03:31, Willem de Bruijn wrote:
> > Pavel Begunkov wrote:
> >> Add a helper function skb_get_tx_timestamp() that returns a tx timestamp
> >> associated with an error queue skb.
> >>
> >> Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
> >> ---
> >>   include/net/sock.h |  9 +++++++++
> >>   net/socket.c       | 46 ++++++++++++++++++++++++++++++++++++++++++++++
> >>   2 files changed, 55 insertions(+)
> >>
> >> diff --git a/include/net/sock.h b/include/net/sock.h
> >> index 92e7c1aae3cc..0b96196d8a34 100644
> >> --- a/include/net/sock.h
> >> +++ b/include/net/sock.h
> >> @@ -2677,6 +2677,15 @@ void __sock_recv_timestamp(struct msghdr *msg, struct sock *sk,
> >>   void __sock_recv_wifi_status(struct msghdr *msg, struct sock *sk,
> >>   			     struct sk_buff *skb);
> >>   
> >> +enum {
> >> +	NET_TIMESTAMP_ORIGIN_SW		= 0,
> >> +	NET_TIMESTAMP_ORIGIN_HW		= 1,
> >> +};
> > 
> > Can you avoid introducing a new enum, and instead just return
> > SOF_TIMESTAMPING_TX_HARDWARE (1) or SOF_TIMESTAMPING_TX_SOFTWARE (2)?
> 
> I can't say I like it more because TX_{SW,HW} is just a small
> subset of SOF_TIMESTAMPING_* flags and the caller by default
> could assume that there might be other values as well, but let
> me send v5 and we'll see which is better.

This is quite a lot of new timestamping logic for only io_uring as
user, and I don't see any other user of it coming soon. I also see no
easy way to make it more concise, so it's fine. But this at least
avoids one extra new enum.

  reply	other threads:[~2025-06-16 14:58 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-13 18:32 [PATCH v4 0/5] io_uring cmd for tx timestamps Pavel Begunkov
2025-06-13 18:32 ` [PATCH v4 1/5] net: timestamp: add helper returning skb's tx tstamp Pavel Begunkov
2025-06-16  2:31   ` Willem de Bruijn
2025-06-16  9:44     ` Pavel Begunkov
2025-06-16 14:58       ` Willem de Bruijn [this message]
2025-06-16 16:44         ` Pavel Begunkov
2025-06-13 18:32 ` [PATCH v4 2/5] io_uring/poll: introduce io_arm_apoll() Pavel Begunkov
2025-06-13 18:32 ` [PATCH v4 3/5] io_uring/cmd: allow multishot polled commands Pavel Begunkov
2025-06-13 18:32 ` [PATCH v4 4/5] io_uring: add mshot helper for posting CQE32 Pavel Begunkov
2025-06-13 18:32 ` [PATCH v4 5/5] io_uring/netcmd: add tx timestamping cmd support Pavel Begunkov
2025-06-16  2:33   ` Willem de Bruijn

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=685031054a4b2_20ce86294c8@willemb.c.googlers.com.notmuch \
    --to=willemdebruijn.kernel@gmail.com \
    --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