Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

samples: bpf: rename libbpf.h to bpf_insn.h

The libbpf.h file in samples is clashing with libbpf's header.
Since it only includes a subset of filter.h instruction helpers
rename it to bpf_insn.h. Drop the unnecessary include of bpf/bpf.h.

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Acked-by: Jesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>

authored by

Jakub Kicinski and committed by
Alexei Starovoitov
8d930450 2bf3e2ef

+17 -12
+1 -1
samples/bpf/cookie_uid_helper_example.c
··· 51 51 #include <sys/types.h> 52 52 #include <unistd.h> 53 53 #include <bpf/bpf.h> 54 - #include "libbpf.h" 54 + #include "bpf_insn.h" 55 55 56 56 #define PORT 8888 57 57
+3 -1
samples/bpf/fds_example.c
··· 12 12 #include <sys/types.h> 13 13 #include <sys/socket.h> 14 14 15 + #include <bpf/bpf.h> 16 + 17 + #include "bpf_insn.h" 15 18 #include "bpf_load.h" 16 - #include "libbpf.h" 17 19 #include "sock_example.h" 18 20 19 21 #define BPF_F_PIN (1 << 0)
+3 -5
samples/bpf/libbpf.h samples/bpf/bpf_insn.h
··· 1 1 /* SPDX-License-Identifier: GPL-2.0 */ 2 - /* eBPF mini library */ 3 - #ifndef __LIBBPF_H 4 - #define __LIBBPF_H 5 - 6 - #include <bpf/bpf.h> 2 + /* eBPF instruction mini library */ 3 + #ifndef __BPF_INSN_H 4 + #define __BPF_INSN_H 7 5 8 6 struct bpf_insn; 9 7
+2 -1
samples/bpf/sock_example.c
··· 26 26 #include <linux/if_ether.h> 27 27 #include <linux/ip.h> 28 28 #include <stddef.h> 29 - #include "libbpf.h" 29 + #include <bpf/bpf.h> 30 + #include "bpf_insn.h" 30 31 #include "sock_example.h" 31 32 32 33 char bpf_log_buf[BPF_LOG_BUF_SIZE];
+2 -1
samples/bpf/test_cgrp2_attach.c
··· 28 28 #include <fcntl.h> 29 29 30 30 #include <linux/bpf.h> 31 + #include <bpf/bpf.h> 31 32 32 - #include "libbpf.h" 33 + #include "bpf_insn.h" 33 34 34 35 enum { 35 36 MAP_KEY_PACKETS,
+2 -1
samples/bpf/test_cgrp2_attach2.c
··· 24 24 #include <unistd.h> 25 25 26 26 #include <linux/bpf.h> 27 + #include <bpf/bpf.h> 27 28 28 - #include "libbpf.h" 29 + #include "bpf_insn.h" 29 30 #include "cgroup_helpers.h" 30 31 31 32 #define FOO "/foo"
+2 -1
samples/bpf/test_cgrp2_sock.c
··· 21 21 #include <net/if.h> 22 22 #include <inttypes.h> 23 23 #include <linux/bpf.h> 24 + #include <bpf/bpf.h> 24 25 25 - #include "libbpf.h" 26 + #include "bpf_insn.h" 26 27 27 28 char bpf_log_buf[BPF_LOG_BUF_SIZE]; 28 29
+2 -1
samples/bpf/test_cgrp2_sock2.c
··· 19 19 #include <fcntl.h> 20 20 #include <net/if.h> 21 21 #include <linux/bpf.h> 22 + #include <bpf/bpf.h> 22 23 23 - #include "libbpf.h" 24 + #include "bpf_insn.h" 24 25 #include "bpf_load.h" 25 26 26 27 static int usage(const char *argv0)