Commit Graph

1462 Commits (f01845a379c8e624e250317f8294732f3548bdd9)
 

Author SHA1 Message Date
abhijeetbhagat c83d012c51 preserve existing behavior and avoid changes to gh workflows/xtask 2 years ago
abhi 4183c7a7d2
Merge branch 'aya-rs:main' into integration-tests-cli-options 2 years ago
Dave Tucker 77c5543993
Merge pull request #408 from abhijeetbhagat/patch-1
add libelf as a pre-requisite for linux, libbpf repo link
2 years ago
Michal Rostecki 94bc93ea07
Merge pull request #411 from abhijeetbhagat/fix-warnings
fix all clippy warnings
2 years ago
abhijeetbhagat 6c813b8c38 fix all clippy warnings 2 years ago
Michal Rostecki 57ab0d7978
Merge pull request #406 from dave-tucker/unused-deps
cargo: Remove unused dependencies
2 years ago
abhijeetbhagat 7499661670 fix formatting 2 years ago
abhijeetbhagat 638cf514fb use macro to log, execute test and handle error 2 years ago
abhijeetbhagat 5b3e0ee856 add list, run cli flags to integration tests.
fixes: #338
2 years ago
abhi 493a8db0ec
add libelf as a pre-requisite for linux, libbpf repo link 2 years ago
Dave Tucker ec2bd69053 cargo: Remove unused dependencies
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2 years ago
Dave Tucker 14ba644aa5
Merge pull request #404 from dave-tucker/async-docs
docs: Add labels for optional features
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
Michal Rostecki ae6fc95a8c
Merge pull request #401 from vadorovsky/fix-integration-tests
integration-test: Change `assert_loaded` to a macro with timeouts
2 years ago
Michal Rostecki b15e1f8226 integration-test: Change `assert_loaded` to a macro with timeouts
We often need to wait a bit until the program or link gets unloaded
after dropping.

Also, using a macro makes it clear in which particular test the panic
happened.

Signed-off-by: Michal Rostecki <vadorovsky@gmail.com>
2 years ago
Michal Rostecki 3f2f3a8be0
Merge pull request #398 from vadorovsky/fix-miri
Fix CI errors
2 years ago
Michal Rostecki 325391892c integration-test: Remove multimap C test
libbpf 1.0 doesn't support multimaps defined in `maps` section, it
supports only BTF maps.

At the same time, we already test multimaps loading with the Rust
example (`integration-ebpf/src/bpf/map_test.rs`), so we can just remove
the failing C test.

Signed-off-by: Michal Rostecki <vadorovsky@gmail.com>
2 years ago
Michal Rostecki 43aff57793 maps: Disable miri warnings about integer-to-pointer conversions
`override_syscall` performs integer-to-pointer conversion. This is
considered harmful on the newest Rust nightly which provides
`ptr::from_exposed_addr`, but there is no other way on Rust stable than
doing `as *const T`, which is what miri is unhappy about.

Signed-off-by: Michal Rostecki <vadorovsky@gmail.com>
2 years ago
Michal Rostecki 2432677b2b Avoid integer to pointer casts
Instead, operate on byte slices if possible. That's the first step in
getting rid of miri warnings about Strict Provenance[0].

[0] https://doc.rust-lang.org/nightly/std/ptr/index.html#strict-provenance

Signed-off-by: Michal Rostecki <vadorovsky@gmail.com>
2 years ago
Alessandro Decina a93a975cc6
Merge pull request #393 from aztecher/impl-set_max_entries
aya: add BpfLoader::set_max_entries
2 years ago
aztecher 2eccf1d57d aya: add BpfLoader::set_max_entries
Add BpfLoader::set_max_entries, which sets the max_entries for the
specified map, as the load-time option.
The max_entries set at map initialization in the ebpf component can be
overwritten by this method called on the userspace component.
If you want to set max_entries for multiple maps in an ebpf component,
you can do so by calling set_max_entries in the form of a method chain.

Fixes: #308
Refs: #292
2 years ago
Michal Rostecki 6eca4f5709
Merge pull request #394 from vadorovsky/clippy
Fix clippy warnings
2 years ago
Michal Rostecki 5a4b5ff8d8 Fix clippy warnings
Signed-off-by: Michal Rostecki <vadorovsky@gmail.com>
2 years ago
Dave Tucker e696389837
Merge pull request #391 from dave-tucker/fix-387
Consistently name Pin APIs as from_pin
2 years ago
Dave Tucker 5693fb9941 aya: Rename from_pinned and from_path to from_pin
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2 years ago
Dave Tucker de6fa98963 aya: Fix review comments from #387
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2 years ago
Dave Tucker eb26a6b116
Merge pull request #387 from astoycos/map-from-prog
Load static maps
2 years ago
Michal Rostecki 367ab20305
Merge pull request #390 from dave-tucker/clippy-up
clippy: Fix latest nightly lints
2 years ago
Dave Tucker b2924a3a26 aya-log: Make miri happy
Miri took issue about using slice::from_raw_parts without checking for
alignment. Instead, we can simply convert to a [u8;16] into a [u16;8] by
iterating in chunks of 2 and bitshifting (remembering that these arrays
are in network-endian order).

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
Andrew Stoycos 8a9cbf179f Add `from_pinned` and `from_fd` methods
Add `from_pinned` to allow loading BPF maps
from pinned points in the bpffs and
`from_fd` to allow loading BPF maps from
RawFds aquired via some other means eg
a unix socket.

