Commit Graph

35 Commits

Author SHA1 Message Date
Toke Høiland-Jørgensen
8dedf93c60 lib/xdp-tools: Update submodule version
Update the xdp-tools submodule version to the newest upstream. Among other
things, this contains some build fixes for newer versions of libbpf.

Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
2023-03-16 23:55:52 +01:00
Toke Høiland-Jørgensen
173c2d943e lib/defines.mk: Don't always set -DDEBUG
The defines.mk file always set -DDEBUG, inherited from the xdp-tools build
system. However, the configure script in this repository doesn't actually
support the PRODUCTION variable, so change the define to only set -DDEBUG
if a DEBUG variable is supplied to 'make'. This way DEBUG can be turned on
with a command-line DEBUG=1 parameter to 'make', but will be unset
otherwise.

Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
2023-03-16 23:55:52 +01:00
Toke Høiland-Jørgensen
e715364854 lib/xdp-tools: Update version
This updates the xdp-tools embedded version to fix an issue with the
feature testing of the custom libbpf copy that the bpf-examples repository
is using.

Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
2022-11-29 20:21:45 +01:00
Toke Høiland-Jørgensen
36fb8a32aa libxdp: Update to latest upstream version
Update the xdp-tools submodule version; in particular, this there's a
bugfix for AF_XDP that wasn't in the submodule version.

Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
2022-11-25 11:59:44 +01:00
Toke Høiland-Jørgensen
c92b2c458f lib: Update libbpf submodule to v1.0.1
No reason to keep using the old version, updating doesn't even require
any other source code changes.

Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
2022-11-19 13:06:27 +01:00
Toke Høiland-Jørgensen
ee0ed78ce8 lib/xdp-tools: Update to latest master
This contains a fix to the xdp-tools configure script so it works with the
Dash shell used on Debian and derivatives.

Fixes #50.

Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
2022-08-18 20:40:44 +02:00
Toke Høiland-Jørgensen
c2eb81ec70 Fix xdp-tools submodule to work with libbpf submodule
Update the version of xdp-tools to pull in some configure changes that
makes interoperating between a libbpf submodule and an xdp-tools submodule
work better, and set the LIBBPF_UNBUILT variable in the top-level configure
to enables this support.

Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
2022-04-26 22:03:08 +02:00
Toke Høiland-Jørgensen
6b10ae1c6e Update libbpf submodule version to v0.7.0
This version is the newest version that's compatible with xdp-tools
currently.

Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
2022-04-25 18:03:00 +02:00
Toke Høiland-Jørgensen
f27c7c2c46 lib/util: Import logging helpers from xdp-tools
Include logging.{h,c} from xdp-tools so utilities can use them for setting
libxdp and libbpf logging.

Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
2022-04-20 13:24:22 +02:00
Toke Høiland-Jørgensen
4d74e4aaf3 lib/xdp-tools: update version
Pull the latest version of xdp-tools into the submodule. Change the
wildcard pattern for libxdp to not include the XDP programs to avoid
constantly recompiling it.

Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
2022-04-20 13:12:45 +02:00
Toke Høiland-Jørgensen
4ac5a33a40 lib: simplify installation of libbpf and libxdp submodule libraries
Instead of having the someone redundantly named 'lib/lib-install' folder,
let's rename it to just 'lib/install', and drop the 'usr/' prefix of the
files installed into that directory. Also, to simplify the configure
script, check in the directory to git so it's always present, and always
include it in the include and linker paths. On clean we just clear out the
contents.

Also, copy over libbpf.a to lib/install/lib alongside libxdp.a instead of
putting libbpf/src in the linker path.

Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
2022-04-20 13:12:45 +02:00
Toke Høiland-Jørgensen
ff3e4272ff Integrate libxdp as a submodule
This adds libxdp as a submodule and link target alongside libbpf. This
should make it just as easy for examples to use libxdp as it currently is
for libbpf. Some hoops need to be jumped through to make libxdp link
against the same version of libbpf as the one we use in this repository.

Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
2022-04-20 13:12:45 +02:00
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