From: "Toke Høiland-Jørgensen" <toke@kernel.org>
To: xiangxia.m.yue@gmail.com, netdev@vger.kernel.org, bpf@vger.kernel.org
Cc: Tonghao Zhang <xiangxia.m.yue@gmail.com>,
Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Andrii Nakryiko <andrii@kernel.org>,
Martin KaFai Lau <kafai@fb.com>, Song Liu <songliubraving@fb.com>,
Yonghong Song <yhs@fb.com>,
John Fastabend <john.fastabend@gmail.com>,
KP Singh <kpsingh@kernel.org>, Jiri Olsa <jolsa@kernel.org>,
Dave Marchevsky <davemarchevsky@fb.com>,
Kuniyuki Iwashima <kuniyu@amazon.co.jp>,
Joanne Koong <joannekoong@fb.com>,
Geliang Tang <geliang.tang@suse.com>,
"David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
Eric Dumazet <edumazet@google.com>
Subject: Re: [net-next v1] bpf: add bpf_ktime_get_real_ns helper
Date: Wed, 20 Apr 2022 14:53:01 +0200 [thread overview]
Message-ID: <878rrzj4r6.fsf@toke.dk> (raw)
In-Reply-To: <20220420122307.5290-1-xiangxia.m.yue@gmail.com>
xiangxia.m.yue@gmail.com writes:
> From: Tonghao Zhang <xiangxia.m.yue@gmail.com>
>
> This patch introduce a new bpf_ktime_get_real_ns helper, which may
> help us to measure the skb latency in the ingress/forwarding path:
>
> HW/SW[1] -> ip_rcv/tcp_rcv_established -> tcp_recvmsg_locked/tcp_update_recv_tstamps
>
> * Insert BPF kprobe into ip_rcv/tcp_rcv_established invoking this helper.
> Then we can inspect how long time elapsed since HW/SW.
> * If inserting BPF kprobe tcp_update_recv_tstamps invoked by tcp_recvmsg,
> we can measure how much latency skb in tcp receive queue. The reason for
> this can be application fetch the TCP messages too late.
Why not just use one of the existing ktime helpers and also add a BPF
probe to set the initial timestamp instead of relying on skb->tstamp?
-Toke
next prev parent reply other threads:[~2022-04-20 12:53 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-20 12:23 [net-next v1] bpf: add bpf_ktime_get_real_ns helper xiangxia.m.yue
2022-04-20 12:53 ` Toke Høiland-Jørgensen [this message]
2022-04-20 16:17 ` Andrii Nakryiko
2022-04-20 16:26 ` Toke Høiland-Jørgensen
2022-04-21 2:37 ` Tonghao Zhang
2022-04-21 2:27 ` Tonghao Zhang
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=878rrzj4r6.fsf@toke.dk \
--to=toke@kernel.org \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=davemarchevsky@fb.com \
--cc=edumazet@google.com \
--cc=geliang.tang@suse.com \
--cc=joannekoong@fb.com \
--cc=john.fastabend@gmail.com \
--cc=jolsa@kernel.org \
--cc=kafai@fb.com \
--cc=kpsingh@kernel.org \
--cc=kuba@kernel.org \
--cc=kuniyu@amazon.co.jp \
--cc=netdev@vger.kernel.org \
--cc=songliubraving@fb.com \
--cc=xiangxia.m.yue@gmail.com \
--cc=yhs@fb.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).