On 2/13/25 5:00 PM, 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. --- v10 Link: https://lore.kernel.org/all/20250212061855.71154-1-kerneljasonxing@xxxxxxxxx/ 1. rename hwts with hwtimestamp 2. use subtest and pid filter in selftest 3. use 'tcb->txstamp_ack |= TSTAMP_ACK_SK'
Overall looks good. I only have two minor comments. Willem, can you also take another look and ack if it looks good to you? Thanks.