函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Called from syscall or from eBPF program

函数原型:static void *trie_lookup_elem(struct bpf_map *map, void *_key)

返回类型:void

参数:

类型参数名称
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 node循环
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  如果matchlen恒等于max_prefixlen
245  found等于node
246  退出
253  如果matchlen小于prefixlen退出
259  如果非flags按位与Intermediate node 的值则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等于cu_dereference() - fetch RCU-protected pointer for dereferencing*@p: The pointer to read, prior to dereferencing* This is a simple wrapper around rcu_dereference_check().(child[next_bit])
270  如果非found则返回:NULL
273  返回:datadata_size