Commit Graph

275 Commits

Author SHA1 Message Date
Alan Maguire
7ee515fed9 bpf: fix whitespace for ENCAP_L2 defines in bpf.h
replace tab after #define with space in line with rest of definitions

Signed-off-by: Alan Maguire <alan.maguire@oracle.com>
Acked-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
2019-04-19 09:52:37 -07:00
Andrey Ignatov
6be72ba83c bpf: Sync bpf.h to tools/
Sync bpf_strtoX related bpf UAPI changes to tools/.

Signed-off-by: Andrey Ignatov <rdna@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
2019-04-19 09:52:37 -07:00
Andrey Ignatov
805f4593af bpf: Sync bpf.h to tools/
Sync BPF_PROG_TYPE_CGROUP_SYSCTL related bpf UAPI changes to tools/.

Signed-off-by: Andrey Ignatov <rdna@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
2019-04-19 09:52:37 -07:00
Alan Maguire
b18e6122b6 bpf: sync bpf.h to tools/ for BPF_F_ADJ_ROOM_ENCAP_L2
Sync include/uapi/linux/bpf.h with tools/ equivalent to add
BPF_F_ADJ_ROOM_ENCAP_L2(len) macro.

Signed-off-by: Alan Maguire <alan.maguire@oracle.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
2019-04-19 09:52:37 -07:00
Daniel Borkmann
dd3fc8bde1 sync: latest tooling changes from kernel
[ upstream commit 6b7a21140fca461c6d8d5c65a3746e7da50a409e ]

Needed a custom backport. I've changed fallbacks so that we can
partially pull in barriers step by step. I've fixed x86 ones and
added corresponding arm64 barriers.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
2019-04-11 15:55:59 -07:00
Stanislav Fomichev
e2871d1c75 libbpf: add support for ctx_{size, }_{in, out} in BPF_PROG_TEST_RUN
Support recently introduced input/output context for test runs.
We extend only bpf_prog_test_run_xattr. bpf_prog_test_run is
unextendable and left as is.

Signed-off-by: Stanislav Fomichev <sdf@google.com>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
2019-04-11 09:01:12 -07:00
Daniel Borkmann
bbd32bd59d bpf: sync {btf, bpf}.h uapi header from tools infrastructure
Pull in latest changes from both headers, so we can make use of
them in libbpf.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
2019-04-10 14:27:33 -07:00
Willem de Bruijn
2b9a24d7ce bpf: Sync bpf.h to tools
Sync include/uapi/linux/bpf.h with tools/

Changes
  v1->v2:
  - BPF_F_ADJ_ROOM_MASK moved, no longer in this commit
  v2->v3:
  - BPF_F_ADJ_ROOM_ENCAP_L3_MASK moved, no longer in this commit

Signed-off-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
2019-03-28 19:51:55 -07:00
Lorenz Bauer
0c639aae80 tools: update include/uapi/linux/bpf.h
Pull definitions for bpf_skc_lookup_tcp and bpf_sk_check_syncookie.

Signed-off-by: Lorenz Bauer <lmb@cloudflare.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
2019-03-28 19:51:55 -07:00
Quentin Monnet
80a0a2df47 tools: bpf: synchronise BPF UAPI header with tools
Synchronise the bpf.h header under tools, to report the latest fixes and
additions to the documentation for the BPF helpers.

Signed-off-by: Quentin Monnet <quentin.monnet@netronome.com>
Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
2019-03-19 12:17:19 -07:00
Martin KaFai Lau
c09210b2a2 bpf: Sync bpf.h to tools/
This patch sync the uapi bpf.h to tools/.

Signed-off-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
2019-03-19 12:17:19 -07:00
Andrii Nakryiko
cb658e9724 AF_XDP: add xsk.{c,h} to Makefile and fix build
This patch makes sure we build AF_XDP-related code as part of libbpf. This
also required copying few uapi/linux headers and adding few used definitions
in include headers.

Signed-off-by: Andrii Nakryiko <andriin@fb.com>
2019-03-05 09:22:54 -08:00
brakmo
68cafb4cf7 bpf: sync bpf.h to tools and update bpf_helpers.h
This patch syncs the uapi bpf.h to tools/ and also updates
bpf_herlpers.h in tools/

