aya: add minimum kernel version for each map and program type (#18)

pull/20/head
Arnabjyoti Kalita 3 years ago committed by GitHub
parent be035bf42c
commit 35f15f70e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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. /// 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. /// 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 /// # Examples
/// ```no_run /// ```no_run
/// # let bpf = aya::Bpf::load(&[], None)?; /// # let bpf = aya::Bpf::load(&[], None)?;

@ -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. /// 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. /// 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 /// # Examples
/// ```no_run /// ```no_run
/// # #[derive(thiserror::Error, Debug)] /// # #[derive(thiserror::Error, Debug)]

@ -20,6 +20,10 @@ use crate::{
/// prog_array, index)`. You can use [`ProgramArray`] to configure which /// prog_array, index)`. You can use [`ProgramArray`] to configure which
/// programs correspond to which jump indexes. /// programs correspond to which jump indexes.
/// ///
/// # Minimum kernel version
///
/// The minimum kernel version required to use this feature is 4.2.
///
/// # Examples /// # Examples
/// ```no_run /// ```no_run
/// # let bpf = aya::Bpf::load(&[], None)?; /// # let bpf = aya::Bpf::load(&[], None)?;

@ -13,6 +13,10 @@ use crate::{
/// A hash map that can be shared between eBPF programs and user space. /// 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 /// # Examples
/// ///
/// ```no_run /// ```no_run

@ -20,6 +20,10 @@ use crate::{
/// This type can be used with eBPF maps of type `BPF_MAP_TYPE_PERCPU_HASH` and /// This type can be used with eBPF maps of type `BPF_MAP_TYPE_PERCPU_HASH` and
/// `BPF_MAP_TYPE_LRU_PERCPU_HASH`. /// `BPF_MAP_TYPE_LRU_PERCPU_HASH`.
/// ///
/// # Minimum kernel version
///
/// The minimum kernel version required to use this feature is 4.6.
///
/// # Examples /// # Examples
/// ///
/// ```no_run /// ```no_run

@ -26,6 +26,10 @@ use crate::maps::{
/// * call [`AsyncPerfEventArray::open`] /// * call [`AsyncPerfEventArray::open`]
/// * call [`AsyncPerfEventArrayBuffer::read_events`] to read the events /// * call [`AsyncPerfEventArrayBuffer::read_events`] to read the events
/// ///
/// # Minimum kernel version
///
/// The minimum kernel version required to use this feature is 4.3.
///
/// # Examples /// # Examples
/// ///
/// ```no_run /// ```no_run

@ -76,6 +76,10 @@ impl<T: DerefMut<Target = Map>> AsRawFd for PerfEventArrayBuffer<T> {
/// inserted in the buffer /// inserted in the buffer
/// * call [`PerfEventArrayBuffer::read_events`] to read the events /// * call [`PerfEventArrayBuffer::read_events`] to read the events
/// ///
/// # Minimum kernel version
///
/// The minimum kernel version required to use this feature is 4.3.
///
/// # Examples /// # Examples
/// ///
/// A common way to use a perf array is to have one perf buffer for each /// A common way to use a perf array is to have one perf buffer for each

@ -15,6 +15,10 @@ use crate::{
/// A FIFO queue. /// A FIFO queue.
/// ///
/// # Minimum kernel version
///
/// The minimum kernel version required to use this feature is 4.20.
///
/// # Examples /// # Examples
/// ```no_run /// ```no_run
/// # let bpf = aya::Bpf::load(&[], None)?; /// # let bpf = aya::Bpf::load(&[], None)?;

@ -23,6 +23,10 @@ use crate::{
/// A `SockHash` can also be used to redirect packets to sockets contained by the /// A `SockHash` can also be used to redirect packets to sockets contained by the
/// map using `bpf_redirect_map()`, `bpf_sk_redirect_hash()` etc. /// 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 /// # Examples
/// ///
/// ```no_run /// ```no_run

@ -22,6 +22,10 @@ use crate::{
/// A `SockMap` can also be used to redirect packets to sockets contained by the /// A `SockMap` can also be used to redirect packets to sockets contained by the
/// map using `bpf_redirect_map()`, `bpf_sk_redirect_map()` etc. /// 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 /// # Examples
/// ///
/// ```no_run /// ```no_run

@ -15,6 +15,10 @@ use crate::{
/// A LIFO stack. /// A LIFO stack.
/// ///
/// # Minimum kernel version
///
/// The minimum kernel version required to use this feature is 4.20.
///
/// # Examples /// # Examples
/// ```no_run /// ```no_run
/// # let bpf = aya::Bpf::load(&[], None)?; /// # let bpf = aya::Bpf::load(&[], None)?;

@ -18,6 +18,10 @@ use crate::{
/// `stack_id = bpf_get_stackid(ctx, map, flags)` from eBPF, and then you can retrieve the traces /// `stack_id = bpf_get_stackid(ctx, map, flags)` from eBPF, and then you can retrieve the traces
/// from their stack ids. /// from their stack ids.
/// ///
/// # Minimum kernel version
///
/// The minimum kernel version required to use this feature is 4.6.
///
/// # Examples /// # Examples
/// ///
/// ```no_run /// ```no_run
@ -39,7 +43,7 @@ use crate::{
/// // load kernel symbols from /proc/kallsyms /// // load kernel symbols from /proc/kallsyms
/// let ksyms = kernel_symbols()?; /// 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 stack_id = 1234;
/// let mut stack_trace = stack_traces.get(&stack_id, 0)?; /// let mut stack_trace = stack_traces.get(&stack_id, 0)?;
/// ///

@ -19,6 +19,10 @@ use super::FdLink;
/// ///
/// [cgroup]: https://man7.org/linux/man-pages/man7/cgroups.7.html /// [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 /// # Examples
/// ///
/// ```no_run /// ```no_run

@ -20,6 +20,10 @@ use crate::{
/// - `kprobe`: get attached to the *start* of the target functions /// - `kprobe`: get attached to the *start* of the target functions
/// - `kretprobe`: get attached to the *return address* 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 /// # Examples
/// ///
/// ```no_run /// ```no_run

@ -15,6 +15,10 @@ use libc::{close, dup};
/// ///
/// [lirc]: https://www.kernel.org/doc/html/latest/userspace-api/media/rc/lirc-dev.html /// [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 /// # Examples
/// ///
/// ```no_run /// ```no_run

@ -11,6 +11,10 @@ use crate::{
/// filter and redirect messages sent on sockets. See also [`SockMap`] and /// filter and redirect messages sent on sockets. See also [`SockMap`] and
/// [`SockHash`]. /// [`SockHash`].
/// ///
/// # Minimum kernel version
///
/// The minimum kernel version required to use this feature is 4.17.
///
/// # Examples /// # Examples
/// ///
/// ```no_run /// ```no_run

@ -21,6 +21,10 @@ pub enum SkSkbKind {
/// inspect, redirect or filter incoming packet. See also [`SockMap`] and /// inspect, redirect or filter incoming packet. See also [`SockMap`] and
/// [`SockHash`]. /// [`SockHash`].
/// ///
/// # Minimum kernel version
///
/// The minimum kernel version required to use this feature is 4.14.
///
/// # Examples /// # Examples
/// ///
/// ```no_run /// ```no_run

@ -12,6 +12,10 @@ use crate::{
/// parameters, watch connection state changes and more. They are attached to /// parameters, watch connection state changes and more. They are attached to
/// cgroups. /// cgroups.
/// ///
/// # Minimum kernel version
///
/// The minimum kernel version required to use this feature is 4.13.
///
/// # Examples /// # Examples
/// ///
/// ```no_run /// ```no_run

@ -26,6 +26,9 @@ pub enum SocketFilterError {
/// [`SocketFilter`] programs are attached on sockets and can be used to inspect /// [`SocketFilter`] programs are attached on sockets and can be used to inspect
/// and filter incoming packets. /// and filter incoming packets.
/// ///
/// # Minimum kernel version
///
/// The minimum kernel version required to use this feature is 4.0.
/// ///
/// # Examples /// # Examples
/// ///

@ -32,6 +32,10 @@ pub enum TcAttachType {
/// ///
/// # Examples /// # Examples
/// ///
/// # Minimum kernel version
///
/// The minimum kernel version required to use this feature is 4.1.
///
/// ```no_run /// ```no_run
/// # #[derive(Debug, thiserror::Error)] /// # #[derive(Debug, thiserror::Error)]
/// # enum Error { /// # enum Error {

@ -22,6 +22,10 @@ pub enum TracePointError {
/// be attached to. See `/sys/kernel/debug/tracing/events` for a list of which /// be attached to. See `/sys/kernel/debug/tracing/events` for a list of which
/// events can be traced. /// events can be traced.
/// ///
/// # Minimum kernel version
///
/// The minimum kernel version required to use this feature is 4.7.
///
/// # Examples /// # Examples
/// ///
/// ```no_run /// ```no_run

@ -46,6 +46,10 @@ bitflags! {
/// underlying network driver, XDP programs can execute directly on network cards, greatly /// underlying network driver, XDP programs can execute directly on network cards, greatly
/// reducing CPU load. /// reducing CPU load.
/// ///
/// # Minimum kernel version
///
/// The minimum kernel version required to use this feature is 4.8.
///
/// # Examples /// # Examples
/// ///
/// ```no_run /// ```no_run

Loading…
Cancel
Save