Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\bpf\arraymap.c Create Date:2022-07-28 13:11:13
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:Called from syscall or from eBPF program

Proto:static int array_map_update_elem(struct bpf_map *map, void *key, void *value, u64 map_flags)

Type:int

Parameter:

TypeParameterName
struct bpf_map *map
void *key
void *value
u64map_flags
301  array = container_of - cast a member of a structure out to the containing structure*@ptr: the pointer to the member.*@type: the type of the container struct this is embedded in.*@member: the name of the member within the struct.(map, structbpf_array, map)
302  index = key
305  If Value for the false possibility is greater at compile time((map_flags & ~spin_lock-ed map_lookup/map_update ) > update existing element ) Then Return -EINVAL
309  If Value for the false possibility is greater at compile time(index >= max_entries) Then Return -E2BIG
313  If Value for the false possibility is greater at compile time(map_flags & create new element if it didn't exist ) Then Return -EEXIST
317  If Value for the false possibility is greater at compile time((map_flags & spin_lock-ed map_lookup/map_update ) && !map_value_has_spin_lock(map)) Then Return -EINVAL
321  If map_type == BPF_MAP_TYPE_PERCPU_ARRAY Then
322  No 3D Now!(this_cpu_ptr(pptrs[index & index_mask]), value, value_size)
324  Else
325  val = value + elem_size * (index & index_mask)
327  If map_flags & spin_lock-ed map_lookup/map_update Then copy_map_value_locked(map, val, value, false)
329  Else py everything but bpf_spin_lock
332  Return 0