Commit Graph

23 Commits

Author SHA1 Message Date
Toke Høiland-Jørgensen
8e9fc89bec libbpf: Update submodule version
Update the libbpf submodule to the latest version, and update the configure
script so we check for the newer bpf_object__next_program() helper (to fix
deprecation warnings).

Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
2022-01-17 13:11:27 +01:00
Jesper Dangaard Brouer
45a7e3cab7 lib/Makefile: Enable compiler warnings to USER_TARGETS_OBJS
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2021-10-28 13:51:09 +02:00
Jesper Dangaard Brouer
d4d325ddfc Introduce USER_TARGETS_OBJS_DEPS for extra dependencies
This USER_TARGETS_OBJS_DEPS allows makefiles to define
dependencies for USER_TARGETS_OBJS targets.

Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2021-10-26 16:02:25 +02:00
Jesper Dangaard Brouer
e9002588ef lib: Extend Makefile common.mk with USER_TARGETS_OBJS
This allows including Makefile to define USER_TARGETS_OBJS
that contain code that USER_TARGETS depend on and needs
to be compiled as objects and later linked with.

Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2021-10-26 15:12:47 +02:00
Toke Høiland-Jørgensen
3321c338d5 Merge pull request #25 from xdp-project/nat64
Add nat64 example
2021-10-12 20:24:17 +02:00
Toke Høiland-Jørgensen
a5765295ac configure: Support parsing weird clang versions
Seems some distributions will change the clang version output to be
something like 'Ubuntu clang version
12.0.1-++20210918042554+fed41342a82f-1~exp1~20210918143322.141'. Fix the
version parsing in configure to not barf on such weird version strings.

Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
2021-10-11 14:23:52 +02:00
Toke Høiland-Jørgensen
c7e3acf5d0 common.mk: support generating skeletons for BPF object files
Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
2021-09-29 01:44:49 +02:00
Jesper Dangaard Brouer
8016cec65c lib: update libbpf submodule version
Remember that xdp-project have fork of libbpf we use
 https://github.com/xdp-project/libbpf

Synced to this libbpf via running command:
 git submodule update --remote

Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2021-09-10 17:44:00 +02:00
Toke Høiland-Jørgensen
8230f5de9c lib: update libbpf submodule version
Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
2021-07-05 15:09:43 +02:00
Jesper Dangaard Brouer
4a84222578 Merge pull request #24 from netoptimizer/ktrace01-CO-RE.public
BPF example with ktrace and CO-RE
2021-06-24 21:05:00 +02:00
Simon Sundberg
399c9dc935 pping: Refactor json code and format
Use a JSON-writer library from iproute instead of complicated printf
statement. Also output timestamp, rtt and min_rtt as integers in
nanoseconds, rather than floats in seconds.

Signed-off-by: Simon Sundberg <simon.sundberg@kau.se>
2021-06-23 15:02:26 +02:00
Toke Høiland-Jørgensen
b0536ce4ec lib: Add lib/util for adding utility library code
Add the directory and Makefile rules to prepare for storing library
functions in lib/util like we do in xdp-tools. With this, library code can
be added by just dropping the .c and .h into lib/util and updating
lib/util/util.mk with the object name.

Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
2021-06-01 17:16:24 +02:00
Toke Høiland-Jørgensen
30a6d54da8 lib/libbpf: update to latest upstream version
This updates the libbpf submodule to the latest upstream version, which
notably includes the new API for directly attaching TC programs without
shelling out to the 'tc' binary.

Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
2021-06-01 17:00:01 +02:00
Toke Høiland-Jørgensen
0e7c5d03da lib/common.mk: Depend on all header files in include/ and headers/
The wildcards picking up header files only included specific subdirectories
of include/ and headers/. There are actually files in multiple subdirs,
though, so just expand the wildcard to include all subdirectories to make
sure objects are rebuilt properly.

Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
2021-06-01 16:56:30 +02:00
Jesper Dangaard Brouer
064bc31354 headers/vmlinux: Add arch specific vmlinux.h defines
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2021-06-01 16:23:33 +02:00
Jesper Dangaard Brouer
5cf96508df Move parsing_helpers.h into new include directory
Adjust makefile construct to use the new include direcory.

Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2021-02-09 17:03:55 +01:00
Jesper Dangaard Brouer
74e549520a Change libbpf install location to fix "dirty" submodule
When installing libbpf headers into 'lib/libbpf/src/root/' then the git
submodule for libbpf is marked dirty. This result in stgit complains under
different operations.

This patch fix the issue by installing libbpf outside submodule directory.
Choose directory 'lib/libbpf-install/' to emphasize relation to 'lib/libbpf/'.

V2: Don't install the library only the header files as before. Also
installing the should be a separate commit.  Patch still statically
link with libbpf/src/libbpf.a.

Signed-off-by: Jesper Dangaard Brouer <netoptimizer@brouer.com>
2021-01-13 18:31:45 +01:00
Toke Høiland-Jørgensen
378dcd476b Update libbpf submodule to latest upstream 2021-01-12 21:45:03 +01:00
Toke Høiland-Jørgensen
f0fce8f62b Update kernel headers and libbpf version
This makes the encap-forward example compile and fixes #3.

Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
2020-11-25 11:19:24 +01:00
Toke Høiland-Jørgensen
bc91d4d456 encap-forward: Support conditional IPv6 encapsulation with IPV6=1
Signed-off-by: Toke Høiland-Jørgensen <toke@toke.dk>
2020-10-07 13:35:38 +02:00
Toke Høiland-Jørgensen
e08a4e085d lib/testenv: Don't get iface MAC address before we need it
Resolves a race condition where the MAC can change

Signed-off-by: Toke Høiland-Jørgensen <toke@toke.dk>
2020-10-06 17:13:44 +02:00
Toke Høiland-Jørgensen
b7544155f7 Add lib/Makefile
Signed-off-by: Toke Høiland-Jørgensen <toke@toke.dk>
2020-10-06 15:59:44 +02:00
Toke Høiland-Jørgensen
4513664ca3 Initial import with encap-forward example
Signed-off-by: Toke Høiland-Jørgensen <toke@toke.dk>
2020-10-06 15:53:55 +02:00