Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\bpf\lpm_trie.c Create Date:2022-07-28 13:13:10
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 void *trie_lookup_elem(struct bpf_map *map, void *_key)

Type:void

Parameter:

TypeParameterName
struct bpf_map *map
void *_key
229  trie = 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, structlpm_trie, map)
230  struct lpm_trie_node * node, * found = NULL
231  key = _key
235  When node cycle
243  matchlen = longest_prefix_match() - determine the longest prefix*@trie: The trie to get internal sizes from*@node: The node to operate on*@key: The key to compare to @node* Determine the longest prefix of @node that matches the bits in @key.
244  If matchlen == max_prefixlen Then
245  found = node
246  Break
253  If matchlen < prefixlen Then Break
259  If Not (flags & Intermediate node ) Then found = node
266  next_bit = This trie implements a longest prefix match algorithm that can be used to* match IP addresses to a stored set of ranges.* Data stored in @data of struct bpf_lpm_key and struct lpm_trie_node is
267  node = fetch RCU-protected pointer for dereferencing(child[next_bit])
270  If Not found Then Return NULL
273  Return data + data_size