Skip to content

Commit

Permalink
selftests/bpf: Remove useless include headers
Browse files Browse the repository at this point in the history
Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
  • Loading branch information
Geliang Tang committed May 29, 2024
1 parent 01db2bf commit 6f085a3
Show file tree
Hide file tree
Showing 38 changed files with 0 additions and 110 deletions.
1 change: 0 additions & 1 deletion tools/testing/selftests/bpf/prog_tests/assign_reuse.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#include <uapi/linux/if_link.h>
#include <test_progs.h>

#include <netinet/tcp.h>
#include <netinet/udp.h>

#include "network_helpers.h"
Expand Down
3 changes: 0 additions & 3 deletions tools/testing/selftests/bpf/prog_tests/bind_perm.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
// SPDX-License-Identifier: GPL-2.0
#define _GNU_SOURCE
#include <sched.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/socket.h>

#include "test_progs.h"
#include "cap_helpers.h"
Expand Down
2 changes: 0 additions & 2 deletions tools/testing/selftests/bpf/prog_tests/bpf_tcp_ca.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// SPDX-License-Identifier: GPL-2.0
/* Copyright (c) 2019 Facebook */

#include <linux/err.h>
#include <netinet/tcp.h>
#include <test_progs.h>
#include "network_helpers.h"
#include "bpf_dctcp.skel.h"
Expand Down
9 changes: 0 additions & 9 deletions tools/testing/selftests/bpf/prog_tests/btf_skc_cls_ingress.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,6 @@

#define _GNU_SOURCE
#include <netinet/in.h>
#include <arpa/inet.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <sched.h>
#include <net/if.h>
#include <linux/compiler.h>
#include <bpf/libbpf.h>

#include "network_helpers.h"
#include "test_progs.h"
Expand Down
1 change: 0 additions & 1 deletion tools/testing/selftests/bpf/prog_tests/cb_refs.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// SPDX-License-Identifier: GPL-2.0
#include "bpf/libbpf.h"
#include <test_progs.h>
#include <network_helpers.h>

Expand Down
2 changes: 0 additions & 2 deletions tools/testing/selftests/bpf/prog_tests/cgroup_tcp_skb.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
/* Copyright (c) 2023 Facebook */
#include <test_progs.h>
#include <linux/in6.h>
#include <sys/socket.h>
#include <sched.h>
#include <unistd.h>
#include "cgroup_helpers.h"
#include "testing_helpers.h"
#include "cgroup_tcp_skb.skel.h"
Expand Down
2 changes: 0 additions & 2 deletions tools/testing/selftests/bpf/prog_tests/cgrp_local_storage.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
/* Copyright (c) 2022 Meta Platforms, Inc. and affiliates.*/

#define _GNU_SOURCE
#include <unistd.h>
#include <sys/syscall.h>
#include <sys/types.h>
#include <test_progs.h>
#include "cgrp_ls_tp_btf.skel.h"
#include "cgrp_ls_recursion.skel.h"
Expand Down
1 change: 0 additions & 1 deletion tools/testing/selftests/bpf/prog_tests/check_mtu.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#include "test_check_mtu.skel.h"
#include "network_helpers.h"

#include <stdlib.h>
#include <inttypes.h>

#define IFINDEX_LO 1
Expand Down
4 changes: 0 additions & 4 deletions tools/testing/selftests/bpf/prog_tests/cls_redirect.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@

#define _GNU_SOURCE

#include <arpa/inet.h>
#include <string.h>

#include <linux/pkt_cls.h>
#include <netinet/tcp.h>

#include <test_progs.h>
#include "network_helpers.h"
Expand Down
3 changes: 0 additions & 3 deletions tools/testing/selftests/bpf/prog_tests/crypto_sanity.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
// SPDX-License-Identifier: GPL-2.0
/* Copyright (c) 2024 Meta Platforms, Inc. and affiliates. */

#include <sys/types.h>
#include <sys/socket.h>
#include <net/if.h>
#include <linux/in6.h>
#include <linux/if_alg.h>

Expand Down
3 changes: 0 additions & 3 deletions tools/testing/selftests/bpf/prog_tests/decap_sanity.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
// SPDX-License-Identifier: GPL-2.0
/* Copyright (c) 2022 Meta Platforms, Inc. and affiliates. */

#include <sys/types.h>
#include <sys/socket.h>
#include <net/if.h>
#include <linux/in6.h>

#include "test_progs.h"
Expand Down
1 change: 0 additions & 1 deletion tools/testing/selftests/bpf/prog_tests/empty_skb.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// SPDX-License-Identifier: GPL-2.0
#include <test_progs.h>
#include <network_helpers.h>
#include <net/if.h>
#include "empty_skb.skel.h"

