Skip to content

Conversation

@tohojo
Copy link
Member

@tohojo tohojo commented Oct 18, 2021

This adds support for embedding libxdp and linking userspace binaries against it. It relies on recent changes in the xdp-tools repository to support this.

There's one outstanding issue with this: the embedded version of libxdp needs to be able to find the dispatcher BPF object, which it is not able to do with the custom install path currently. This needs to be fixed in upstream libxdp.

tohojo added 5 commits April 20, 2022 13:12
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>
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>
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>
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>
Use the newly-added logging helpers from logging.h and add a -v option to
increase the effective log level.

Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
@tohojo tohojo marked this pull request as ready for review April 20, 2022 11:27
@tohojo tohojo merged commit 441650c into master Apr 20, 2022
@tohojo tohojo deleted the libxdp branch April 20, 2022 11:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants