Skip to content

Commit a824c9a

Browse files
Martin KaFai LauAlexei Starovoitov
authored andcommitted
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>
1 parent b1d87ae commit a824c9a

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

tools/testing/selftests/bpf/progs/bpf_cubic.c

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,22 @@
1414
* "ca->ack_cnt / delta" operation.
1515
*/
1616

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>
2119

2220
char _license[] SEC("license") = "GPL";
2321

2422
#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;
2533

2634
#define BICTCP_BETA_SCALE 1024 /* Scale factor beta calculation
2735
* max_cwnd = snd_cwnd * beta

0 commit comments

Comments
 (0)