Commit Graph

1596 Commits (281ac1ac02cf0da7be1161b25c2ef023b922bc0c)
 

Author SHA1 Message Date
Tamir Duberstein cb455febbb
Merge pull request #814 from tamird/sort-variants-again
maps: sort variants
11 months ago
Tamir Duberstein 8462b69716
maps: sort variants
Missed in 5e637071c1 due to merge skew
with 7b71c7e1cd.
11 months ago
Tamir Duberstein 715d49022e
Merge pull request #812 from tamird/redundant-cargo
Cargo.toml: remove redundant keys
11 months ago
Tamir Duberstein ae612a0a10
Merge pull request #813 from tamird/sort-variants
maps: sort variants
11 months ago
Tamir Duberstein b7ceee4f51
Merge pull request #811 from tamird/libc
aya: import types from std::ffi rather than libc
11 months ago
Tamir Duberstein 5cdd1baf29
aya: import types from std::ffi rather than libc 11 months ago
Tamir Duberstein 5e637071c1
maps: sort variants 11 months ago
Tamir Duberstein cc48523347
Cargo.toml: remove redundant keys
`default-features = false` is already in the root Cargo.toml.
11 months ago
Andrew Stoycos ef27bce619
Merge pull request #783 from astoycos/map_pin2
aya: Implement dedicated map pinning
12 months ago
astoycos 82039144bd integration-test: Add map pinning coverage
Add coverage to the new public api's for
map pinning (pin and unpin) which can be called
on the generic aya::Map type OR explit map types.

Additionally add coverage for the new libbpf
LIBBPF_PIN_BY_NAME behavior.

Signed-off-by: astoycos <astoycos@redhat.com>
12 months ago
astoycos 7b71c7e1cd aya/maps: add pin() api
- Adds new `maps_mut()` API to the BpfManager to allow us to iterate though
and pin all of maps at the same time.

- Adds new pin(Path)/unpin(Path) api to Maps so they
can be generically pinned AFTER load.

- Adds macro for pinning explicit map types in aya.
Convert all explicit map types "inner" field to be
pub crate in order to facilitate this.

Signed-off-by: astoycos <astoycos@redhat.com>
12 months ago
astoycos 0bf97eba64 aya/maps: fix libbpf_pin_by_name
Aligns with libbpf for the special LIBBPF_PIN_BY_NAME
map flag. Specifically if the flag is provided without a pin path
default to "/sys/fs/bpf".

Signed-off-by: astoycos <astoycos@redhat.com>
12 months ago
vadorovsky 66bd85a8de
Merge pull request #806 from vadorovsky/deprecate-syscall-prefix
util: Deprecate `syscall_prefix`
12 months ago
Mike Rostecki bd6ba3ad8b util: Deprecate `syscall_prefix`
Using the prefix only for the host architecture is often not enough,
kernels usually provide symbols for more architectures, which are
used by multilib applications. Handling them might or might not be
necessary depending on the use case. Due to that complexity, we
decided to let the callers to handle prefixes the way they prefer.
12 months ago
Tamir Duberstein 0cd620a9da
Merge pull request #804 from tamird/deflake-xdp
integration/xdp: increase timeout to 60 seconds
12 months ago
Tamir Duberstein 81268b7ac1
integration/xdp: increase timeout to 60 seconds
There's absolutely no reason to have a short timeout here. This has
resulted in at least one flake:
https://github.com/aya-rs/bpf-linker/actions/runs/6384472390/job/17327196576.
12 months ago
Tamir Duberstein 062ebfdc68
integration/xdp: use kernel-allocated port 12 months ago
Tamir Duberstein 64d9799efc
integration/xdp: reduce repetition 12 months ago
ajwerner c547dd7bcc
Merge pull request #800 from ajwerner/deflake-loaded-at-take-2
integration-test: deflake test_loaded_at
12 months ago
Andrew Werner da832e479d integration-test: deflake test_loaded_at
The test could fail due to the lack of clock monotonicity. This PR
deflakes the test by adding retries.

See
https://github.com/aya-rs/aya/actions/runs/6340369670/job/17221591723.
12 months ago
Tamir Duberstein 4bb52ad34c
Merge pull request #801 from aya-rs/kill-kernel-on-soft-lockup
xtask: terminate QEMU on "BUG: soft lockup"
12 months ago
Tamir Duberstein 5392f9821d
xtask: terminate QEMU on "BUG: soft lockup"
See
https://github.com/aya-rs/aya/actions/runs/6329828507/job/17190931752.

