Commit Graph

1 Commits (e0fe4a85d5d45e77e6da27c0f08ae555ae513bc8)

Author SHA1 Message Date
Michal R e0fe4a85d5 aya-{common,ebpf}: Add spin lock support
Add a new `aya-common` crate with a `SpinLock` struct, that wraps
`bpf_spin_lock` and allows to use it in BPF maps.

Add an extension trait `EbpfSpinLock` that provides a `lock` method,
which is a wrapper over `bpf_spin_lock` helper. It returns a
`SpinLockGuard` that calls `bpf_spin_unlock` helper once dropped.

Test that functionality with a simple XDP counter program.
1 month ago