void test_empty_skb(void)
Expand Down
2 changes: 0 additions & 2 deletions tools/testing/selftests/bpf/prog_tests/fib_lookup.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
/* Copyright (c) 2023 Meta Platforms, Inc. and affiliates. */

#include <linux/rtnetlink.h>
#include <sys/types.h>
#include <net/if.h>

#include "test_progs.h"
#include "network_helpers.h"
Expand Down
1 change: 0 additions & 1 deletion tools/testing/selftests/bpf/prog_tests/ip_check_defrag.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// SPDX-License-Identifier: GPL-2.0
#include <test_progs.h>
#include <net/if.h>
#include <linux/netfilter.h>
#include <network_helpers.h>
#include "ip_check_defrag.skel.h"
Expand Down
2 changes: 0 additions & 2 deletions tools/testing/selftests/bpf/prog_tests/lsm_cgroup.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
// SPDX-License-Identifier: GPL-2.0

#include <sys/types.h>
#include <sys/socket.h>
#include <test_progs.h>
#include <bpf/btf.h>

Expand Down
11 changes: 0 additions & 11 deletions tools/testing/selftests/bpf/prog_tests/lwt_redirect.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,21 +42,10 @@
* Case 1,2 use tap device to test redirect to device that requires MAC
* header, and tun device to test the case with no MAC header added.
*/
#include <sys/socket.h>
#include <net/if.h>
#include <linux/if_ether.h>
#include <linux/if_packet.h>
#include <linux/if_tun.h>
#include <linux/icmp.h>
#include <arpa/inet.h>
#include <unistd.h>
#include <errno.h>
#include <stdbool.h>
#include <stdlib.h>

#define NETNS "ns_lwt_redirect"
#include "lwt_helpers.h"
#include "test_progs.h"

#define BPF_OBJECT "test_lwt_redirect.bpf.o"
#define INGRESS_SEC(need_mac) ((need_mac) ? "redir_ingress" : "redir_ingress_nomac")
Expand Down
3 changes: 0 additions & 3 deletions tools/testing/selftests/bpf/prog_tests/migrate_reuseport.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@
* Author: Kuniyuki Iwashima <kuniyu@amazon.co.jp>
*/

#include <bpf/bpf.h>
#include <bpf/libbpf.h>

#include "test_progs.h"
#include "test_migrate_reuseport.skel.h"
#include "network_helpers.h"
Expand Down
3 changes: 0 additions & 3 deletions tools/testing/selftests/bpf/prog_tests/ns_current_pid_tgid.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,8 @@
#include <test_progs.h>
#include "test_ns_current_pid_tgid.skel.h"
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include <sys/syscall.h>
#include <sched.h>
#include <sys/wait.h>
#include <sys/mount.h>
#include <sys/fcntl.h>
#include "network_helpers.h"
Expand Down
1 change: 0 additions & 1 deletion tools/testing/selftests/bpf/prog_tests/preempt_lock.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// SPDX-License-Identifier: GPL-2.0
#include <test_progs.h>
#include <network_helpers.h>
#include <preempt_lock.skel.h>

void test_preempt_lock(void)
Expand Down
1 change: 0 additions & 1 deletion tools/testing/selftests/bpf/prog_tests/setget_sockopt.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include <sched.h>
#include <linux/socket.h>
#include <linux/tls.h>
#include <net/if.h>

#include "test_progs.h"
#include "cgroup_helpers.h"
Expand Down
14 changes: 0 additions & 14 deletions tools/testing/selftests/bpf/prog_tests/sk_lookup.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,6 @@
*/

#define _GNU_SOURCE
#include <arpa/inet.h>
#include <assert.h>
#include <errno.h>
#include <error.h>
#include <fcntl.h>
#include <sched.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>

#include <bpf/libbpf.h>
#include <bpf/bpf.h>

#include "test_progs.h"
#include "bpf_util.h"
#include "cgroup_helpers.h"
Expand Down
3 changes: 0 additions & 3 deletions tools/testing/selftests/bpf/prog_tests/sk_storage_tracing.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
// SPDX-License-Identifier: GPL-2.0
/* Copyright (c) 2020 Facebook */

#include <sys/types.h>
#include <bpf/bpf.h>
#include <bpf/libbpf.h>
#include "test_progs.h"
#include "network_helpers.h"
#include "test_sk_storage_trace_itself.skel.h"
Expand Down
1 change: 0 additions & 1 deletion tools/testing/selftests/bpf/prog_tests/sock_destroy.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// SPDX-License-Identifier: GPL-2.0
#include <test_progs.h>
#include <bpf/bpf_endian.h>

#include "sock_destroy_prog.skel.h"
#include "sock_destroy_prog_fail.skel.h"
Expand Down
6 changes: 0 additions & 6 deletions tools/testing/selftests/bpf/prog_tests/sock_fields.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,8 @@
#define _GNU_SOURCE
#include <netinet/in.h>
#include <arpa/inet.h>
#include <unistd.h>
#include <sched.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>

