From: Martin KaFai Lau <martin.lau@linux.dev>
To: "Jörn-Thorben Hinz" <j-t.hinz@alumni.tu-berlin.de>
Cc: Willem de Bruijn <willemdebruijn.kernel@gmail.com>,
Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Andrii Nakryiko <andrii@kernel.org>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Shuah Khan <shuah@kernel.org>, Arnd Bergmann <arnd@arndb.de>,
Deepa Dinamani <deepa.kernel@gmail.com>,
bpf@vger.kernel.org, linux-kernel@vger.kernel.org,
netdev@vger.kernel.org, linux-kselftest@vger.kernel.org
Subject: Re: [PATCH bpf-next] bpf: Allow setting SO_TIMESTAMPING* with bpf_setsockopt()
Date: Tue, 16 Jan 2024 23:33:39 -0800 [thread overview]
Message-ID: <51fd5249-140a-4f1b-b20e-703f159e88a3@linux.dev> (raw)
In-Reply-To: <65a69e1be51ef_380df0294d9@willemb.c.googlers.com.notmuch>
On 1/16/24 7:17 AM, Willem de Bruijn wrote:
> Jörn-Thorben Hinz wrote:
>> A BPF application, e.g., a TCP congestion control, might benefit from or
>> even require precise (=hardware) packet timestamps. These timestamps are
>> already available through __sk_buff.hwtstamp and
>> bpf_sock_ops.skb_hwtstamp, but could not be requested: BPF programs were
>> not allowed to set SO_TIMESTAMPING* on sockets.
This patch only uses the SOF_TIMESTAMPING_RX_HARDWARE in the selftest. How about
others? e.g. the SOF_TIMESTAMPING_TX_* that will affect the sk->sk_error_queue
which seems not good. If rx tstamp is useful, tx tstamp should be useful also?
>>
>> Enable BPF programs to actively request the generation of timestamps
>> from a stream socket. The also required ioctl(SIOCSHWTSTAMP) on the
>> network device must still be done separately, in user space.
hmm... so both ioctl(SIOCSHWTSTAMP) of the netdevice and the
SOF_TIMESTAMPING_RX_HARDWARE of the sk must be done?
I likely miss something. When skb is created in the driver rx path, the sk is
not known yet though. How the SOF_TIMESTAMPING_RX_HARDWARE of the sk affects the
skb_shinfo(skb)->hwtstamps?
next prev parent reply other threads:[~2024-01-17 7:33 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-15 13:41 [PATCH bpf-next] bpf: Allow setting SO_TIMESTAMPING* with bpf_setsockopt() Jörn-Thorben Hinz
2024-01-16 15:17 ` Willem de Bruijn
2024-01-17 7:33 ` Martin KaFai Lau [this message]
2024-01-17 15:55 ` Willem de Bruijn
2024-01-17 21:23 ` Martin KaFai Lau
2024-01-18 14:53 ` Jörn-Thorben Hinz
2024-01-18 11:04 ` Jörn-Thorben Hinz
2024-01-18 14:46 ` 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=51fd5249-140a-4f1b-b20e-703f159e88a3@linux.dev \
--to=martin.lau@linux.dev \
--cc=andrii@kernel.org \
--cc=arnd@arndb.de \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=deepa.kernel@gmail.com \
--cc=edumazet@google.com \
--cc=j-t.hinz@alumni.tu-berlin.de \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=shuah@kernel.org \
--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;
as well as URLs for NNTP newsgroup(s).