Where possible, replace the hardcoded byte arrays in the tests with the
structs they represent, then convert the structs to byte arrays.
Signed-off-by: Billy McFall <22157057+Billy99@users.noreply.github.com>
In aya/src/sys/bpf.rs, there are several simple bpf programs written as
byte arrays. These need to be adjusted to account for big endian.
Signed-off-by: Billy McFall <22157057+Billy99@users.noreply.github.com>
bpfman, a project using aya, has a requirement to support powerpc64 and
s390x architectures. Adding these two architectures to aya.
Signed-off-by: Billy McFall <22157057+Billy99@users.noreply.github.com>
Adding support for s390x (big endian architecture) and found that some
of the unit tests have structures and files implemented as byte arrays.
They are all coded as little endian and need a bug endian version to
work properly.
Signed-off-by: Billy McFall <22157057+Billy99@users.noreply.github.com>
```
error: first doc comment paragraph is too long
--> aya/src/programs/raw_trace_point.rs:12:1
|
12 | / /// A program that can be attached at a pre-defined kernel trace point, but also
13 | | /// has an access to kernel internal arguments of trace points, which
14 | | /// differentiates them from traditional tracepoint eBPF programs.
15 | | ///
16 | | /// The kernel provides a set of pre-defined trace points that eBPF programs can
| |_
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_long_first_doc_paragraph
error: first doc comment paragraph is too long
--> ebpf/aya-ebpf/src/helpers.rs:1:1
|
1 | / //! This module contains kernel helper functions that may be exposed to specific BPF
2 | | //! program types. These helpers can be used to perform common tasks, query and operate on
3 | | //! data exposed by the kernel, and perform some operations that would normally be denied
4 | | //! by the BPF verifier.
5 | | //!
6 | | //! Here, we provide some higher-level wrappers around the underlying kernel helpers, but
| |_
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_long_first_doc_paragraph
```
Ensure we download multiple kernel versions to run
our virtualized CI against.
Bump xdpilone version to fix bug on latest kernel.
Signed-off-by: astoycos <astoycos@gmail.com>
Files changed:
M ebpf/aya-ebpf-bindings/src/aarch64/bindings.rs
M ebpf/aya-ebpf-bindings/src/armv7/bindings.rs
M ebpf/aya-ebpf-bindings/src/powerpc64/bindings.rs
M ebpf/aya-ebpf-bindings/src/riscv64/bindings.rs
M ebpf/aya-ebpf-bindings/src/s390x/bindings.rs
M ebpf/aya-ebpf-bindings/src/x86_64/bindings.rs
There was a logic bug in the previously merged patch where we
set the correctly calculated max_entries size with the original.
To fix this and prevent regressions a unit test was added.
This highlighted that the original map definition needs to be
mutated in order for the max_entries change to be properly applied.
As such, this resize logic moved out of aya::sys into aya::maps
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
Both libbpf and cilium/ebpf have will set the max_entries of a
BPF_MAP_TYPE_PERF_EVENT_ARRAY to the number of online CPUs if
it was omitted at map definition time. This adds that same
logic to Aya.
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
This API doesn't make sense as the max_entries needs to be set to the
number of online CPUs by the loader.
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
`brew` seems to be breaking the rustup installed by rust-toolchain:
```
==> Migrating formula rustup-init to rustup
==> Unlinking rustup-init
==> Moving rustup-init versions to /opt/homebrew/Cellar/rustup
==> Relinking rustup
```
Let's see if this fixes it.
IP address types are available in `core`, so they can be used also in
eBPF programs. This change adds support of these types in aya-log.
* Add implementation of `WriteTuBuf` to these types.
* Support these types in `Ipv4Formatter` and `Ipv6Formatter`.
* Support them with `DisplayHint::Ip`.
* Add support for formatting `[u8; 4]`, to be able to handle
`Ipv4Addr::octets`.
Update libbpf to 686f600bca59e107af4040d0838ca2b02c14ff50
Files changed:
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_powerpc64.rs
M aya-obj/src/generated/linux_bindings_riscv64.rs
M aya-obj/src/generated/linux_bindings_s390x.rs
M aya-obj/src/generated/linux_bindings_x86_64.rs
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
Update libbpf to c1a6c770c46c6e78ad6755bf596c23a4e6f6b216
Files changed:
M aya-obj/src/generated/linux_bindings_aarch64.rs
M aya-obj/src/generated/linux_bindings_armv7.rs
A aya-obj/src/generated/linux_bindings_powerpc64.rs
M aya-obj/src/generated/linux_bindings_riscv64.rs
A aya-obj/src/generated/linux_bindings_s390x.rs
M aya-obj/src/generated/linux_bindings_x86_64.rs
M ebpf/aya-ebpf-bindings/src/aarch64/bindings.rs
M ebpf/aya-ebpf-bindings/src/armv7/bindings.rs
A ebpf/aya-ebpf-bindings/src/powerpc64/bindings.rs
A ebpf/aya-ebpf-bindings/src/powerpc64/helpers.rs
M ebpf/aya-ebpf-bindings/src/riscv64/bindings.rs
A ebpf/aya-ebpf-bindings/src/s390x/bindings.rs
A ebpf/aya-ebpf-bindings/src/s390x/helpers.rs
M ebpf/aya-ebpf-bindings/src/x86_64/bindings.rs
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
Adds missing libelf headers that are now included
as part of libbpf-internal.h. Adds ppc64el and
s390x to the cross environment.
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>