#include <bpf/bpf.h>
#include <bpf/libbpf.h>
#include <linux/compiler.h>

#include "network_helpers.h"
Expand Down
1 change: 0 additions & 1 deletion tools/testing/selftests/bpf/prog_tests/tailcalls.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// SPDX-License-Identifier: GPL-2.0
#include <unistd.h>
#include <test_progs.h>
#include <network_helpers.h>
#include "tailcall_poke.skel.h"
Expand Down
4 changes: 0 additions & 4 deletions tools/testing/selftests/bpf/prog_tests/tc_redirect.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,13 @@
* to drop unexpected traffic.
*/

#include <arpa/inet.h>
#include <linux/if_tun.h>
#include <linux/limits.h>
#include <linux/sysctl.h>
#include <linux/time_types.h>
#include <linux/net_tstamp.h>
#include <net/if.h>
#include <stdbool.h>
#include <stdio.h>
#include <sys/stat.h>
#include <unistd.h>

#include "test_progs.h"
#include "network_helpers.h"
Expand Down
2 changes: 0 additions & 2 deletions tools/testing/selftests/bpf/prog_tests/tcp_custom_syncookie.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@

#define _GNU_SOURCE
#include <sched.h>
#include <stdlib.h>
#include <net/if.h>

#include "test_progs.h"
#include "cgroup_helpers.h"
Expand Down
3 changes: 0 additions & 3 deletions tools/testing/selftests/bpf/prog_tests/tcp_hdr_options.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@

#define _GNU_SOURCE
#include <sched.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/socket.h>
#include <linux/compiler.h>

#include "test_progs.h"
Expand Down
3 changes: 0 additions & 3 deletions tools/testing/selftests/bpf/prog_tests/test_tunnel.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,8 @@
#include <linux/sysctl.h>
#include <linux/time_types.h>
#include <linux/net_tstamp.h>
#include <net/if.h>
#include <stdbool.h>
#include <stdio.h>
#include <sys/stat.h>
#include <unistd.h>

#include "test_progs.h"
#include "network_helpers.h"
Expand Down
1 change: 0 additions & 1 deletion tools/testing/selftests/bpf/prog_tests/time_tai.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

#include "test_time_tai.skel.h"

#include <time.h>
#include <stdint.h>

#define TAI_THRESHOLD 1000000000ULL /* 1s */
Expand Down
2 changes: 0 additions & 2 deletions tools/testing/selftests/bpf/prog_tests/vrf_socket_lookup.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@
* d) 1 from device outside VRF to server outside VRF
*/

#include <net/if.h>

#include "test_progs.h"
#include "network_helpers.h"
#include "vrf_socket_lookup.skel.h"
Expand Down
1 change: 0 additions & 1 deletion tools/testing/selftests/bpf/prog_tests/xdp_bpf2bpf.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// SPDX-License-Identifier: GPL-2.0
#include <test_progs.h>
#include <network_helpers.h>
#include <net/if.h>
#include "test_xdp.skel.h"
#include "test_xdp_bpf2bpf.skel.h"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// SPDX-License-Identifier: GPL-2.0
#include <net/if.h>
#include <test_progs.h>
#include <network_helpers.h>

Expand Down
4 changes: 0 additions & 4 deletions tools/testing/selftests/bpf/prog_tests/xdp_do_redirect.c
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
// SPDX-License-Identifier: GPL-2.0
#include <test_progs.h>
#include <network_helpers.h>
#include <net/if.h>
#include <linux/if_ether.h>
#include <linux/if_packet.h>
#include <linux/if_link.h>
#include <linux/ipv6.h>
#include <linux/in6.h>
#include <linux/udp.h>
#include <bpf/bpf_endian.h>
#include <uapi/linux/netdev.h>
#include "test_xdp_do_redirect.skel.h"

Expand Down
1 change: 0 additions & 1 deletion tools/testing/selftests/bpf/prog_tests/xdp_metadata.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#include <linux/net_tstamp.h>
#include <linux/udp.h>
#include <sys/mman.h>
#include <net/if.h>
#include <poll.h>

#define TX_NAME "veTX"
Expand Down
1 change: 0 additions & 1 deletion tools/testing/selftests/bpf/prog_tests/xfrm_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
* 5) requested if_id is compared with received if_id
*/

#include <net/if.h>
#include <linux/rtnetlink.h>
#include <linux/if_link.h>

Expand Down
2 changes: 0 additions & 2 deletions tools/testing/selftests/bpf/test_tcp_check_syncookie_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@

#include <arpa/inet.h>
#include <netinet/in.h>
#include <sys/types.h>
#include <sys/socket.h>

#include <bpf/bpf.h>
#include <bpf/libbpf.h>
Expand Down
Loading

0 comments on commit 6f085a3

Please sign in to comment.