Unlike on kernel panic this message prints periodically so it is
permitted to print twice before QEMU is killed.
12 months ago
Tamir Duberstein 373fb7bf06
Merge pull request #797 from aya-rs/rustfmt-group-imports
rustfmt: group_imports = "StdExternalCrate"
12 months ago
Tamir Duberstein d16e607fd4
rustfmt: group_imports = "StdExternalCrate"
High time we stop debating this; let the robots do the work.
12 months ago
Tamir Duberstein 67863833ca
Merge pull request #791 from nrxus/fix-kernel-code-on-submode-gt-255
aya: Fix program loading on kernels with a patch > 255
12 months ago
Tamir Duberstein 9eb0419baa
Merge pull request #796 from aya-rs/integration-ebpf-bpf-arch
integration-test: fix when host != target
12 months ago
Tamir Duberstein 15de14383d
integration-test: build eBPF for the proper arch
Prior to this change we neglected to build integration-ebpf for the
correct target architecture, resulting in test failures on arm64.
12 months ago
Tamir Duberstein ad460879ef
integration-test: replace macro with function
There's just no need for a macro here.
12 months ago
Tamir Duberstein 8cee3f8b01
integration-test: distinguish between success and noop
These tests previously produced the same result on certain failures as
they did on success.
12 months ago
Andrés Medina 0a6a2674fa aya: Fix program loading on kernels with a patch > 255 12 months ago
Tamir Duberstein 2f9c67c735
Merge pull request #795 from aya-rs/clippy
appease clippy
12 months ago
Tamir Duberstein fe13b2eb41
xtask: remove useless copy
/tmp/initrd.img is unused.
12 months ago
Tamir Duberstein cbe9cd9133
xtask: appease new clippy warning
```
warning: unnecessary hashes around raw string literal
  --> xtask/src/docs.rs:70:17
   |
70 |           indoc! {r#"
   |  _________________^
71 | |     User-Agent:*
72 | |     Disallow: /
73 | |     "#},
   | |______^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_raw_string_hashes
   = note: `#[warn(clippy::needless_raw_string_hashes)]` on by default
help: remove all the hashes around the literal
   |
70 ~         indoc! {r"
71 |     User-Agent:*
72 |     Disallow: /
73 ~     "},
   |
```

This false negative was fixed in
https://github.com/rust-lang/rust-clippy/pull/11518 (the title
incorrectly says false positive).
12 months ago
Tamir Duberstein 6720e127b6
Merge pull request #794 from aya-rs/fix-ci
Remove 6.4.x kernels from CI
12 months ago
Tamir Duberstein f01845a379
.github: run tests nightly
This should help us catch breakages more quickly.
12 months ago
Tamir Duberstein 6190696346
.github: remove 6.4.x kernel tests
These images keep getting pulled, better to get off the treadmill.
12 months ago
dependabot[bot] 8ae5b0d967
Merge pull request #793 from aya-rs/dependabot/cargo/dialoguer-0.11 1 year ago
dependabot[bot] 9680f50c08
build(deps): update dialoguer requirement from 0.10 to 0.11
Updates the requirements on [dialoguer](https://github.com/console-rs/dialoguer) to permit the latest version.
- [Changelog](https://github.com/console-rs/dialoguer/blob/master/CHANGELOG.md)
- [Commits](https://github.com/console-rs/dialoguer/compare/v0.10.0...v0.10.4)

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

Signed-off-by: dependabot[bot] <support@github.com>
1 year ago
Alessandro Decina 7f9ce062f4
Merge pull request #527 from Tuetuopay/xdpmaps
Implement XDP map types
1 year ago
Tuetuopay 0edc13b4d4 bpf: add a shared try_redirect_map function for XDP maps 1 year ago
Tuetuopay 579e3cee22 aya, bpf: misc fixes following review comments 1 year ago
Andrew Stoycos c130500f18
Merge pull request #769 from astoycos/fix-loaded-at
fix load time
1 year ago
astoycos dffff1ce6b integration-test: fix load time and add test
Time since boot is defined as the UNIX_EPOCH plus the duration
since boot. which is realtime - boottime NOT boottime - realtime.

Add a integration test to ensure this doesn't happen again.

Signed-off-by: astoycos <astoycos@redhat.com>
1 year ago
Tuetuopay 46551de3e7 xtask: bless public-api 1 year ago
Tuetuopay 00dc7a5bd4 maps/xdp: make maps work on kernels not supporting ProgIds
On startup, the kernel is probed for support of chained program ids for
CpuMap, DevMap and DevMapHash, and will patch maps at load time to have
the proper size. Then, at runtime, the support is checked and will error
out if a program id is passed when the kernel does not support it.
1 year ago
Tuetuopay 63ce2f013a bpf/devmap: don't expose `bpf_devmap_value`
Use our own type that:
- is stable as not from bindgen
- does not have an union inside
1 year ago
Tuetuopay c6754c614e maps/xdp: use ProgramFd instead of impl AsRawFd
Not having a generic here allows to pass `None` without specifying the
actual type you don't care about.
1 year ago
Tuetuopay 9ed1d3d281 bpf: add documentation for XDP maps 1 year ago
Tuetuopay db49633073 bpf: make xdp maps functions safe
Values in those map are small enough to return copied values instead of
reference to values.
1 year ago
Tuetuopay f7fbbcd0e5 aya: fix docstring missing trailing period 1 year ago