From: "Abhishek Chauhan (ABC)" <quic_abchauha@quicinc.com>
To: Martin KaFai Lau <martin.lau@linux.dev>,
Willem de Bruijn <willemdebruijn.kernel@gmail.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 13:11:58 -0700 [thread overview]
Message-ID: <c7d66e70-0998-4e2b-94e8-8b19e65ec959@quicinc.com> (raw)
In-Reply-To: <d1c18889-ef48-4cb8-8b81-474b3b7ddd81@linux.dev>
On 5/28/2024 12:30 PM, 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.
>
Okay since we all agree to fix the setsockopt SO_TXTIME to only limit sk_clockid be set to supported ones (MONO/TAI/REAL).
All other clocks needs to return -EINVAL for setsockopt.
I will raise the patch and also add the fixes and reported-by tag accordingly.
>>
>> 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?
>
next prev parent reply other threads:[~2024-05-28 20:12 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) [this message]
2024-05-28 20:15 ` Willem de Bruijn
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=c7d66e70-0998-4e2b-94e8-8b19e65ec959@quicinc.com \
--to=quic_abchauha@quicinc.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=willemb@google.com \
--cc=willemdebruijn.kernel@gmail.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®