Commit Graph

929 Commits (d43879d99177c33c5d33827d8a3c7572841dd9df)
 

Author SHA1 Message Date
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
Dave Tucker a0641c15e4 codegen: Add bpf_map_info and bpf_link_info
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2 years ago
Michal Rostecki 895f96e971 ebpf: Add TcContext for classifier programs
This change separates the previous `SkBuffContext` into three structs:

* `SkBuff` which is a wrapper around `__sk_buff` which contains all
  possible methods operating on it.
* `SkBuffContext` which is a program context for programs which
  **cannot** access `__sk_buff` directly and instead can only use
  `load_bytes`.
* `TcContext` which is a classifier context which can access `__sk_buff`
  directly, hence exposes `data` and `data_end`.

Signed-off-by: Michal Rostecki <vadorovsky@gmail.com>
2 years ago
Dave Tucker 945169996c
Merge pull request #379 from dave-tucker/fix-link-segfault
aya: Fix segfault in define_link_wrapper
2 years ago
Dave Tucker 8305ee1eca test: Fix clippy lint
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2 years ago
Dave Tucker 18584e2259 aya: Fix segfault in define_link_wrapper
The From<$wrapper> for $base implemention is refers to itself,
eventually causing a segfault.

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2 years ago
Dave Tucker 6f0637a6c8 aya-log, aya-log-common: start next development iteration 0.1.12-dev.0
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2 years ago
Dave Tucker ba927ac204 aya-log, aya-log-common: release version 0.1.11
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2 years ago
Dave Tucker 66b4f79eca
Merge pull request #285 from dave-tucker/btf-redux
aya: Improved BTF Type API
2 years ago
Dave Tucker f34ebeba99 aya: Improved BTF Type API
This commit removes reliance on generated BtfType structs, as
well as adding a dedicated struct for each BTF type. As such,
we can now add nice accessors like `bits()` and `encoding()`
for Int vs. inlined shift/mask operations.

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2 years ago
conectado 7b143199fb
aya: update `VerifierLogLevel` to use bitflags 2 years ago
Dave Tucker 906c25ff23
Merge pull request #374 from dave-tucker/aya-tool
aya-gen: Rename to aya-tool
2 years ago
Dave Tucker aaa20cc1fd aya-gen: Rename to aya-tool
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2 years ago
Dave Tucker 4826bf7f74
Merge pull request #366 from dave-tucker/pin-redux-2
aya: Fix Link Pinning
2 years ago
Dave Tucker 4c1d645aa6 aya: Fix Link Pinning
1. Removes OwnedLink
2. Allows Links to be converted into FdLink
3. Introduces a PinnedLink type to handle wrap FdLink when pinned and
   support un-pinning

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2 years ago
Michal Rostecki 9a8409e3a2 aya-log-ebpf-macros: Fix the DisplayHint expression names
Signed-off-by: Michal Rostecki <vadorovsky@gmail.com>
2 years ago
Alessandro Decina b95adc3135
Merge pull request #371 from conectado/verifier-log-level
aya: expose BPF verifier log level configuration
2 years ago
conectado a6025255f5
aya: update `VerifierLogLevel` level variants 2 years ago
Michal Rostecki 83ec27f06b lib: Add display hints
This change adds optional display hints:

* `{:x}`, `{:X}` - for hex representation of numbers
* `{:ipv4}`, `{:IPv4}` - for IPv4 addresses
* `{:ipv6}`, `{:IPv6}` - for IPv6 addresses

It also gets rid of dyn-fmt and instead comes with our own parser
implementation.

Tested on: https://github.com/vadorovsky/aya-examples/tree/main/tc

Signed-off-by: Michal Rostecki <vadorovsky@gmail.com>
2 years ago
conectado edd80397dc
aya: use enum to set verifier log level 2 years ago
conectado 3211646aef
aya: expose BPF verifier log level configuration 2 years ago
Michal Rostecki 944d6b8a16 Change from Rust edition 2018 to 2021
Rust 2021 adds more core prelude imports, including `TryFrom` and
`TryInto`.

Signed-off-by: Michal Rostecki <vadorovsky@gmail.com>
2 years ago
Hengqi Chen c713dde061 aya-bpf/programs: Add `pull_data` method to SKB context
The pull_data method is used to ensure that all the required bytes
are available in the linear portion of the skb.

Signed-off-by: Hengqi Chen <chenhengqi@outlook.com>
2 years ago
Michal Rostecki 7942c3ac19
Merge pull request #369 from chenhengqi/lpm-trie-flag
aya-bpf/maps: Create LPMTrie with BPF_F_NO_PREALLOC
2 years ago
Hengqi Chen e12e8a9ded aya-bpf/maps: Create LPMTrie with BPF_F_NO_PREALLOC
The Linux kernel requires BPF_F_NO_PREALLOC on creating LPMTrie ([0]).
Add BPF_F_NO_PREALLOC flag in LPMTrie constructor.

Closes #332.

  [0]: https://github.com/torvalds/linux/blob/9e6b19a66d9b/kernel/bpf/lpm_trie.c#L551

Signed-off-by: Hengqi Chen <chenhengqi@outlook.com>
2 years ago
Michal Rostecki c80ab31d7b
Merge pull request #365 from dave-tucker/xtask-it-fix
xtask: Fix integration-test command
2 years ago
Dave Tucker 5e6b75a29a xtask: Fix integration-test command
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2 years ago
Michal Rostecki 632ea300ed
Merge pull request #361 from chenhengqi/fix-aya-log-links
aya-log/README: Fix links to aya-log repo
2 years ago
Hengqi Chen b8b291c51b aya-log/README: Fix links to aya-log repo
The aya-log repo ([0]) has been archived, use the link to
aya repo instead.

Signed-off-by: Hengqi Chen <chenhengqi@outlook.com>
2 years ago
Andre Fredette 207c689f56 Add support for setting priority for classifier programs
Addresses issue #358

Signed-off-by: Andre Fredette <afredette@redhat.com>
2 years ago
Alessandro Decina 2f715f0036
Merge pull request #360 from conectado/patch-1
Minor fix for `lpm_trie::key` docs
2 years ago
Gabi 14bad9ba92
aya-bpf: minor fix lpm_trie::key docs 2 years ago
Michal Rostecki 3d5ab0b17d
Merge pull request #357 from vadorovsky/env_logger
aya-log, test: Switch from simplelog to env_logger
2 years ago
Michal Rostecki 3664e1ea0d aya-log, test: Switch from simplelog to env_logger
Signed-off-by: Michal Rostecki <vadorovsky@gmail.com>
2 years ago