Commit Graph

1663 Commits (843f4a6cc6a8e295ae36ea0c986c8295cef66c0d)
 

Author SHA1 Message Date
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
Tuetuopay 0647927e32 xdp: add support for chained xdp programs in {cpu,dev}map
set/insert functions can now take an optional bpf program fd to run once
the packet has been redirected from the main probe
1 year ago
Tuetuopay 139f382638 aya: add support for map-bound XDP programs
Such programs are to be bound to cpumap or devmap instead of the usual
network interfaces.
1 year ago
Tuetuopay 4452364c41 macros: add 'map' option to xdp macro
This option allows to place the program in the specific sections to
chain programs with devmaps and cpumaps.
1 year ago
Tuetuopay ad3087d7eb bpf: Update XDP maps implementation
The implementation changed since the original commit was written, and
some mistakes went in:
- missing bpf_redirect_map wrapper
- extra bpf_map_lookup_elem on maps for which it is forbidden
1 year ago
Tuetuopay ede3e91014 aya: Update XDP maps implementations
Map impls changed since this was first written.

Fixes: 2b726c8 ("aya: Implement XDP Map Types")
1 year ago
Dave Tucker e90d521a21 bpf: Implement XDP maps
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
1 year ago
Dave Tucker ec8293ab86 aya: Implement XDP Map Types
This commit adds implementations for:
- xskmap
- devmap
- devmap_hash
- cpumap

Which can all be used to redirect XDP packets to various different
locations

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
1 year ago
Dave Tucker 42fd82e32b
Merge pull request #790 from dave-tucker/no-map-pinned 1 year ago
Dave Tucker 938f979fe7 aya: Make MapData::pin pub
This is to solve a use-case where a user (in this case bpfd) may want
to:

- MapData::from_pin to open a pinned map from bpffs
- MapData::pin to pin that object into another bpffs

Both operations should be easily accomplished without needing to cast
a MapData into a concrete Map type - e.g aya::maps::HashMap.

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
1 year ago
Dave Tucker 0f4021ec89 aya: Remove MapData::pinned
BPF objects can be pinned multiple times, to multiple different places.
Tracking whether or not a map is pinned in a bool is therefore not sufficient.
We could track this in a HashSet<PathBuf>, but there is really no reason
to track it at all.

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
1 year ago
Andrew Stoycos 0b6ea313de
Merge pull request #782 from astoycos/prog-info
aya: add program_info() api to `Program`
1 year ago
Tamir Duberstein 41d01f638b
Merge pull request #770 from aya-rs/mapfd-is-owned
maps: `MapFd` and `SockMapFd` are owned
1 year ago
Tamir Duberstein 0dacb34d44
maps: fix typos, avoid fallible conversions 1 year ago
Tamir Duberstein b4d5a1e8db
maps: MapData::{obj, fd} are private 1 year ago
Tamir Duberstein f41592663c
maps: `MapFd` and `SockMapFd` are owned
`MapData::fd` is now a `MapFd`. This means that `MapData` now closes the
file descriptor on drop. In the future we might consider making `MapFd`
hold a `BorrowedFd` but this requires API design work due to overlapping
borrows.

Since `SockMapFd` is no longer `Copy`, attach methods to take it by
reference to allow callers to use it multiple times as they are
accustomed to doing.

`SockMapFd` implements `try_clone`. `MapFd` and `SockMapFd` are now
returned by reference to allow callers to avoid file descriptor cloning
when desired.

This is an API breaking change.

Updates #612.
1 year ago
dependabot[bot] 33018c16f4
Merge pull request #788 from aya-rs/dependabot/cargo/cargo_metadata-0.18.0 1 year ago
dependabot[bot] e0880316c3
build(deps): update cargo_metadata requirement from 0.17.0 to 0.18.0
Updates the requirements on [cargo_metadata](https://github.com/oli-obk/cargo_metadata) to permit the latest version.
- [Release notes](https://github.com/oli-obk/cargo_metadata/releases)
- [Changelog](https://github.com/oli-obk/cargo_metadata/blob/main/CHANGELOG.md)
- [Commits](https://github.com/oli-obk/cargo_metadata/compare/0.17.0...0.17.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
1 year ago
astoycos 6ab7475fa6 aya: add program_info() api to program
Add a new api to the outer level `Program` structure which
allows users to get the program's kernel info before casting
it to an explicit program variant.

Signed-off-by: astoycos <astoycos@redhat.com>
1 year ago
dependabot[bot] 96c8bc9fa5
Merge pull request #784 from aya-rs/dependabot/cargo/bindgen-0.68 1 year ago
Tamir Duberstein 5691829fcf
Merge pull request #786 from aya-rs/no-sleep
integration-test: remove all sleeps
1 year ago
dependabot[bot] 9686092280
build(deps): update bindgen requirement from 0.66 to 0.68
Updates the requirements on [bindgen](https://github.com/rust-lang/rust-bindgen) to permit the latest version.
- [Release notes](https://github.com/rust-lang/rust-bindgen/releases)
- [Changelog](https://github.com/rust-lang/rust-bindgen/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/rust-bindgen/compare/v0.66.0...v0.66.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
1 year ago
Tamir Duberstein 0a144a0e69
integration-test: remove all sleeps 1 year ago
Andrew Stoycos 80d187d66d
Merge pull request #785 from astoycos/fix-ci
aya/ci: fixup broken debian kernel image url
1 year ago
astoycos 81f634abc6 aya/ci: fixup broken debian kernel image url
Signed-off-by: astoycos <astoycos@redhat.com>
1 year ago
Tamir Duberstein f0f09ac16e
Merge pull request #781 from aya-rs/build-badge
README: fix build badge
1 year ago
Tamir Duberstein 1aa1dc53db
README: fix build badge
Make it a link while I'm here.
1 year ago
Tamir Duberstein 92d3056db3
Merge pull request #775 from aya-rs/perf-as-raw-fd
async_perf_event_array: access inner through async
1 year ago
dependabot[bot] 18c7235dba
Merge pull request #780 from aya-rs/dependabot/github_actions/actions/checkout-4 1 year ago
dependabot[bot] 385b04c12b
build(deps): bump actions/checkout from 3 to 4
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
1 year ago
ajwerner 8d3fc49d68
Merge pull request #774 from ajwerner/try_from_LruHash
aya/maps: allow constructing HashMaps from LruHashMap
1 year ago
Andrew Werner 172859c66b aya/maps: support TryFrom for LRU hash maps
The macro to implement TryFrom for MapData didn't have the ability to
specify that more than one variant of MapData can be valid for a single
map implementation. Support for new syntax was added to the macro so that
the implementation can succeed for both valid variants in the HashMap
and PerCpuHashMap impl.

Fixes #636
1 year ago
ajwerner 792f467d40
Merge pull request #777 from ajwerner/ajwerner/TryFrom-macros
aya/maps: rework TryFrom macros
1 year ago
Andrew Werner 2a1bf609b2 aya/maps: rework TryFrom macros
The old macros were repetitive and inflexible. This unifies the various
macros used to generate TryFrom implementations for map implementations
from the relevant map enum variants.

Cleanup in anticipation of fixing #636.

The API changes are just about renaming the return to Self and
Self::Error; they are not real changes.
1 year ago