Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:bpf_percpu_array_update

Proto:int bpf_percpu_array_update(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
338  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)
339  index = key
340  __percpu * pptr
341  off = 0
344  If Value for the false possibility is greater at compile time(map_flags > update existing element ) Then Return -EINVAL
348  If Value for the false possibility is greater at compile time(index >= max_entries) Then Return -E2BIG
352  If Value for the false possibility is greater at compile time(map_flags == create new element if it didn't exist ) Then Return -EEXIST
362  size = und_up - round up to next specified power of 2*@x: the value to round*@y: multiple to round up to (must be a power of 2)* Rounds @x up to next multiple of @y (which must be a power of 2).* To perform arbitrary rounding up, use roundup() below.(value_size, 8)
363  _read_lock() - mark the beginning of an RCU read-side critical section* When synchronize_rcu() is invoked on one CPU while other CPUs* are within RCU read-side critical sections, then the* synchronize_rcu() is guaranteed to block until after all the other
364  pptr = pptrs[index & index_mask]
365  for_each_possible_cpu(cpu)
366  bpf_long_memcpy(per_cpu_ptr(pptr, cpu), value + off, size)
367  off += size
369  _read_unlock() - marks the end of an RCU read-side critical section.* In most situations, rcu_read_unlock() is immune from deadlock.* However, in kernels built with CONFIG_RCU_BOOST, rcu_read_unlock()
370  Return 0
Caller
NameDescribe
map_update_elem