Skip to content

Commit

Permalink
bpf: selftest: Remove enum tcp_ca_state from bpf_tcp_helpers.h
Browse files Browse the repository at this point in the history
The enum tcp_ca_state is available in <linux/tcp.h>.
Remove it from the bpf_tcp_helpers.h to avoid conflict when the bpf prog
needs to include both both <linux/tcp.h> and bpf_tcp_helpers.h.

Modify the bpf_cubic.c and bpf_dctcp.c to use <linux/tcp.h> instead.
The <linux/stddef.h> is needed by <linux/tcp.h>.

Signed-off-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20200925000452.3859313-1-kafai@fb.com
  • Loading branch information
Martin KaFai Lau authored and Alexei Starovoitov committed Sep 25, 2020
1 parent edc2d66 commit 0c402c6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
8 changes: 0 additions & 8 deletions tools/testing/selftests/bpf/bpf_tcp_helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,6 @@ enum tcp_ca_event {
CA_EVENT_ECN_IS_CE = 5,
};

enum tcp_ca_state {
TCP_CA_Open = 0,
TCP_CA_Disorder = 1,
TCP_CA_CWR = 2,
TCP_CA_Recovery = 3,
TCP_CA_Loss = 4
};

struct ack_sample {
__u32 pkts_acked;
__s32 rtt_us;
Expand Down
2 changes: 2 additions & 0 deletions tools/testing/selftests/bpf/progs/bpf_cubic.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
*/

#include <linux/bpf.h>
#include <linux/stddef.h>
#include <linux/tcp.h>
#include "bpf_tcp_helpers.h"

char _license[] SEC("license") = "GPL";
Expand Down
2 changes: 2 additions & 0 deletions tools/testing/selftests/bpf/progs/bpf_dctcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
#include <stddef.h>
#include <linux/bpf.h>
#include <linux/types.h>
#include <linux/stddef.h>
#include <linux/tcp.h>
#include <bpf/bpf_helpers.h>
#include <bpf/bpf_tracing.h>
#include "bpf_tcp_helpers.h"
Expand Down

0 comments on commit 0c402c6

Please sign in to comment.