Skip to content

KFunc bpf_local_irq_save

v6.14

This function saves the current Interrupt Request(IRQ) state to the stack and disable IRQs.

Definition

This function disables IRQs, saving the current state to the stack. The verifier tracks the stored states and enforces that the state is restored before the program exits and that if multiple calls are made, the state is restored in the reverse order using the bpf_local_irq_restore kfunc.

Parameters

flags__irq_flag (output) - Pointer to a 64 bit integer where the current IRQ state will be saved.

Signature

void bpf_local_irq_save(long unsigned int *flags__irq_flag)

Usage

Intended use cases are writing IRQ safe data structures (e.g. memory allocator) in BPF programs natively, and use in new spin locking primitives.

Program types

The following program types can make use of this kfunc:

Example

Docs could be improved

This part of the docs is incomplete, contributions are very welcome