summaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/bpf/progs/bpf_cubic.c
diff options
context:
space:
mode:
authorMartin KaFai Lau <kafai@fb.com>2021-03-24 18:52:46 -0700
committerAlexei Starovoitov <ast@kernel.org>2021-03-26 20:41:52 -0700
commit78e60bbbe8e8f614b6a453d8a780d9e6f77749a8 (patch)
treeb4016d6f0cee3eb8f9559e7f4ea5e8fac01b83fe /tools/testing/selftests/bpf/progs/bpf_cubic.c
parent39cd9e0f6783fd2dd2b0e95500e34575b3707ed8 (diff)
downloadlinux-stable-78e60bbbe8e8f614b6a453d8a780d9e6f77749a8.tar.gz
linux-stable-78e60bbbe8e8f614b6a453d8a780d9e6f77749a8.tar.bz2
linux-stable-78e60bbbe8e8f614b6a453d8a780d9e6f77749a8.zip
bpf: selftests: Bpf_cubic and bpf_dctcp calling kernel functions
This patch removes the bpf implementation of tcp_slow_start() and tcp_cong_avoid_ai(). Instead, it directly uses the kernel implementation. It also replaces the bpf_cubic_undo_cwnd implementation by directly calling tcp_reno_undo_cwnd(). bpf_dctcp also directly calls tcp_reno_cong_avoid() instead. Signed-off-by: Martin KaFai Lau <kafai@fb.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Acked-by: Andrii Nakryiko <andrii@kernel.org> Link: https://lore.kernel.org/bpf/20210325015246.1551062-1-kafai@fb.com
Diffstat (limited to 'tools/testing/selftests/bpf/progs/bpf_cubic.c')
-rw-r--r--tools/testing/selftests/bpf/progs/bpf_cubic.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/testing/selftests/bpf/progs/bpf_cubic.c b/tools/testing/selftests/bpf/progs/bpf_cubic.c
index 33c4d2bded64..f62df4d023f9 100644
--- a/tools/testing/selftests/bpf/progs/bpf_cubic.c
+++ b/tools/testing/selftests/bpf/progs/bpf_cubic.c
@@ -525,11 +525,11 @@ void BPF_STRUCT_OPS(bpf_cubic_acked, struct sock *sk,
hystart_update(sk, delay);
}
+extern __u32 tcp_reno_undo_cwnd(struct sock *sk) __ksym;
+
__u32 BPF_STRUCT_OPS(bpf_cubic_undo_cwnd, struct sock *sk)
{
- const struct tcp_sock *tp = tcp_sk(sk);
-
- return max(tp->snd_cwnd, tp->prior_cwnd);
+ return tcp_reno_undo_cwnd(sk);
}
SEC(".struct_ops")