Commit Graph

311 Commits (89d72e2e260871c961ae5a7637f4f7945da03f4f)
 

Author SHA1 Message Date
Alessandro Decina ab8d512b60 bpf: add HashMap::insert
Alessandro Decina dc4e020f29 aya: netlink: improve error messages
Alessandro Decina 8f55cd728c bpf: SkSkbContext: add ::l3_csum_replace
Alessandro Decina 4febbc3fae bpf: perf_map: fix type error
Alessandro Decina 8e6f447e9b bpf: sk_skb: add helper methods
This adds support for skb_store_bytes, skb_load_bytes and
l4_csum_replace to SkSkbContext.
Alessandro Decina 274ea91b5e bpf: aya-bpf-bindings: commit generated bindings
Alessandro Decina afcc5dc662 bpf: add support for BPF_PROG_TYPE_SCHED_CLS programs
Alessandro Decina 5effc972ac aya: add support for BPF_PROG_TYPE_SCHED_CLS programs
Alessandro Decina 4222b140ec aya: perf_map: fix bug when max_entries=0
When a perf map has max_entries=0, max_entries is dynamically set at
load time to the number of possible cpus as reported by
/sys/devices/system/cpu/possible.

This change fixes a bug where instead of setting max_entries to the
number of possible cpus, we were setting it to the cpu index of the last
possible cpu.
Alessandro Decina 3b7ffd0048 aya: update generated bindings
Update generated bindings with kernel headers from libbpf 4ccc1f0
Alessandro Decina c44393d59b xtask: codegen: use uapi kernel headers from libbpf
libbpf periodically syncs uapi headers from the kernel. Use those to
generate bindings so that we don't have to rely on distro packages
when we cut releases.
Alessandro Decina 9595bd4571 aya-gen: don't generate doc comments
Alessandro Decina 30d2b25f11 aya: xdp: fix detaching on kernels older than 5.7
XDP_FLAGS_REPLACE was added in 5.7. Now for kernels >= 5.7 whenever we
detach an XDP program we pass along the program fd we expect to be
detaching. For older kernels, we just detach whatever is attached, which
is not great but it's the way the API worked pre XDP_FLAGS_REPLACE.
Alessandro Decina 607cf68a69 aya: xdp: set flags when attaching with netlink
Alessandro Decina bb7728a2c5 aya: fix BpfError display strings
Alessandro Decina 1b314ded2f bpf: add SockHash::redirect
Alessandro Decina 9e12c9324c aya: fix warnings
Alessandro Decina dda8534d9d xtask: aya-bpf-bindings: generate bindings for xdp_action
Alessandro Decina e11edc072b bpf: add more bindings
Initial support for Array, HashMap and SockHash maps, and for SkSkb,
SkMsg, SockOps and XDP programs.
Alessandro Decina 9a24f20e6f aya: programs: rework load_program() retry code a bit
Alessandro Decina 4dccd840ca aya-gen: rename binary from main to aya-gen
Alessandro Decina 144175434f aya: programs: add support for SkMsg programs
Alessandro Decina dad300c88b aya: maps: add SockHash
Alessandro Decina 696ca1ffa8 aya-bpf-bindings: generate bindings for pt_regs and sk_action
Alessandro Decina ca4b3bfc04 aya: add support for SockOps programs
Alessandro Decina b57cace941 aya: add support BPF_PROG_TYPE_SK_SKB programs and SockMaps
Alessandro Decina b6cd813af5 aya: fix program array key size
Alessandro Decina 0b3e532d7a aya: small doc fixes
Alessandro Decina 79f1b385a5 aya: more docs
Alessandro Decina 683a58ea6d aya: consolidate errors into ProgramError::SyscallError
Alessandro Decina ae863bc663 aya: split aya::programs::probe into ::kprobe and ::uprobe & add docs
Alessandro Decina d9634ae945 aya: add maps::StackTraceMap
Map type for BPF_MAP_TYPE_STACK_TRACE.
Alessandro Decina 67c9cc0359 aya: add util::kernel_symbols()
kernel_symbols() can be used to load /proc/kallsyms in a BTreeMap.
Useful for looking up symbols from stack addresses.
Alessandro Decina 2cdb10e7f2 aya: add bpf_map_lookup_elem_ptr
Alessandro Decina ad6d0596ab aya: tweak docs
Alessandro Decina f464279740 aya: rename ProgramArray::unset to ProgramArray::clear_index
Alessandro Decina 9ad2a5e72d aya: rename ProgramArray::keys to ProgramArray::indices
Alessandro Decina b0364f76ab aya: maps: add PerCpuArray
Alessandro Decina 74d5f17559 aya: rework IterableMap and ProgramArray
Make MapKeys not use IterableMap. Leave only ProgramArray::get,
ProgramArray::set and ProgramArray::unset exposed as the other syscalls
don't work consistently for program arrays.
Alessandro Decina aa3a30d196 aya: PerCpuKernelMem doesn't need to be public
Alessandro Decina 1746bbf5b8 aya: add aya::maps::Array
Alessandro Decina c3b902137b aya: add aya::maps::array and move ProgramArray under it
Alessandro Decina 6cec8be564 aya: hash_map: add doc aliases for HASH and LRU_HASH
Alessandro Decina 7a989b43b9 aya: per_cpu_hash_map: add support for BPF_MAP_TYPE_LRU_PERCPU_HASH
Alessandro Decina 635dcd44b9 aya: maps: introduce MapError::KeyNotFound
Change get() from -> Result<Option<V>, MapError> to -> Result<V,
MapError> where MapError::KeyNotFound is returned instead of Ok(None) to
signify that the key is not present.
Alessandro Decina fd142e467c aya: rename MapError::NotFound to MapError::MapNotFound
Alessandro Decina 3a5b289163 aya: add PerCpuHashMap
Alessandro Decina d5098c9e57 aya: move hash_map.rs to hash_map/hash_map.rs
Alessandro Decina 6a12a48f03 aya: hash_map: factor out common hash code
This is in preparation of adding new hash map types
Alessandro Decina ac83273da8 aya: fix warnings