samples: bpf: refactor header include path
authorDaniel T. Lee <danieltimlee@gmail.com>
Sat, 15 Jun 2019 15:14:47 +0000 (00:14 +0900)
committerDaniel Borkmann <daniel@iogearbox.net>
Mon, 17 Jun 2019 22:28:36 +0000 (00:28 +0200)
Currently, header inclusion in each file is inconsistent.
For example, "libbpf.h" header is included as multiple ways.

    #include "bpf/libbpf.h"
    #include "libbpf.h"

Due to commit b552d33c80a9 ("samples/bpf: fix include path
in Makefile"), $(srctree)/tools/lib/bpf/ path had been included
during build, path "bpf/" in header isn't necessary anymore.

This commit removes path "bpf/" in header inclusion.

Signed-off-by: Daniel T. Lee <danieltimlee@gmail.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
15 files changed:
samples/bpf/fds_example.c
samples/bpf/hbm.c
samples/bpf/ibumad_user.c
samples/bpf/sockex1_user.c
samples/bpf/sockex2_user.c
samples/bpf/xdp1_user.c
samples/bpf/xdp_adjust_tail_user.c
samples/bpf/xdp_fwd_user.c
samples/bpf/xdp_redirect_cpu_user.c
samples/bpf/xdp_redirect_map_user.c
samples/bpf/xdp_redirect_user.c
samples/bpf/xdp_router_ipv4_user.c
samples/bpf/xdp_rxq_info_user.c
samples/bpf/xdp_tx_iptunnel_user.c
samples/bpf/xdpsock_user.c

index e51eb060244eccc8d262e58c07c084d051a83cb8..2d4b717726b645b9956dc65f672027cc071158b9 100644 (file)
@@ -14,7 +14,7 @@
 
 #include <bpf/bpf.h>
 
-#include "bpf/libbpf.h"
+#include "libbpf.h"
 #include "bpf_insn.h"
 #include "sock_example.h"
 
index bdfce592207a2c5f1b320f9e4398d7cd1bf5d626..b905b32ff1856986a377223f2cd5866e19361efa 100644 (file)
@@ -50,8 +50,8 @@
 #include "cgroup_helpers.h"
 #include "hbm.h"
 #include "bpf_util.h"
-#include "bpf/bpf.h"
-#include "bpf/libbpf.h"
+#include "bpf.h"
+#include "libbpf.h"
 
 bool outFlag = true;
 int minRate = 1000;            /* cgroup rate limit in Mbps */
index 097d76143363483ff2b833c470fbd44a7b2d451d..cb5a8f994849b60b1211d39dafad2e5cec5e6795 100644 (file)
@@ -25,7 +25,7 @@
 
 #include "bpf_load.h"
 #include "bpf_util.h"
-#include "bpf/libbpf.h"
+#include "libbpf.h"
 
 static void dump_counts(int fd)
 {
index 7f90796ae15a783f04452d37b551c7073ce85d5d..a219442afbeef683d95592f90f8a1cd00ec12336 100644 (file)
@@ -3,7 +3,7 @@
 #include <assert.h>
 #include <linux/bpf.h>
 #include <bpf/bpf.h>
-#include "bpf/libbpf.h"
+#include "libbpf.h"
 #include "sock_example.h"
 #include <unistd.h>
 #include <arpa/inet.h>
index bc257333ad920eeb5cf4ed2651e6a3c9b3f466cc..6de383ddd08ba7a198b3e2c81d6710dc43a53811 100644 (file)
@@ -3,7 +3,7 @@
 #include <assert.h>
 #include <linux/bpf.h>
 #include <bpf/bpf.h>
-#include "bpf/libbpf.h"
+#include "libbpf.h"
 #include "sock_example.h"
 #include <unistd.h>
 #include <arpa/inet.h>
index 6a64e93365e1021411224d3e41937f8e47c0ae22..ae34caa2b22ea48d1365c7d49511f487819cb880 100644 (file)
@@ -18,8 +18,8 @@
 #include <net/if.h>
 
 #include "bpf_util.h"
-#include "bpf/bpf.h"
-#include "bpf/libbpf.h"
+#include "bpf.h"
+#include "libbpf.h"
 
 static int ifindex;
 static __u32 xdp_flags = XDP_FLAGS_UPDATE_IF_NOEXIST;
index 07e1b9269e497b0ffbefad4ee3c5d310b7630ff1..586ff751aba9ec35ef7551fab5c5f0e06ebe9a47 100644 (file)
@@ -18,8 +18,8 @@
 #include <netinet/ether.h>
 #include <unistd.h>
 #include <time.h>
-#include "bpf/bpf.h"
-#include "bpf/libbpf.h"
+#include "bpf.h"
+#include "libbpf.h"
 
 #define STATS_INTERVAL_S 2U
 
index f88e1d7093d62d0c52fffa1da0a1f972d02561a8..5b46ee12c696c69839817226aef0d2e54f0858f9 100644 (file)
@@ -24,7 +24,7 @@
 #include <fcntl.h>
 #include <libgen.h>
 
-#include "bpf/libbpf.h"
+#include "libbpf.h"
 #include <bpf/bpf.h>
 
 
index 586b294d72d3eb4b56abe89091bf78e99d3db692..f5dc7e1f8bc695f077ae0aaf35afcef1c62aa46c 100644 (file)
@@ -25,7 +25,7 @@ static const char *__doc__ =
 #define MAX_PROG 6
 
 #include <bpf/bpf.h>
-#include "bpf/libbpf.h"
+#include "libbpf.h"
 
 #include "bpf_util.h"
 
index 1dbe7fd3a1a84da3e7ef956dad326056c61e4000..2bfd624069f3df6d946bb54d53ffa94bdf5cc679 100644 (file)
@@ -24,7 +24,7 @@
 
 #include "bpf_util.h"
 #include <bpf/bpf.h>
-#include "bpf/libbpf.h"
+#include "libbpf.h"
 
 static int ifindex_in;
 static int ifindex_out;
index e9054c0269ff5dcdbf3d0c4f08c37ed6b43f9e5f..fc725eb4674aef16487727362c9b4358fa0cae60 100644 (file)
@@ -24,7 +24,7 @@
 
 #include "bpf_util.h"
 #include <bpf/bpf.h>
-#include "bpf/libbpf.h"
+#include "libbpf.h"
 
 static int ifindex_in;
 static int ifindex_out;
index 79fe7bc26ab45eedddd1c3a4a418afdbe6bdd19b..097a7ee564dca8a546a21f92ca3350f02a18a7d6 100644 (file)
@@ -24,7 +24,7 @@
 #include <sys/ioctl.h>
 #include <sys/syscall.h>
 #include "bpf_util.h"
-#include "bpf/libbpf.h"
+#include "libbpf.h"
 #include <sys/resource.h>
 #include <libgen.h>
 
index 1210f3b170f0b8aa197c61b309615a10e7bb8f29..c7e4e45d824a473d56c65c4fa8f776eb180b5cb7 100644 (file)
@@ -22,8 +22,8 @@ static const char *__doc__ = " XDP RX-queue info extract example\n\n"
 #include <arpa/inet.h>
 #include <linux/if_link.h>
 
-#include "bpf/bpf.h"
-#include "bpf/libbpf.h"
+#include "bpf.h"
+#include "libbpf.h"
 #include "bpf_util.h"
 
 static int ifindex = -1;
index 4a1511eb78128c3d9777f7704fbe9c094fbe5c80..d9a5617fe8722b78c85f08c19f2f79c513d6eef5 100644 (file)
@@ -17,7 +17,7 @@
 #include <netinet/ether.h>
 #include <unistd.h>
 #include <time.h>
-#include "bpf/libbpf.h"
+#include "libbpf.h"
 #include <bpf/bpf.h>
 #include "bpf_util.h"
 #include "xdp_tx_iptunnel_common.h"
index d08ee1ab7bb4e95adc9ef6f3d202558bf6788340..0f5eb0d7f2dfbcd8d1a0936323513be2119097b4 100644 (file)
@@ -27,8 +27,8 @@
 #include <time.h>
 #include <unistd.h>
 
-#include "bpf/libbpf.h"
-#include "bpf/xsk.h"
+#include "libbpf.h"
+#include "xsk.h"
 #include <bpf/bpf.h>
 
 #ifndef SOL_XDP