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:08
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name: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.

Proto:static size_t longest_prefix_match(const struct lpm_trie *trie, const struct lpm_trie_node *node, const struct bpf_lpm_trie_key *key)

Type:size_t

Parameter:

TypeParameterName
const struct lpm_trie *trie
const struct lpm_trie_node *node
const struct bpf_lpm_trie_key *key
168  limit = min - return minimum of two values of the same or compatible types*@x: first value*@y: second value(prefixlen, up to 32 for AF_INET, 128 for AF_INET6 )
169  prefixlen = 0 , i = 0
171  BUILD_BUG_ON - break compile if a condition is true(offsetof(structlpm_trie_node, data) % sizeof(u32))
172  BUILD_BUG_ON - break compile if a condition is true(offsetof(structbpf_lpm_trie_key, data) % sizeof(u32))
192  When data_size >= i + 4 cycle
193  diff = be32_to_cpu( * (__be32 * ) & data[i] ^ * (__be32 * ) & Arbitrary size [i])
196  prefixlen += 32 - ls - find last set bit in word*@x: the word to search* This is defined in a similar way as the libc and compiler builtin* ffs, but returns the position of the most significant set bit.* fls(value) returns 0 if value is 0 or the position of the last
197  If prefixlen >= limit Then Return limit
199  If diff Then Return prefixlen
201  i += 4
204  If data_size >= i + 2 Then
205  diff = be16_to_cpu( * (__be16 * ) & data[i] ^ * (__be16 * ) & Arbitrary size [i])
208  prefixlen += 16 - ls - find last set bit in word*@x: the word to search* This is defined in a similar way as the libc and compiler builtin* ffs, but returns the position of the most significant set bit.* fls(value) returns 0 if value is 0 or the position of the last
209  If prefixlen >= limit Then Return limit
211  If diff Then Return prefixlen
213  i += 2
216  If data_size >= i + 1 Then
217  prefixlen += 8 - ls - find last set bit in word*@x: the word to search* This is defined in a similar way as the libc and compiler builtin* ffs, but returns the position of the most significant set bit.* fls(value) returns 0 if value is 0 or the position of the last
219  If prefixlen >= limit Then Return limit
223  Return prefixlen
Caller
NameDescribe
trie_lookup_elemCalled from syscall or from eBPF program
trie_update_elemCalled from syscall or from eBPF program
trie_delete_elemCalled from syscall or from eBPF program
trie_get_next_key