Dave Tucker
4a32e7d985
clippy: fix new lints on nightly
...
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
3 years ago
Alessandro Decina
ecd6a6e96b
bpf: hash_map: add get_mut() method
3 years ago
Nimrod Shneor
d0b6daa091
Add LPMTrie Map to aya-bpf for BPF programs
3 years ago
William Findlay
df26fd94a7
bpf/program_array: use never type, add unsafe flag, and document safety
3 years ago
William Findlay
ff14493751
bpf/maps: implement ProgramArray
...
This PR implements the ProgramArray map type in aya-bpf. Includes a convenient tail_call
method that wraps the bpf_tail_call helper.
3 years ago
Thia Wyrod
b655cf973f
aya-bpf: remove unnecessary unsafe markers on map functions.
...
Map lookup and deletion can yield stale keys and values by virtue of
sharing a data structure with userspace programs and other BPF programs
which can modify it. However, all accesses remain perfectly safe and will
not cause memory corruption or data races.
3 years ago
Alessandro Decina
8043451973
bpf: re-export Lru hash maps from aya_bpf::maps
3 years ago
Alessandro Decina
c0f695c4b6
bpf: Add LruHashMap and LruPerCpuHashMap
3 years ago
Dave Tucker
8a6fe4a640
bpf: Rename SkSkbContext to SkBuffContext
...
This is necessary since the context is used in many other program types
and not just in SK_SKB programs.
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
3 years ago
Dave Tucker
2a8ba55b7e
bpf: Implement redirect for skbs on sockmap/sockhash
...
This implements redirect_skb and renames redirect to redirect_msg
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
3 years ago
Alessandro Decina
4116442cda
bpf: PerfEventByteArray: remove unused import
3 years ago
Alessandro Decina
0220a4192c
bpf: add PerfEventByteArray
...
Similar to PerfEventArray but allows to output variable length byte
slices
3 years ago
Alessandro Decina
23a70382b2
bpf: PerfEventArray: tweak output API
3 years ago
Alessandro Decina
ea91fe08d3
bpf: rename PerfMap to PerfEventArray
3 years ago
Dave Tucker
69041954cb
bpf: Added pinned constructor to maps
...
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
3 years ago
Alessandro Decina
269be03a89
bpf: add PerCpuArray
3 years ago
Alessandro Decina
a68ff47246
aya-bpf, aya-bpf-bindings: fix clippy lints
4 years ago
Tw
55ba0538f2
bpf: add support for tracepoint program ( #29 )
...
This patch add initial support for tracepoint program type.
Hope you enjoy.
Signed-off-by: Tw <wei.tan@intel.com>
4 years ago
Tw
d1b7b024dc
bpf: fix a minor bug due to stackid allocation
...
The type casting introduces an allocation, this will cause compiling failure when linking final bpf target.
So remove this casting to fix this issue.
BTW, the following is the failure I met:
= note: 07:24:12 [ERROR] fatal error: "unable to allocate function return #1"
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace.
Stack dump:
0. Running pass 'Function Pass Manager' on module 'trace_bpf-001a275b17e9eb12'.
1. Running pass 'BPF DAG->DAG Pattern Instruction Selection' on function '@_ZN7aya_bpf4maps11stack_trace10StackTrace11get_stackid17h32b649bc3780c0aaE'
Signed-off-by: Tw <wei.tan@intel.com>
4 years ago
Tw
fd20bd5e23
bpf: add support for STACK_TRACE map
...
This path support initial support for BPF_MAP_TYPE_STACK_TRACE.
Signed-off-by: Tw <wei.tan@intel.com>
4 years ago
Alessandro Decina
122a5306e7
aya, aya-bpf-bindings: regenerate bindings
4 years ago
Alessandro Decina
8cd669ca9a
xtask: fix include paths for kernel headers bundled with libbpf
4 years ago
Alessandro Decina
67d35cc1d3
bpf: fix PerfMap::output() API when appending context data
...
map.output(&ctx, &data, nr_bytes) can be used to append nr_bytes from
the current context to the &data event.
4 years ago
Arnabjyoti Kalita
6974d349e8
programs: add support for attaching and detaching TC programs
...
This change adds support for attaching TC programs directly from aya, without
having to use iproute2/tc.
4 years ago
Alessandro Decina
240c65507b
bpf: add HashMap::remove()
4 years ago
Alessandro Decina
696ae6079c
bpf: Add HashMap::pinned API
4 years ago
Alessandro Decina
bf4892d0db
bpf: add support for Queue and SockMap maps
4 years ago
Alessandro Decina
575e85c412
bpf: add id and pinning fields to bpf_map_def
4 years ago
Alessandro Decina
ab8d512b60
bpf: add HashMap::insert
4 years ago
Alessandro Decina
4febbc3fae
bpf: perf_map: fix type error
4 years ago
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.
4 years ago
Alessandro Decina
1b314ded2f
bpf: add SockHash::redirect
4 years ago
Alessandro Decina
e11edc072b
bpf: add more bindings
...
Initial support for Array, HashMap and SockHash maps, and for SkSkb,
SkMsg, SockOps and XDP programs.
4 years ago
Alessandro Decina
bdca32cebf
aya-bpf-bindings: fix anonymous enums
4 years ago
Alessandro Decina
7815711196
bpf: add aya-bpf-bindings
...
Move the generated bindings to aya-bpf-bindings.
4 years ago
Alessandro Decina
cdf960aaa1
bpf: initial bpf bindings
4 years ago