diff options
| author | Philo Lu <[email protected]> | 2024-04-25 16:17:23 +0000 |
|---|---|---|
| committer | Martin KaFai Lau <[email protected]> | 2024-04-25 21:09:05 +0000 |
| commit | 48e2cd3e3dcfe04f212df4fb189fa04c2a87b980 (patch) | |
| tree | 25a93be2e1812044e50c7cf4909e18c8f5c8ff43 /include/net/tcp.h | |
| parent | Merge branch 'check-bpf_dummy_struct_ops-program-params-for-test-runs' (diff) | |
| download | kernel-48e2cd3e3dcfe04f212df4fb189fa04c2a87b980.tar.gz kernel-48e2cd3e3dcfe04f212df4fb189fa04c2a87b980.zip | |
bpf: add mrtt and srtt as BPF_SOCK_OPS_RTT_CB args
Two important arguments in RTT estimation, mrtt and srtt, are passed to
tcp_bpf_rtt(), so that bpf programs get more information about RTT
computation in BPF_SOCK_OPS_RTT_CB.
The difference between bpf_sock_ops->srtt_us and the srtt here is: the
former is an old rtt before update, while srtt passed by tcp_bpf_rtt()
is that after update.
Signed-off-by: Philo Lu <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Martin KaFai Lau <[email protected]>
Diffstat (limited to 'include/net/tcp.h')
| -rw-r--r-- | include/net/tcp.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/net/tcp.h b/include/net/tcp.h index 6ae35199d3b3..0f75d03287c2 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h @@ -2706,10 +2706,10 @@ static inline bool tcp_bpf_ca_needs_ecn(struct sock *sk) return (tcp_call_bpf(sk, BPF_SOCK_OPS_NEEDS_ECN, 0, NULL) == 1); } -static inline void tcp_bpf_rtt(struct sock *sk) +static inline void tcp_bpf_rtt(struct sock *sk, long mrtt, u32 srtt) { if (BPF_SOCK_OPS_TEST_FLAG(tcp_sk(sk), BPF_SOCK_OPS_RTT_CB_FLAG)) - tcp_call_bpf(sk, BPF_SOCK_OPS_RTT_CB, 0, NULL); + tcp_call_bpf_2arg(sk, BPF_SOCK_OPS_RTT_CB, mrtt, srtt); } #if IS_ENABLED(CONFIG_SMC) |
