Skip to content

Commit

Permalink
samples: bpf: refactor header include path
Browse files Browse the repository at this point in the history
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 b552d33 ("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>
  • Loading branch information
DanielTimLee authored and borkmann committed Jun 17, 2019
1 parent fa206dc commit 4d18f6d
Show file tree
Hide file tree
Showing 15 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion samples/bpf/fds_example.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

#include <bpf/bpf.h>

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

Expand Down
4 changes: 2 additions & 2 deletions samples/bpf/hbm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
2 changes: 1 addition & 1 deletion samples/bpf/ibumad_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
2 changes: 1 addition & 1 deletion samples/bpf/sockex1_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion samples/bpf/sockex2_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
4 changes: 2 additions & 2 deletions samples/bpf/xdp1_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions samples/bpf/xdp_adjust_tail_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion samples/bpf/xdp_fwd_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include <fcntl.h>
#include <libgen.h>

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


Expand Down
2 changes: 1 addition & 1 deletion samples/bpf/xdp_redirect_cpu_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
2 changes: 1 addition & 1 deletion samples/bpf/xdp_redirect_map_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion samples/bpf/xdp_redirect_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion samples/bpf/xdp_router_ipv4_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down
4 changes: 2 additions & 2 deletions samples/bpf/xdp_rxq_info_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion samples/bpf/xdp_tx_iptunnel_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions samples/bpf/xdpsock_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4d18f6d

Please sign in to comment.