1 // SPDX-License-Identifier: GPL-2.0
5 #include <bpf/bpf_helpers.h>
6 #include <bpf/bpf_tracing.h>
8 char _license[] SEC("license") = "GPL";
10 static inline struct tcp_sock *tcp_sk(const struct sock *sk)
12 return (struct tcp_sock *)sk;
15 SEC("struct_ops/incompl_cong_ops_ssthresh")
16 __u32 BPF_PROG(incompl_cong_ops_ssthresh, struct sock *sk)
18 return tcp_sk(sk)->snd_ssthresh;
21 SEC("struct_ops/incompl_cong_ops_undo_cwnd")
22 __u32 BPF_PROG(incompl_cong_ops_undo_cwnd, struct sock *sk)
24 return tcp_sk(sk)->snd_cwnd;
28 struct tcp_congestion_ops incompl_cong_ops = {
29 /* Intentionally leaving out any of the required cong_avoid() and
30 * cong_control() here.
32 .ssthresh = (void *)incompl_cong_ops_ssthresh,
33 .undo_cwnd = (void *)incompl_cong_ops_undo_cwnd,
34 .name = "bpf_incompl_ops",