函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\bpf\devmap.c Create Date:2022-07-27 14:39:49
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:dev_map_hash_get_next_key

函数原型:static int dev_map_hash_get_next_key(struct bpf_map *map, void *key, void *next_key)

返回类型:int

参数:

类型参数名称
struct bpf_map *map
void *key
void *next_key
307  dtab等于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_dtab, map)
308  next等于next_key
311  i等于0
313  如果非key则转到:find_first
316  idx等于key
318  dev等于__dev_map_hash_lookup_elem(map, idx)
319  如果非dev则转到:find_first
322  next_dev等于hlist_entry_safe(Dependency order vs. p above. (hlist_next_rcu( & index_hlist)), structbpf_dtab_netdev, index_hlist)
325  如果next_dev
326  next等于 keep track of map index for tracepoint
327  返回:0
330  i等于idx按位与n_buckets减1
331  i自加
333  find_first :
334 i小于n_buckets循环
335  head等于dev_map_index_hash(dtab, i)
337  next_dev等于hlist_entry_safe(Dependency order vs. p above. (urn the first or the next element in an RCU protected hlist(head)), structbpf_dtab_netdev, index_hlist)
340  如果next_dev
342  返回:0
346  返回:负ENOENT