mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
To: Martin KaFai Lau <martin.lau@linux.dev>,
	 Willem de Bruijn <willemdebruijn.kernel@gmail.com>,
	 "Abhishek Chauhan (ABC)" <quic_abchauha@quicinc.com>
Cc: kernel@quicinc.com,  Willem de Bruijn <willemb@google.com>,
	 "David S. Miller" <davem@davemloft.net>,
	 Eric Dumazet <edumazet@google.com>,
	 Jakub Kicinski <kuba@kernel.org>,
	 Paolo Abeni <pabeni@redhat.com>,
	 netdev@vger.kernel.org,  linux-kernel@vger.kernel.org,
	 Andrew Halaney <ahalaney@redhat.com>,
	 Martin KaFai Lau <martin.lau@kernel.org>,
	 Daniel Borkmann <daniel@iogearbox.net>,
	 bpf <bpf@vger.kernel.org>
Subject: Re: [PATCH bpf-next v8 1/3] net: Rename mono_delivery_time to tstamp_type for scalabilty
Date: Tue, 28 May 2024 16:15:01 -0400	[thread overview]
Message-ID: <66563b459e5de_2a7f7e2949d@willemb.c.googlers.com.notmuch> (raw)
In-Reply-To: <d1c18889-ef48-4cb8-8b81-474b3b7ddd81@linux.dev>

Martin KaFai Lau wrote:
> On 5/28/24 10:24 AM, Willem de Bruijn wrote:
> > Abhishek Chauhan (ABC) wrote:
> > 
> >>> +static inline void skb_set_delivery_type_by_clockid(struct sk_buff *skb,
> >>> +						    ktime_t kt, clockid_t clockid)
> >>> +{
> >>> +	u8 tstamp_type = SKB_CLOCK_REALTIME;
> >>> +
> >>> +	switch (clockid) {
> >>> +	case CLOCK_REALTIME:
> >>> +		break;
> >>> +	case CLOCK_MONOTONIC:
> >>> +		tstamp_type = SKB_CLOCK_MONOTONIC;
> >>> +		break;
> >>> +	default:
> >>
> >> Willem and Martin, I was thinking we should remove this warn_on_once from below line. Some systems also use panic on warn.
> >> So i think this might result in unnecessary crashes.
> >>
> >> Let me know what you think.
> >>
> >> Logs which are complaining.
> >> https://syzkaller.appspot.com/x/log.txt?x=118c3ae8980000
> > 
> > I received reports too. Agreed that we need to fix these reports.
> > 
> > The alternative is to limit sk_clockid to supported ones, by failing
> > setsockopt SO_TXTIME on an unsupported clock.
> > 
> > That changes established ABI behavior. But I don't see how another
> > clock can be used in any realistic way anyway.
> > 
> > Putting it out there as an option. It's riskier, but in the end I
> > believe a better fix than just allowing this state to continue.
> 
> Failing early would be my preference also. The current ABI is arguably at least 
> confusing (if not broken) considering other clockid is silently ignored by the 
> kernel.
>
> > 
> > A third option would be to not fail the system call, but silently
> > fall back to CLOCK_REALTIME. Essentially what happens in the datapath
> > in skb_set_delivery_type_by_clockid now. That is surprising behavior,
> > we should not do that.
> 
> Not sure if it makes sense to go back to this option only after there is 
> breakage report with a legit usage?

Agreed. We cannot break users. But I don't see how there are real
users for the current permissive API.



  parent reply	other threads:[~2024-05-28 20:15 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-09 21:18 [PATCH bpf-next v8 0/3] Replace mono_delivery_time with tstamp_type Abhishek Chauhan
2024-05-09 21:18 ` [PATCH bpf-next v8 1/3] net: Rename mono_delivery_time to tstamp_type for scalabilty Abhishek Chauhan
2024-05-28 15:35   ` Abhishek Chauhan (ABC)
2024-05-28 17:24     ` Willem de Bruijn
2024-05-28 18:58       ` Abhishek Chauhan (ABC)
2024-05-28 19:30       ` Martin KaFai Lau
2024-05-28 20:11         ` Abhishek Chauhan (ABC)
2024-05-28 20:15         ` Willem de Bruijn [this message]
2024-05-09 21:18 ` [PATCH bpf-next v8 2/3] net: Add additional bit to support clockid_t timestamp type Abhishek Chauhan
2024-05-09 21:18 ` [PATCH bpf-next v8 3/3] selftests/bpf: Handle forwarding of UDP CLOCK_TAI packets Abhishek Chauhan
2024-05-23 21:20 ` [PATCH bpf-next v8 0/3] Replace mono_delivery_time with tstamp_type patchwork-bot+netdevbpf

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=66563b459e5de_2a7f7e2949d@willemb.c.googlers.com.notmuch \
    --to=willemdebruijn.kernel@gmail.com \
    --cc=ahalaney@redhat.com \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kernel@quicinc.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin.lau@kernel.org \
    --cc=martin.lau@linux.dev \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=quic_abchauha@quicinc.com \
    --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

all inboxes | Powered by JetHome®