Message ID | 20250220072940.99994-1-kerneljasonxing@gmail.com (mailing list archive) |
---|---|
Headers | show |
Series | net-timestamp: bpf extension to equip applications transparently | expand |
Jason Xing wrote: > "Timestamping is key to debugging network stack latency. With > SO_TIMESTAMPING, bugs that are otherwise incorrectly assumed to be > network issues can be attributed to the kernel." This is extracted > from the talk "SO_TIMESTAMPING: Powering Fleetwide RPC Monitoring" > addressed by Willem de Bruijn at netdevconf 0x17). > > There are a few areas that need optimization with the consideration of > easier use and less performance impact, which I highlighted and mainly > discussed at netconf 2024 with Willem de Bruijn and John Fastabend: > uAPI compatibility, extra system call overhead, and the need for > application modification. I initially managed to solve these issues > by writing a kernel module that hooks various key functions. However, > this approach is not suitable for the next kernel release. Therefore, > a BPF extension was proposed. During recent period, Martin KaFai Lau > provides invaluable suggestions about BPF along the way. Many thanks > here! > > This series adds the BPF networking timestamping infrastructure through > reusing most of the tx timestamping callback that is currently enabled > by the SO_TIMESTAMPING.. This series also adds TX timestamping support > for TCP. The RX timestamping and UDP support will be added in the future. This series addresses all my feedback. The timestamping patches all have my Reviewed-by. The BPF parts I am less qualified to review. They LGTM, but I defer to Martin as the expert reviewer.
Hello: This series was applied to bpf/bpf-next.git (net) by Martin KaFai Lau <martin.lau@kernel.org>: On Thu, 20 Feb 2025 15:29:28 +0800 you wrote: > "Timestamping is key to debugging network stack latency. With > SO_TIMESTAMPING, bugs that are otherwise incorrectly assumed to be > network issues can be attributed to the kernel." This is extracted > from the talk "SO_TIMESTAMPING: Powering Fleetwide RPC Monitoring" > addressed by Willem de Bruijn at netdevconf 0x17). > > There are a few areas that need optimization with the consideration of > easier use and less performance impact, which I highlighted and mainly > discussed at netconf 2024 with Willem de Bruijn and John Fastabend: > uAPI compatibility, extra system call overhead, and the need for > application modification. I initially managed to solve these issues > by writing a kernel module that hooks various key functions. However, > this approach is not suitable for the next kernel release. Therefore, > a BPF extension was proposed. During recent period, Martin KaFai Lau > provides invaluable suggestions about BPF along the way. Many thanks > here! > > [...] Here is the summary with links: - [bpf-next,v13,01/12] bpf: add networking timestamping support to bpf_get/setsockopt() (no matching commit) - [bpf-next,v13,02/12] bpf: prepare the sock_ops ctx and call bpf prog for TX timestamping https://git.kernel.org/bpf/bpf-next/c/df600f3b1d79 - [bpf-next,v13,03/12] bpf: prevent unsafe access to the sock fields in the BPF timestamping callback https://git.kernel.org/bpf/bpf-next/c/fd93eaffb3f9 - [bpf-next,v13,04/12] bpf: disable unsafe helpers in TX timestamping callbacks https://git.kernel.org/bpf/bpf-next/c/2958624b2530 - [bpf-next,v13,05/12] net-timestamp: prepare for isolating two modes of SO_TIMESTAMPING https://git.kernel.org/bpf/bpf-next/c/aa290f93a4af - [bpf-next,v13,06/12] bpf: add BPF_SOCK_OPS_TSTAMP_SCHED_CB callback https://git.kernel.org/bpf/bpf-next/c/6b98ec7e882a - [bpf-next,v13,07/12] bpf: add BPF_SOCK_OPS_TSTAMP_SND_SW_CB callback https://git.kernel.org/bpf/bpf-next/c/ecebb17ad818 - [bpf-next,v13,08/12] bpf: add BPF_SOCK_OPS_TSTAMP_SND_HW_CB callback https://git.kernel.org/bpf/bpf-next/c/2deaf7f42b8c - [bpf-next,v13,09/12] bpf: add BPF_SOCK_OPS_TSTAMP_ACK_CB callback https://git.kernel.org/bpf/bpf-next/c/b3b81e6b009d - [bpf-next,v13,10/12] bpf: add BPF_SOCK_OPS_TSTAMP_SENDMSG_CB callback https://git.kernel.org/bpf/bpf-next/c/c9525d240c81 - [bpf-next,v13,11/12] bpf: support selective sampling for bpf timestamping https://git.kernel.org/bpf/bpf-next/c/59422464266f - [bpf-next,v13,12/12] selftests/bpf: add simple bpf tests in the tx path for timestamping feature https://git.kernel.org/bpf/bpf-next/c/f4924aec58dd You are awesome, thank you!
On 2/20/25 7:32 AM, Willem de Bruijn wrote: > Jason Xing wrote: >> "Timestamping is key to debugging network stack latency. With >> SO_TIMESTAMPING, bugs that are otherwise incorrectly assumed to be >> network issues can be attributed to the kernel." This is extracted >> from the talk "SO_TIMESTAMPING: Powering Fleetwide RPC Monitoring" >> addressed by Willem de Bruijn at netdevconf 0x17). >> >> There are a few areas that need optimization with the consideration of >> easier use and less performance impact, which I highlighted and mainly >> discussed at netconf 2024 with Willem de Bruijn and John Fastabend: >> uAPI compatibility, extra system call overhead, and the need for >> application modification. I initially managed to solve these issues >> by writing a kernel module that hooks various key functions. However, >> this approach is not suitable for the next kernel release. Therefore, >> a BPF extension was proposed. During recent period, Martin KaFai Lau >> provides invaluable suggestions about BPF along the way. Many thanks >> here! >> >> This series adds the BPF networking timestamping infrastructure through >> reusing most of the tx timestamping callback that is currently enabled >> by the SO_TIMESTAMPING.. This series also adds TX timestamping support >> for TCP. The RX timestamping and UDP support will be added in the future. Thanks for working on this BPF feature. Applied. > This series addresses all my feedback. > > The timestamping patches all have my Reviewed-by. Thanks to Willem and other reviewers for their input in this long thread across many revisions.
On Fri, Feb 21, 2025 at 7:02 AM Martin KaFai Lau <martin.lau@linux.dev> wrote: > > On 2/20/25 7:32 AM, Willem de Bruijn wrote: > > Jason Xing wrote: > >> "Timestamping is key to debugging network stack latency. With > >> SO_TIMESTAMPING, bugs that are otherwise incorrectly assumed to be > >> network issues can be attributed to the kernel." This is extracted > >> from the talk "SO_TIMESTAMPING: Powering Fleetwide RPC Monitoring" > >> addressed by Willem de Bruijn at netdevconf 0x17). > >> > >> There are a few areas that need optimization with the consideration of > >> easier use and less performance impact, which I highlighted and mainly > >> discussed at netconf 2024 with Willem de Bruijn and John Fastabend: > >> uAPI compatibility, extra system call overhead, and the need for > >> application modification. I initially managed to solve these issues > >> by writing a kernel module that hooks various key functions. However, > >> this approach is not suitable for the next kernel release. Therefore, > >> a BPF extension was proposed. During recent period, Martin KaFai Lau > >> provides invaluable suggestions about BPF along the way. Many thanks > >> here! > >> > >> This series adds the BPF networking timestamping infrastructure through > >> reusing most of the tx timestamping callback that is currently enabled > >> by the SO_TIMESTAMPING.. This series also adds TX timestamping support > >> for TCP. The RX timestamping and UDP support will be added in the future. > > Thanks for working on this BPF feature. Applied. Thanks Martin for sharing invaluable and precious knowledge on BPF design !!! Thanks Willem for great effort on suggesting from the insightful perspective of the networking area !!! > > > This series addresses all my feedback. > > > > The timestamping patches all have my Reviewed-by. > > Thanks to Willem and other reviewers for their input in this long thread across > many revisions. Thanks everyone from the bottom of my heart :) Thanks, Jason