Commit Graph

1080 Commits (0970300d1f5659622fa55a18dd7681c608d75b0f)
 

Author SHA1 Message Date
Alessandro Decina 113e3ef018
Merge pull request #539 from marysaka/fix/map_data_clone
aya: Fix MapData Clone implementation
2 years ago
Mary 94049ec661 aya: Fix MapData Clone implementation
The Clone implementation of MapData was previously not storing the
result of the dup operation.
2 years ago
Dave Tucker 8684a5783d
Merge pull request #537 from aya-rs/codegen
Update libbpf to a41e6ef3251cba858021b90c33abb9efdb17f575
2 years ago
dave-tucker 24f15ea25f [codegen] Update libbpf to a41e6ef3251cba858021b90c33abb9efdb17f575Update libbpf to a41e6ef3251cba858021b90c33abb9efdb17f575
Files changed:
M	aya-obj/src/generated/btf_internal_bindings.rs
M	aya-obj/src/generated/linux_bindings_aarch64.rs
M	aya-obj/src/generated/linux_bindings_armv7.rs
M	aya-obj/src/generated/linux_bindings_riscv64.rs
M	aya-obj/src/generated/linux_bindings_x86_64.rs
M	bpf/aya-bpf-bindings/src/aarch64/bindings.rs
M	bpf/aya-bpf-bindings/src/armv7/bindings.rs
M	bpf/aya-bpf-bindings/src/riscv64/bindings.rs
M	bpf/aya-bpf-bindings/src/x86_64/bindings.rs
2 years ago
vadorovsky 7e4454d061
Merge pull request #532 from Tuetuopay/cpudevmap-bindings
xtask: generate userspace bindings for bpf_{cpu,dev}map_val
2 years ago
Tuetuopay 23e7c65244 xtask: generate userspace bindings for bpf_{cpu,dev}map_val 2 years ago
Dave Tucker d9878a6791
Merge pull request #524 from dave-tucker/prog_list
aya: Add loaded_programs() API to list all loaded programs
2 years ago
Dave Tucker de4905a24b aya: Add loaded_programs() API to list all loaded programs
This uses a Programs iterator to yield all loaded bpf programs using
bpf_prog_get_next_id.

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2 years ago
Dave Tucker b1a70fc6e4 aya: MapData should be Borrow, not AsRef
We don't ever do ref-to-ref conversion for MapData so Borrow should
suffice.

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2 years ago
Dave Tucker 56c143831e
Merge pull request #523 from dave-tucker/fix_perf_link
aya: Fix is_perf_link_supported
2 years ago
Dave Tucker ce79de7ff6 aya: Fix is_perf_link_supported
This was mistakenly comparing the exit code of the syscall, which is
always -1 and not the corresponding error-code. Added unit tests to
ensure we don't regress.

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2 years ago
Alessandro Decina d7d6442671
Merge pull request #522 from dave-tucker/perf_link
Use bpf_link for perf_attach programs (Kprobe/Uprobe/Tracepoint etc...)
2 years ago
Dave Tucker 7479c1dd6c aya: More discrete feature logging
Just use the Debug formatter vs. printing a message for each probe.

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2 years ago
Dave Tucker d0b3d3b2fa aya: Enable bpf_link for perf_attach programs
This adds support for bpf_link to PerfEvent, Tracepoint, Kprobe and
Uprobe programs.

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2 years ago
Dave Tucker 763b92a2e0 aya: Add probe for bpf_link_create for perf programs
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2 years ago
Dave Tucker ce22ca668f aya: Make features a lazy_static
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2 years ago
Alessandro Decina bc83f208b1
Merge pull request #519 from dave-tucker/frags
XDP Multi-Buffer Support
2 years ago
Dave Tucker 376c486400 aya-bpf: Add multibuffer support for XDP
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2 years ago
vadorovsky bb1b39535c
Merge pull request #517 from dmitris/derive-debug
aya-tool: remove outdated workaround
2 years ago
Dave Tucker a18693b42d aya: Add support for multibuffer programs
This adds support for loading XDP programs that are multi-buffer
capable, which is signalled using the xdp.frags section name. When this
is set, we should set the BPF_F_XDP_HAS_FRAGS flag when loading the
program into the kernel.

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2 years ago
Dmitry Savintsev 96b282d149 aya-tool: remove outdated workaround
The comment says that `.derive_debug` was needed as
a workaround for https://github.com/rust-lang/rust-bindgen/issues/2083.
This issue is now closed, and aya-tool compiles without derive_debug.

Additionally, update bindgen dependency to 1.64.

Signed-off-by: Dmitry Savintsev <dsavints@gmail.com>
2 years ago
Dave Tucker 811ab299de
Merge pull request #496 from dave-tucker/program-from-pinned3
aya: Add from_pin for Programs
2 years ago
Dave Tucker 7a720ab0c1 aya: Add from_pin for Programs
This commit adds from_pin() which allows the creation of a Program
from a path on bpffs. This is useful to be able to call `attach` or
other APIs for programs that are already loaded to the kernel.

