Commit Graph

71 Commits (897957ac84370cd1ee463bdf2ff4859333b41012)

Author SHA1 Message Date
Shenghui Ye 81bc307dce aya-obj: migrate bindgen destination
Aya::obj depends on bindgen generated files, and we start
by migrating bindgen generated files.

This commit adds the new aya-obj crate to the workplace
and migrates generated files into the crate. We use core
instead of std in an effort to make the final crate no_std.

Bindgen was run against libbpf v1.0.1.

Refs: #473
2 years ago
Alessandro Decina 63bbef46da Fix lints 2 years ago
Dmitry Savintsev 055d94f58b fix uninlined_format_args clippy issues 2 years ago
Dmitry Savintsev 22340764a3 upgrade clap to 4.x 2 years ago
Alessandro Decina 832bdd280c {{crate_name}}: release version 0.1.13 2 years ago
Dmitry Savintsev d0424fb091 fix clippy needless_borrow warning 2 years ago
Andrew Stoycos 82edd681c3 Fix doc links, update rustdoc args
Fix some broken rust doc links.

Make sure rustdoc build fail on warnings
so we catch these broken links in CI.

Signed-off-by: Andrew Stoycos <astoycos@redhat.com>
2 years ago
Dave Tucker ec2bd69053 cargo: Remove unused dependencies
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2 years ago
Dave Tucker 95e8c78db8 docs: Add labels for optional features
Following the lead of crates like tokio and nix, we now annotate APIs
that require optional features. This helps in cases where a user wants
to have an `AsyncPerfEventArray` which is documented on crates.io, but
it's not obvious that you have to enable the `async` feature.

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2 years ago
Dave Tucker a8eef00595 clippy: Fix latest nightly lints
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2 years ago
Dave Tucker bc088921b8 codgen: Add bpf_link_type
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2 years ago
Dave Tucker a0641c15e4 codegen: Add bpf_map_info and bpf_link_info
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2 years ago
Dave Tucker aaa20cc1fd aya-gen: Rename to aya-tool
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2 years ago
Michal Rostecki 944d6b8a16 Change from Rust edition 2018 to 2021
Rust 2021 adds more core prelude imports, including `TryFrom` and
`TryInto`.

Signed-off-by: Michal Rostecki <vadorovsky@gmail.com>
2 years ago
Dave Tucker 5e6b75a29a xtask: Fix integration-test command
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2 years ago
Dave Tucker dc31e11691 Re-organize into a single workspace
This commit moves the aya-log projects from the subtree and adds them to
the main cargo workspace. It also brings the BPF crates into the
workspace and moves the macro crates up a level since they aren't BPF
code.

Miri was disabled for aya-bpf as the previous config wasn't actually
checking anything.

CI, clippy, fmt and release configurations have all been adjusted
appropriately.

CI was not properly running for other supported arches which was also
ixed here.

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2 years ago
Dave Tucker 79101e748a test: Replace RTF with Rust
This commit replaces the existing RTF test runner with a simple rust
binary package called - integration-test.

integration-test depends on integration-ebpf, which contains test eBPF
code written in Rust and C. `cargo xtask build-integration-test-ebpf`
can be used to build this code and supress rust-analyzer warnings. It
does require `bpf-linker`, but that is highly likely to be available to
developers of Aya. It also requires a checkout of `libbpf` to extract
headers like bpf-helpers.h.

Since everything is compiled into a single binary, it can be run
be run locally using `cargo xtask integration-test` or remotely using
`./run.sh` which re-uses the bash script from the old test framework
to spawn a VM in which to run the tests.

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2 years ago
Davide Bertola 7f33d67e8c xtask: fix linting warnings on docs() 2 years ago
Davide Bertola 2680693783 xtask: fix lint errors due to clap changes 2 years ago
Dave Tucker 67951cd2d7 xtask: Fix docs generation
Publish user/kernel space docs seperately.
Add an index.html at the root for navigation.
Ensure that search engines don't index these pages.

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2 years ago
Davide Bertola cda9ab4f66 upgrade from structopt to clap 3 2 years ago
crabby-the-crab de4e97aa51
Revert "docs: Merge search indexes" 2 years ago
Dave Tucker a00d16dc0e docs: Merge search indexes
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2 years ago
William Findlay 777e6a2a5d xtask/codegen: generate bindings for BPF_RINGBUF types 2 years ago
Dave Tucker 9a33b6b654 aya-gen: Remove getters
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2 years ago
gianluigi d35680f30c Add riscv64 architecture support to xtask/codegen 2 years ago
Dave Tucker ba312c48d5 xtask: Add all crates to sidebar
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2 years ago
Kenjiro Nakayama 42baf1c074 Remove bpf_adj_room_mode 2 years ago
Kenjiro Nakayama 200d42e414 xtask: Add `bpf_.*` instead of `bpf_map_.*` to allowed type
This patch replaces `bpf_map_.*` with `bpf_.*`.

