Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:dev_map_hash_get_next_key

Proto:static int dev_map_hash_get_next_key(struct bpf_map *map, void *key, void *next_key)

Type:int

Parameter:

TypeParameterName
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  If Not key Then Go to find_first
316  idx = key
318  dev = __dev_map_hash_lookup_elem(map, idx)
319  If Not dev Then Go to find_first
322  next_dev = hlist_entry_safe(Dependency order vs. p above. (hlist_next_rcu( & index_hlist)), structbpf_dtab_netdev, index_hlist)
325  If next_dev Then
326  next = keep track of map index for tracepoint
327  Return 0
330  i = idx & n_buckets - 1
331  i++
333  find_first :
334  When i < n_buckets cycle
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  If next_dev Then
342  Return 0
346  Return -ENOENT