Signed-off-by: Lawrence Brakmo <brakmo@fb.com>
Acked-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
2019-03-02 21:31:13 -08:00
Alexei Starovoitov
7e447c35b7 tools/bpf: sync bpf.h into tools
sync bpf.h into tools directory

Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
2019-03-02 21:31:13 -08:00
Andrii Nakryiko
6f9a833985 sync with latest bpf-next (#11)
Sync latest libbpf sources. Tested against pahole.

Signed-off-by: Andrii Nakryiko <andriin@fb.com>
2019-02-15 07:38:45 -08:00
yonghong-song
f0bcba631d
sync with latest bpf-next (#10)
sync with latest bpf-next. tested with fb internal testcase and bcc.

Signed-off-by: Yonghong Song <yhs@fb.com>
2019-02-07 21:58:07 -08:00
Yonghong Song
30388a7afd add BPF_EMIT_CALL macro for libbpf_probes.c
libbpf_probes.c accessed BPF_EMIT_CALL. Added the
definition in include/linux/filter.h.

Signed-off-by: Yonghong Song <yhs@fb.com>
2019-02-04 14:39:30 -08:00
yonghong-song
d5b146fec5
add asm/errno.h to linux/err.h (#8)
Otherwise, we will have the following compilation error:

  /home/yhs/work/bcc-new/src/cc/libbpf/src/bpf_prog_linfo.c:
      In function ‘dissect_jited_func’:
  /home/yhs/work/bcc-new/src/cc/libbpf/src/bpf_prog_linfo.c:88:10:
      error: ‘EINVAL’ undeclared (first use in this function)
    return -EINVAL;

The original linux/err.h at linux:tools/include directory
does include "asm/errno.h" as well.

Signed-off-by: Yonghong Song <yhs@fb.com>
2019-01-16 17:16:50 -08:00
yonghong-song
07a48dcda2
sync with latest bpf-next (#6)
The following two new files are added:
  README.rst
  bpf_prog_linfo.c

Signed-off-by: Yonghong Song <yhs@fb.com>
2019-01-03 12:44:33 -08:00
yonghong-song
556e0a0def
bpf: sync with latest bpf-next tree (#5)
sync with latest bpf-next tree.
the include/linux/filter.h is created as libbpf.c tries
to use various insn define macros.

Signed-off-by: Yonghong Song <yhs@fb.com>
2018-11-26 14:32:21 -08:00
Daniel Borkmann
a0e4e323bb bpf: add ring_buffer.h drop in replacement header
Add fast variant for x86-64 for now, and we can later extend for
others upon demand.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
2018-10-19 23:14:46 +02:00
yonghong-song
e5c75f8e94
mirror uapi/linux/bpf_common.h file (#2)
bcc still has this file in its src/cc/compat/linux directory.
Add this file to libbpf as well.

Signed-off-by: Yonghong Song <yhs@fb.com>
2018-10-12 12:57:55 -07:00
Andrey Ignatov
c2015d0a65 Add if_link.h and netlink.h UAPI headers
Add more UAPI headers from kernel tree since libbpf relies on their
latest versions that may not be present on target system to use in
build.

if_link.h and netlink.h are synced to include/uapi/linux/ from [1]

[1]
https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/tree/tools/include/uapi/linux

Signed-off-by: Andrey Ignatov <rdna@fb.com>
2018-10-11 15:26:06 -07:00
Yonghong Song
8acf2635c3 add a simple Makefile to build and clean up
add missing macros, static inline functions, etc.
add README to illustrate the purpose of this repo.

Signed-off-by: Yonghong Song <yhs@fb.com>
2018-10-10 09:40:15 -07:00
Yonghong Song
66684189f0 initial commit
This initial commit added the following files
from bpf-next repository:
  src:
    <files from linux:tools/lib/bpf>
    bpf.c bpf.h btf.c btf.h libbpf.c libbpf.h
    libbpf_errno.c netlink.c nlattr.c nlattr.h
    str_error.c str_error.h
  include:
    <files from linux:tools/include/uapi/linux>
    uapi/linux/{bpf.h, btf.h}

    <files from linux:tools/include/tools>
    tools/libc_compat.h

The following files are also added:
  include/linux/{err.h, kernel.h, list.h, overflow.h, types.h}
These files are customized headers to satisfy compilation.
Their original counterparts are at linux:tools/include/linux
directory.

Signed-off-by: Yonghong Song <yhs@fb.com>
2018-10-09 21:56:40 -07:00