This differs from #444 since it implements this on the concrete program
type, not the Program enum, allowing the user to pass in any additional
context that isn't available from bpf_prog_info.

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2 years ago
Alessandro Decina cfa693bc3b
Merge pull request #515 from alessandrod/fix-lru-hash
aya: fix Lru and LruPerCpu hash maps
2 years ago
Alessandro Decina c22014c757 aya: fix Lru and LruPerCpu hash maps
They were broken by https://github.com/aya-rs/aya/pull/397
2 years ago
Alessandro Decina 7868fffd7f
Merge pull request #514 from astoycos/fix-badge
Fix Aya build badge
2 years ago
Andrew Stoycos 4ddbc1cacb
Fix Aya build badge
Signed-off-by: Andrew Stoycos <astoycos@redhat.com>
2 years ago
Alessandro Decina 27017ca8a3
Merge pull request #512 from astoycos/crucial-btf-fixes
Support BTF key/value specification for all maps
2 years ago
Andrew Stoycos 52e625060e
Support BTF key/value specification for all maps
Fix a bug which was resulting in `ENOTSUPP` following
the `BPF_MAP_CREATE` Syscall.  This fix was initially
found by libbpf maintainers in:
https://github.com/libbpf/libbpf/issues/355.

Signed-off-by: Andrew Stoycos <astoycos@redhat.com>
2 years ago
Alessandro Decina 22d79312f7
Merge pull request #445 from anfredette/tc-link-recon
Support reconstruction of `SchedClassifierLink`
2 years ago
Andre Fredette 7855a0e0c6 retrigger checks
Signed-off-by: Andre Fredette <afredette@redhat.com>
2 years ago
Andre Fredette 7c24296b5d Address review comments from @alessandrod
Signed-off-by: Andre Fredette <afredette@redhat.com>
2 years ago
Michal Rostecki be5b4c82cc
Merge pull request #508 from aya-rs/dependabot/cargo/indoc-2.0
build(deps): update indoc requirement from 1.0 to 2.0
2 years ago
dependabot[bot] 912ee06f39
build(deps): update indoc requirement from 1.0 to 2.0
Updates the requirements on [indoc](https://github.com/dtolnay/indoc) to permit the latest version.
- [Release notes](https://github.com/dtolnay/indoc/releases)
- [Commits](https://github.com/dtolnay/indoc/compare/1.0.0...2.0.0)

---
updated-dependencies:
- dependency-name: indoc
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2 years ago
Alessandro Decina e8e276730e
Merge pull request #453 from alessandrod/btf-kind-enum64
Add support for BTF_KIND_ENUM64
2 years ago
Alessandro Decina 9a6f8143a1 aya: btf: add support for BTF_KIND_ENUM64 2 years ago
Alessandro Decina f81b1b9f3e
Merge pull request #501 from alessandrod/fix-enum32-relocs
aya: btf: fix relocations for signed enums (32 bits)
2 years ago
Alessandro Decina 4482db42d8 aya: btf: fix relocations for signed enums (32 bits)
Enums now carry a signed bit in the info flags. Take it into account
when applying enum relocations.
2 years ago
Alessandro Decina d6b976c6f1 aya: btf: switch ComputedRelocationValue::value to u64
This is in preparation of adding Enum64 relocation support
2 years ago
Alessandro Decina 9d7c950d1b
Merge pull request #506 from alessandrod/macos-tests
Speed up integration tests
2 years ago
Alessandro Decina 455cc95e8f integration-tests: run on macos to get nested virtualization
Switch integration-test host to macos as only macos runners support nested
virtualization. Adjust integration test runner accordingly.
2 years ago
Alessandro Decina 8e9608eedd test/run.sh: output `uname -a` after starting the vm 2 years ago
Alessandro Decina c7b262641b Run integration tests under fedora37 2 years ago
Michal Rostecki d2a999d27a
Merge pull request #504 from vadorovsky/unpin-nightly
Unpin Rust nightly
2 years ago
Michal Rostecki 7d19bde66b Unpin Rust nightly
The issues with core::sync::atomic got fixed.

Signed-off-by: Michal Rostecki <vadorovsky@gmail.com>
2 years ago
Alessandro Decina 3e9d85f871
Merge pull request #500 from vadorovsky/bpf-macros-visibility
aya-bpf-macros: Allow to make programs public
2 years ago
Alessandro Decina 7e5637bb9c
Merge pull request #471 from banditopazzo/tracefs_mount_select
add tracefs mount point select function
2 years ago
banditopazzo 48fdf5a250 chore: tracefs review fixes 2 years ago
banditopazzo c6c4ac7eea feat: get_tracefs function 2 years ago
Michal Rostecki 6ad2c3c373 aya-bpf-macros: Allow to make programs public
Allow to define programs as public functions (even in library crates)
and then import them.

For example, we can have library crate with `libfoo/src/lib.rs`
containing:

```rust
pub fn my_xdp_program(ctx: XdpContext) -> u32 {
    xdp_action::XDP_PASS
}
```

And then a binary importing it:

```rust
pub use libfoo::my_xdp_program;
```

This way, commonly used eBPF programs can be distributed as lib crates.

Tested with: https://github.com/vadorovsky/aya-examples/tree/main/pub-progs

Signed-off-by: Michal Rostecki <vadorovsky@gmail.com>
2 years ago