These functions return an
aya::Map which has not been used previously
but will be the future abstraction once
all bpf maps are represented as an enum.

Signed-off-by: Andrew Stoycos <astoycos@redhat.com>
2 years ago
Dave Tucker 98e25ca5e6
Merge pull request #378 from dave-tucker/pin-fixes-again
aya: More pinning fixes
2 years ago
Dave Tucker 7c244e1f65 tests: Add integration test for pinning lifecycle
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2 years ago
Dave Tucker 4ed587becc aya-tool: Fix clippy lints
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2 years ago
Dave Tucker f961cbb3d4 aya: Replace From<FdLink> for XdpLink with TryFrom
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2 years ago
Dave Tucker 6af2053cf3 aya: Rename bpf_obj_get_info_by_id
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2 years ago
Dave Tucker 23c0460ab3
Merge pull request #388 from dave-tucker/fedora-up
tests: Use Fedora 36
2 years ago
Alessandro Decina fe22b02108
Merge pull request #376 from conectado/verifier-log-level
Update `VerifierLogLevel` to use bitflags
2 years ago
Dave Tucker 1a9903d864 tests: Use Fedora 36
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2 years ago
conectado 3bed2c2b94
aya: fix miss doc period 2 years ago
conectado c30ae6e001
aya: change variant names 2 years ago
Dave Tucker 4b5b9ab3d9 aya: More pinning fixes
This commit fixes a bug and adds some missing lifecycle APIs.

1. Adds PinnedLink::from_path to create a pinned link from bpffs
2. Adds From<PinnedLink> for FdLink to allow for ^ to be converted
3. Adds From<FdLink> for XdpLink

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2 years ago
Dave Tucker 7b99a57330
Merge pull request #384 from aya-rs/codegen
Update libbpf to efd33720cdf4a0049323403df5daad0e9e894b3d
2 years ago
dave-tucker ed849ffd18 [codegen] Update libbpf to efd33720cdf4a0049323403df5daad0e9e894b3dUpdate libbpf to efd33720cdf4a0049323403df5daad0e9e894b3d
Files changed:\nM	aya/src/generated/linux_bindings_aarch64.rs
M	aya/src/generated/linux_bindings_armv7.rs
M	aya/src/generated/linux_bindings_riscv64.rs
M	aya/src/generated/linux_bindings_x86_64.rs
2 years ago
Dave Tucker aa16c7bc92
Merge pull request #383 from dave-tucker/oops-another-one
codgen: Add bpf_link_type
2 years ago
Dave Tucker bc088921b8 codgen: Add bpf_link_type
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2 years ago
Michal Rostecki 49c5a94aa0
Merge pull request #381 from aya-rs/codegen
Update libbpf to efd33720cdf4a0049323403df5daad0e9e894b3d
2 years ago
Michal Rostecki 306f83aab0
Merge pull request #352 from vadorovsky/tc-context
ebpf: Add TcContext for classifier programs
2 years ago
dave-tucker 8e96011c2d [codegen] Update libbpf to efd33720cdf4a0049323403df5daad0e9e894b3dUpdate libbpf to efd33720cdf4a0049323403df5daad0e9e894b3d
Files changed:\nM	aya/src/generated/btf_internal_bindings.rs
M	aya/src/generated/linux_bindings_aarch64.rs
M	aya/src/generated/linux_bindings_armv7.rs
M	aya/src/generated/linux_bindings_riscv64.rs
M	aya/src/generated/linux_bindings_x86_64.rs
M	bpf/aya-bpf-bindings/src/aarch64/bindings.rs
M	bpf/aya-bpf-bindings/src/aarch64/helpers.rs
M	bpf/aya-bpf-bindings/src/armv7/bindings.rs
M	bpf/aya-bpf-bindings/src/armv7/helpers.rs
M	bpf/aya-bpf-bindings/src/riscv64/bindings.rs
M	bpf/aya-bpf-bindings/src/riscv64/helpers.rs
M	bpf/aya-bpf-bindings/src/x86_64/bindings.rs
M	bpf/aya-bpf-bindings/src/x86_64/helpers.rs
2 years ago
Dave Tucker 8ed77ebe1d
Merge pull request #380 from dave-tucker/info-structs
codegen: Add bpf_map_info and bpf_link_info
2 years ago