title | description |
---|---|
Map Type 'BPF_MAP_TYPE_STACK' |
This page documents the 'BPF_MAP_TYPE_STACK' eBPF map type, including its defintion, usage, program types that can use it, and examples. |
The stack map type is a generic map type, resembling a stack data structure.
This map type has no keys, only values. The size and type of the values can be specified by the user to fit a large variety of use cases. The typical use-case for this map type is for brace matching ({
,}
) when parsing JSON for example.
As apposed to most map types, this map type uses a custom set of helpers to pop, peek and push elements, noted in the helper functions section below.
While the value_size
is essentially unrestricted, the key_size
must always be 0
since this map type has no keys.
The following syscall commands work with this map type:
!!! note
The BPF_MAP_LOOKUP_ELEM
syscall command acts as peek
, BPF_MAP_LOOKUP_AND_DELETE_ELEM
as pop
, and BPF_MAP_UPDATE_ELEM
as push
.
When set, the numa_node
attribute is respected during map creation.
Setting this flag will make it so the map can only be read via the syscall interface, but not written to.
For details please check the generic description.
Setting this flag will make it so the map can only be written to via the syscall interface, but not read from.
Setting this flag will make it so the map can only be read via helper functions, but not written to.
For details please check the generic description.
Setting this flag will make it so the map can only be written to via helper functions, but not read from.
For details please check the generic description.