函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\bpf\hashtab.c Create Date:2022-07-27 14:26:08
Last Modify:2022-05-23 09:15:29 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:__htab_percpu_map_update_elem

函数原型:static int __htab_percpu_map_update_elem(struct bpf_map *map, void *key, void *value, u64 map_flags, bool onallcpus)

返回类型:int

参数:

类型参数名称
struct bpf_map *map
void *key
void *value
u64map_flags
boolonallcpus
979  htab等于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_htab, map)
980  l_new等于NULL
987  如果此条件成立可能性小(为编译器优化)(map_flags > update existing element )则返回:负EINVAL
991  WARN_ON_ONCE(!_read_lock_held() - might we be in RCU read-side critical section?* If CONFIG_DEBUG_LOCK_ALLOC is selected, returns nonzero iff in an RCU* read-side critical section)
993  key_size等于key_size
995  hash等于htab_map_hash(key, key_size, hashrnd)
997  b等于__select_bucket(htab, hash)
998  head等于head
1001  raw_spin_lock_irqsave( & lock, flags)
1003  l_old等于his lookup function can only be called with bucket lock taken
1005  ret等于check_flags(htab, l_old, map_flags)
1006  如果ret则转到:err
1009  如果l_old
1011  pcpu_copy_value(htab, htab_elem_get_ptr(l_old, key_size), value, onallcpus)
1013  否则
1014  l_new等于alloc_htab_elem(htab, key, value, key_size, hash, true, onallcpus, NULL)
1016  如果是错误
1017  ret等于错误
1018  转到:err
1020  hlist_nulls_add_head_rcu*@n: the element to add to the hash list
1022  ret等于0
1023  err :
1024  raw_spin_unlock_irqrestore( & lock, flags)
1025  返回:ret
调用者
名称描述
htab_percpu_map_update_elem
bpf_percpu_hash_update