Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

selftests/bpf: Use bpf_tracing_net.h in bpf_cubic

This patch uses bpf_tracing_net.h (i.e. vmlinux.h) in bpf_cubic.
This will allow to retire the bpf_tcp_helpers.h and consolidate
tcp-cc tests to vmlinux.h.

Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Link: https://lore.kernel.org/r/20240509175026.3423614-7-martin.lau@linux.dev
Signed-off-by: Alexei Starovoitov <ast@kernel.org>

authored by

Martin KaFai Lau and committed by
Alexei Starovoitov
a824c9a8 b1d87ae9

+12 -4
+12 -4
tools/testing/selftests/bpf/progs/bpf_cubic.c
··· 14 14 * "ca->ack_cnt / delta" operation. 15 15 */ 16 16 17 - #include <linux/bpf.h> 18 - #include <linux/stddef.h> 19 - #include <linux/tcp.h> 20 - #include "bpf_tcp_helpers.h" 17 + #include "bpf_tracing_net.h" 18 + #include <bpf/bpf_tracing.h> 21 19 22 20 char _license[] SEC("license") = "GPL"; 23 21 24 22 #define clamp(val, lo, hi) min((typeof(val))max(val, lo), hi) 23 + #define min(a, b) ((a) < (b) ? (a) : (b)) 24 + #define max(a, b) ((a) > (b) ? (a) : (b)) 25 + static bool before(__u32 seq1, __u32 seq2) 26 + { 27 + return (__s32)(seq1-seq2) < 0; 28 + } 29 + #define after(seq2, seq1) before(seq1, seq2) 30 + 31 + extern __u32 tcp_slow_start(struct tcp_sock *tp, __u32 acked) __ksym; 32 + extern void tcp_cong_avoid_ai(struct tcp_sock *tp, __u32 w, __u32 acked) __ksym; 25 33 26 34 #define BICTCP_BETA_SCALE 1024 /* Scale factor beta calculation 27 35 * max_cwnd = snd_cwnd * beta