Subject: Re: bpf: add BPF_CGROUP_SOCK_OPS callback that is executed on every RTT (commit: 23729ff23186424)

From: Stanislav Fomichev <[email-masked]>
Date: Thu, 25 Jul 2024 20:29:49 -0700

On 07/25, Rao Shoaib wrote:
> Hi Stanislav,
> 
> I have a question about the placement of tcp_bpf_rtt() call in
> tcp_rtt_estimator(). Why is the call made before the assignment
> 
> tp->srtt_us = max(1U, srtt);
> 
> How is the attached eBPF program suppose the get the new value?

Take a look at the way tcp_bpf_rtt is invoked. It gets mrtt_us
and srtt arguments. Those are passed via bpf_sock_ops args field.
See tools/testing/selftests/bpf/progs/tcp_rtt.c. Hope that helps!