Currently some types that are not used in helper functions are not generated for bindings - e.g. `bpf_sk_lookup`, `bpf_sockopt` and etc.
This patch replaces `bpf_map_.*` with `bpf_.*`.

Note, this PR does not include bindings files as it would be better to be created by auto script.
The missing bindings can be created by `cargo xtask codegen --libbpf-dir /<PATH_TO>/libbp`.
2 years ago
Dave Tucker 8205bee930 xtask: Add docs build
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2 years ago
Dave Tucker 19af687480 codegen: add btf_decl_tag
This is required to add support for BTF_KIND_DECL_TAG

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
3 years ago
Ubuntu 0beb0c501f Add bpf_lpm_trie_key to aya codegen to generate bindings 3 years ago
Dave Tucker f8021c33fc codegen: Add bindings for BPF_F flags
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
3 years ago
Dave Tucker 23d1920854 codegen: add bindings for btf structs
This adds `bpf_btf_info` which can be used to get BPF information via a
syscall. It also adds `btf_line_info` and `btf_func_info` which are
required to parse the line and func info sections of BTF

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
3 years ago
Alessandro Decina d341b58293 xtask: codegen: generate bindings for user_pt_regs
user_pt_regs is used in aarch64 instead of pt_regs
3 years ago
Alessandro Decina eb654d1e3e xtask: codegen: fix bindings for archs other than x86 3 years ago
Alessandro Decina 75acbe1455 xtask: fix clippy warning 3 years ago
alessandrod 03e9935358 Bump libbpf to 92c1e61a605410b16d6330fdd4a7a4e03add86d4
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
3 years ago
Alessandro Decina 7af1cf136c aya: generate bindings for more perf types 3 years ago
Alessandro Decina 4fcb1d75b9 aya-gen: bump bindgen to 0.59 3 years ago
Alessandro Decina ca14306860 aya-gen: use aya_bpf::cty instead of aya_bpf_cty
This avoids having to add an explicit extra dep on aya-bpf-cty in ebpf
programs
3 years ago
Alessandro Decina 2d16843d5d xtask: clippy warnings 3 years ago
Simone Margaritelli 8311abfdcb
added support for armv7-unknown-linux-gnueabi and armv7-unknown-linux-gnueabihf
* new: added support for armv7-unknown-linux-gnueabi (closes alessandrod/aya/issues/22)

* fix: replaced custom type defintions with proper libc types

* fix: fixed pointless parameter binding

* new: added linker for armv7-unknown-linux-gnueabihf to cargo config
3 years ago
Alessandro Decina 35e9b4e639 bpf: don't generate bpf_map_def and fix aya_bpf::bindings overrides 3 years ago
Alessandro Decina a847d6d53b xtask: aya-bpf-bindings: add bpf_adj_room_mode 3 years ago
Alessandro Decina 8cd669ca9a xtask: fix include paths for kernel headers bundled with libbpf 3 years ago
Arnabjyoti Kalita 6974d349e8
programs: add support for attaching and detaching TC programs
This change adds support for attaching TC programs directly from aya, without
having to use iproute2/tc.
3 years ago
Alessandro Decina 157c0e2831 bpf: generate bindings for SOL_SOCKET and SO_* socket options
This is needed for bpf_getsockopt() and bpf_setsockopt()
3 years ago
Alessandro Decina 5effc972ac aya: add support for BPF_PROG_TYPE_SCHED_CLS programs 3 years ago
Alessandro Decina c44393d59b xtask: codegen: use uapi kernel headers from libbpf
libbpf periodically syncs uapi headers from the kernel. Use those to
generate bindings so that we don't have to rely on distro packages
when we cut releases.
3 years ago