diff options
author | Stanislav Fomichev <sdf@google.com> | 2019-07-02 12:13:56 -0400 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2019-07-03 10:52:01 -0400 |
commit | 23729ff23186424e54b4d6678fcd526cdacef4d3 (patch) | |
tree | 48015cc7037fbacbbc73b14326367381efbc46d1 /include/net/tcp.h | |
parent | d2f5bbbc350050895d9f33c2744a61f9e0af1caa (diff) |
bpf: add BPF_CGROUP_SOCK_OPS callback that is executed on every RTT
Performance impact should be minimal because it's under a new
BPF_SOCK_OPS_RTT_CB_FLAG flag that has to be explicitly enabled.
Suggested-by: Eric Dumazet <edumazet@google.com>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Priyaranjan Jha <priyarjha@google.com>
Cc: Yuchung Cheng <ycheng@google.com>
Cc: Soheil Hassas Yeganeh <soheil@google.com>
Acked-by: Soheil Hassas Yeganeh <soheil@google.com>
Acked-by: Yuchung Cheng <ycheng@google.com>
Signed-off-by: Stanislav Fomichev <sdf@google.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'include/net/tcp.h')
-rw-r--r-- | include/net/tcp.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/net/tcp.h b/include/net/tcp.h index 9d36cc88d043..e16d8a3fd3b4 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
@@ -2221,6 +2221,14 @@ static inline bool tcp_bpf_ca_needs_ecn(struct sock *sk) | |||
2221 | return (tcp_call_bpf(sk, BPF_SOCK_OPS_NEEDS_ECN, 0, NULL) == 1); | 2221 | return (tcp_call_bpf(sk, BPF_SOCK_OPS_NEEDS_ECN, 0, NULL) == 1); |
2222 | } | 2222 | } |
2223 | 2223 | ||
2224 | static inline void tcp_bpf_rtt(struct sock *sk) | ||
2225 | { | ||
2226 | struct tcp_sock *tp = tcp_sk(sk); | ||
2227 | |||
2228 | if (BPF_SOCK_OPS_TEST_FLAG(tp, BPF_SOCK_OPS_RTT_CB_FLAG)) | ||
2229 | tcp_call_bpf(sk, BPF_SOCK_OPS_RTT_CB, 0, NULL); | ||
2230 | } | ||
2231 | |||
2224 | #if IS_ENABLED(CONFIG_SMC) | 2232 | #if IS_ENABLED(CONFIG_SMC) |
2225 | extern struct static_key_false tcp_have_smc; | 2233 | extern struct static_key_false tcp_have_smc; |
2226 | #endif | 2234 | #endif |