diff --git a/aya/src/maps/array/array.rs b/aya/src/maps/array/array.rs index 641af62b..bc920573 100644 --- a/aya/src/maps/array/array.rs +++ b/aya/src/maps/array/array.rs @@ -17,6 +17,10 @@ use crate::{ /// The size of the array is defined on the eBPF side using the `bpf_map_def::max_entries` field. /// All the entries are zero-initialized when the map is created. /// +/// # Minimum kernel version +/// +/// The minimum kernel version required to use this feature is 3.19. +/// /// # Examples /// ```no_run /// # let bpf = aya::Bpf::load(&[], None)?; diff --git a/aya/src/maps/array/per_cpu_array.rs b/aya/src/maps/array/per_cpu_array.rs index 02e18954..e4116d64 100644 --- a/aya/src/maps/array/per_cpu_array.rs +++ b/aya/src/maps/array/per_cpu_array.rs @@ -17,6 +17,10 @@ use crate::{ /// The size of the array is defined on the eBPF side using the `bpf_map_def::max_entries` field. /// All the entries are zero-initialized when the map is created. /// +/// # Minimum kernel version +/// +/// The minimum kernel version required to use this feature is 4.6. +/// /// # Examples /// ```no_run /// # #[derive(thiserror::Error, Debug)] diff --git a/aya/src/maps/array/program_array.rs b/aya/src/maps/array/program_array.rs index 263566a9..a2134810 100644 --- a/aya/src/maps/array/program_array.rs +++ b/aya/src/maps/array/program_array.rs @@ -20,6 +20,10 @@ use crate::{ /// prog_array, index)`. You can use [`ProgramArray`] to configure which /// programs correspond to which jump indexes. /// +/// # Minimum kernel version +/// +/// The minimum kernel version required to use this feature is 4.2. +/// /// # Examples /// ```no_run /// # let bpf = aya::Bpf::load(&[], None)?; diff --git a/aya/src/maps/hash_map/hash_map.rs b/aya/src/maps/hash_map/hash_map.rs index 1ba608f2..3ebdd1a7 100644 --- a/aya/src/maps/hash_map/hash_map.rs +++ b/aya/src/maps/hash_map/hash_map.rs @@ -13,6 +13,10 @@ use crate::{ /// A hash map that can be shared between eBPF programs and user space. /// +/// # Minimum kernel version +/// +/// The minimum kernel version required to use this feature is 3.19. +/// /// # Examples /// /// ```no_run diff --git a/aya/src/maps/hash_map/per_cpu_hash_map.rs b/aya/src/maps/hash_map/per_cpu_hash_map.rs index bb74e83a..fb23fb43 100644 --- a/aya/src/maps/hash_map/per_cpu_hash_map.rs +++ b/aya/src/maps/hash_map/per_cpu_hash_map.rs @@ -20,6 +20,10 @@ use crate::{ /// This type can be used with eBPF maps of type `BPF_MAP_TYPE_PERCPU_HASH` and /// `BPF_MAP_TYPE_LRU_PERCPU_HASH`. /// +/// # Minimum kernel version +/// +/// The minimum kernel version required to use this feature is 4.6. +/// /// # Examples /// /// ```no_run diff --git a/aya/src/maps/perf/async_perf_event_array.rs b/aya/src/maps/perf/async_perf_event_array.rs index 0e74f99f..623191c4 100644 --- a/aya/src/maps/perf/async_perf_event_array.rs +++ b/aya/src/maps/perf/async_perf_event_array.rs @@ -26,6 +26,10 @@ use crate::maps::{ /// * call [`AsyncPerfEventArray::open`] /// * call [`AsyncPerfEventArrayBuffer::read_events`] to read the events /// +/// # Minimum kernel version +/// +/// The minimum kernel version required to use this feature is 4.3. +/// /// # Examples /// /// ```no_run diff --git a/aya/src/maps/perf/perf_event_array.rs b/aya/src/maps/perf/perf_event_array.rs index 3f5330c4..5a727eab 100644 --- a/aya/src/maps/perf/perf_event_array.rs +++ b/aya/src/maps/perf/perf_event_array.rs @@ -76,6 +76,10 @@ impl> AsRawFd for PerfEventArrayBuffer { /// inserted in the buffer /// * call [`PerfEventArrayBuffer::read_events`] to read the events /// +/// # Minimum kernel version +/// +/// The minimum kernel version required to use this feature is 4.3. +/// /// # Examples /// /// A common way to use a perf array is to have one perf buffer for each diff --git a/aya/src/maps/queue.rs b/aya/src/maps/queue.rs index fb841905..d0b34a9c 100644 --- a/aya/src/maps/queue.rs +++ b/aya/src/maps/queue.rs @@ -15,6 +15,10 @@ use crate::{ /// A FIFO queue. /// +/// # Minimum kernel version +/// +/// The minimum kernel version required to use this feature is 4.20. +/// /// # Examples /// ```no_run /// # let bpf = aya::Bpf::load(&[], None)?; diff --git a/aya/src/maps/sock/sock_hash.rs b/aya/src/maps/sock/sock_hash.rs index 258b3855..ca5b5682 100644 --- a/aya/src/maps/sock/sock_hash.rs +++ b/aya/src/maps/sock/sock_hash.rs @@ -23,6 +23,10 @@ use crate::{ /// A `SockHash` can also be used to redirect packets to sockets contained by the /// map using `bpf_redirect_map()`, `bpf_sk_redirect_hash()` etc. /// +/// # Minimum kernel version +/// +/// The minimum kernel version required to use this feature is 4.18. +/// /// # Examples /// /// ```no_run diff --git a/aya/src/maps/sock/sock_map.rs b/aya/src/maps/sock/sock_map.rs index 8d027dc3..47f6e95f 100644 --- a/aya/src/maps/sock/sock_map.rs +++ b/aya/src/maps/sock/sock_map.rs @@ -22,6 +22,10 @@ use crate::{ /// A `SockMap` can also be used to redirect packets to sockets contained by the /// map using `bpf_redirect_map()`, `bpf_sk_redirect_map()` etc. /// +/// # Minimum kernel version +/// +/// The minimum kernel version required to use this feature is 4.14. +/// /// # Examples /// /// ```no_run diff --git a/aya/src/maps/stack.rs b/aya/src/maps/stack.rs index 3c624a66..304d4628 100644 --- a/aya/src/maps/stack.rs +++ b/aya/src/maps/stack.rs @@ -15,6 +15,10 @@ use crate::{ /// A LIFO stack. /// +/// # Minimum kernel version +/// +/// The minimum kernel version required to use this feature is 4.20. +/// /// # Examples /// ```no_run /// # let bpf = aya::Bpf::load(&[], None)?; diff --git a/aya/src/maps/stack_trace.rs b/aya/src/maps/stack_trace.rs index 65579078..ca20073d 100644 --- a/aya/src/maps/stack_trace.rs +++ b/aya/src/maps/stack_trace.rs @@ -17,6 +17,10 @@ use crate::{ /// useful for profiling, to associate a trace to an event, etc. You can capture traces calling /// `stack_id = bpf_get_stackid(ctx, map, flags)` from eBPF, and then you can retrieve the traces /// from their stack ids. +/// +/// # Minimum kernel version +/// +/// The minimum kernel version required to use this feature is 4.6. /// /// # Examples /// @@ -39,7 +43,7 @@ use crate::{ /// // load kernel symbols from /proc/kallsyms /// let ksyms = kernel_symbols()?; /// -/// // NOTE: you tipically send stack_ids from eBPF to user space using other maps +/// // NOTE: you typically send stack_ids from eBPF to user space using other maps /// let stack_id = 1234; /// let mut stack_trace = stack_traces.get(&stack_id, 0)?; /// diff --git a/aya/src/programs/cgroup_skb.rs b/aya/src/programs/cgroup_skb.rs index 45017c61..68971886 100644 --- a/aya/src/programs/cgroup_skb.rs +++ b/aya/src/programs/cgroup_skb.rs @@ -19,6 +19,10 @@ use super::FdLink; /// /// [cgroup]: https://man7.org/linux/man-pages/man7/cgroups.7.html /// +/// # Minimum kernel version +/// +/// The minimum kernel version required to use this feature is 4.10. +/// /// # Examples /// /// ```no_run diff --git a/aya/src/programs/kprobe.rs b/aya/src/programs/kprobe.rs index 46572d74..32f5bd8c 100644 --- a/aya/src/programs/kprobe.rs +++ b/aya/src/programs/kprobe.rs @@ -20,6 +20,10 @@ use crate::{ /// - `kprobe`: get attached to the *start* of the target functions /// - `kretprobe`: get attached to the *return address* of the target functions /// +/// # Minimum kernel version +/// +/// The minimum kernel version required to use this feature is 4.1. +/// /// # Examples /// /// ```no_run diff --git a/aya/src/programs/lirc_mode2.rs b/aya/src/programs/lirc_mode2.rs index d5c1b7cf..48a2b267 100644 --- a/aya/src/programs/lirc_mode2.rs +++ b/aya/src/programs/lirc_mode2.rs @@ -15,6 +15,10 @@ use libc::{close, dup}; /// /// [lirc]: https://www.kernel.org/doc/html/latest/userspace-api/media/rc/lirc-dev.html /// +/// # Minimum kernel version +/// +/// The minimum kernel version required to use this feature is 4.18. +/// /// # Examples /// /// ```no_run diff --git a/aya/src/programs/sk_msg.rs b/aya/src/programs/sk_msg.rs index a02e2302..4e42136e 100644 --- a/aya/src/programs/sk_msg.rs +++ b/aya/src/programs/sk_msg.rs @@ -11,6 +11,10 @@ use crate::{ /// filter and redirect messages sent on sockets. See also [`SockMap`] and /// [`SockHash`]. /// +/// # Minimum kernel version +/// +/// The minimum kernel version required to use this feature is 4.17. +/// /// # Examples /// /// ```no_run diff --git a/aya/src/programs/sk_skb.rs b/aya/src/programs/sk_skb.rs index cf4c97e9..ffaebf6a 100644 --- a/aya/src/programs/sk_skb.rs +++ b/aya/src/programs/sk_skb.rs @@ -21,6 +21,10 @@ pub enum SkSkbKind { /// inspect, redirect or filter incoming packet. See also [`SockMap`] and /// [`SockHash`]. /// +/// # Minimum kernel version +/// +/// The minimum kernel version required to use this feature is 4.14. +/// /// # Examples /// /// ```no_run diff --git a/aya/src/programs/sock_ops.rs b/aya/src/programs/sock_ops.rs index d288e5aa..048bb950 100644 --- a/aya/src/programs/sock_ops.rs +++ b/aya/src/programs/sock_ops.rs @@ -12,6 +12,10 @@ use crate::{ /// parameters, watch connection state changes and more. They are attached to /// cgroups. /// +/// # Minimum kernel version +/// +/// The minimum kernel version required to use this feature is 4.13. +/// /// # Examples /// /// ```no_run diff --git a/aya/src/programs/socket_filter.rs b/aya/src/programs/socket_filter.rs index 7fe0d23b..ac75f081 100644 --- a/aya/src/programs/socket_filter.rs +++ b/aya/src/programs/socket_filter.rs @@ -26,6 +26,9 @@ pub enum SocketFilterError { /// [`SocketFilter`] programs are attached on sockets and can be used to inspect /// and filter incoming packets. /// +/// # Minimum kernel version +/// +/// The minimum kernel version required to use this feature is 4.0. /// /// # Examples /// diff --git a/aya/src/programs/tc.rs b/aya/src/programs/tc.rs index 5fdd0f01..6847a68e 100644 --- a/aya/src/programs/tc.rs +++ b/aya/src/programs/tc.rs @@ -32,6 +32,10 @@ pub enum TcAttachType { /// /// # Examples /// +/// # Minimum kernel version +/// +/// The minimum kernel version required to use this feature is 4.1. +/// /// ```no_run /// # #[derive(Debug, thiserror::Error)] /// # enum Error { diff --git a/aya/src/programs/trace_point.rs b/aya/src/programs/trace_point.rs index 5e7e2840..a3cb52f6 100644 --- a/aya/src/programs/trace_point.rs +++ b/aya/src/programs/trace_point.rs @@ -22,6 +22,10 @@ pub enum TracePointError { /// be attached to. See `/sys/kernel/debug/tracing/events` for a list of which /// events can be traced. /// +/// # Minimum kernel version +/// +/// The minimum kernel version required to use this feature is 4.7. +/// /// # Examples /// /// ```no_run diff --git a/aya/src/programs/xdp.rs b/aya/src/programs/xdp.rs index eb3033e8..acf2c53f 100644 --- a/aya/src/programs/xdp.rs +++ b/aya/src/programs/xdp.rs @@ -46,6 +46,10 @@ bitflags! { /// underlying network driver, XDP programs can execute directly on network cards, greatly /// reducing CPU load. /// +/// # Minimum kernel version +/// +/// The minimum kernel version required to use this feature is 4.8. +/// /// # Examples /// /// ```no_run