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 /net/ipv4 | |
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 'net/ipv4')
-rw-r--r-- | net/ipv4/tcp_input.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index b71efeb0ae5b..c21e8a22fb3b 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c | |||
@@ -778,6 +778,8 @@ static void tcp_rtt_estimator(struct sock *sk, long mrtt_us) | |||
778 | tp->rttvar_us -= (tp->rttvar_us - tp->mdev_max_us) >> 2; | 778 | tp->rttvar_us -= (tp->rttvar_us - tp->mdev_max_us) >> 2; |
779 | tp->rtt_seq = tp->snd_nxt; | 779 | tp->rtt_seq = tp->snd_nxt; |
780 | tp->mdev_max_us = tcp_rto_min_us(sk); | 780 | tp->mdev_max_us = tcp_rto_min_us(sk); |
781 | |||
782 | tcp_bpf_rtt(sk); | ||
781 | } | 783 | } |
782 | } else { | 784 | } else { |
783 | /* no previous measure. */ | 785 | /* no previous measure. */ |
@@ -786,6 +788,8 @@ static void tcp_rtt_estimator(struct sock *sk, long mrtt_us) | |||
786 | tp->rttvar_us = max(tp->mdev_us, tcp_rto_min_us(sk)); | 788 | tp->rttvar_us = max(tp->mdev_us, tcp_rto_min_us(sk)); |
787 | tp->mdev_max_us = tp->rttvar_us; | 789 | tp->mdev_max_us = tp->rttvar_us; |
788 | tp->rtt_seq = tp->snd_nxt; | 790 | tp->rtt_seq = tp->snd_nxt; |
791 | |||
792 | tcp_bpf_rtt(sk); | ||
789 | } | 793 | } |
790 | tp->srtt_us = max(1U, srtt); | 794 | tp->srtt_us = max(1U, srtt); |
791 | } | 795 | } |