Function report |
Source Code:kernel\bpf\lpm_trie.c |
Create Date:2022-07-28 13:13:36 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:trie_get_next_key
Proto:static int trie_get_next_key(struct bpf_map *map, void *_key, void *_next_key)
Type:int
Parameter:
Type | Parameter | Name |
---|---|---|
struct bpf_map * | map | |
void * | _key | |
void * | _next_key |
635 | struct lpm_trie_node * * node_stack = NULL |
653 | If Not search_root Then Return -ENOENT |
657 | If Not key || up to 32 for AF_INET, 128 for AF_INET6 > max_prefixlen Then Go to find_leftmost |
660 | node_stack = kmalloc_array - allocate memory for an array.*@n: number of elements.*@size: element size.*@flags: the type of memory to allocate (see kmalloc). |
663 | If Not node_stack Then Return -ENOMEM |
668 | node_stack[++stack_ptr] = node |
670 | If prefixlen != matchlen || prefixlen == up to 32 for AF_INET, 128 for AF_INET6 Then Break |
677 | If Not node || prefixlen != up to 32 for AF_INET, 128 for AF_INET6 || flags & Intermediate node Then Go to find_leftmost |
684 | node = node_stack[stack_ptr] |
686 | parent = node_stack[stack_ptr - 1] |
687 | If fetch RCU-protected pointer for dereferencing(child[0]) == node Then |
689 | If search_root Then Go to find_leftmost |
692 | If Not (flags & Intermediate node ) Then |
698 | stack_ptr-- |
703 | Go to free_stack |
705 | find_leftmost : |
710 | If flags & Intermediate node Then |
712 | Else |
715 | If Not node Then node = fetch RCU-protected pointer for dereferencing(child[1]) |
719 | do_copy : |
721 | No 3D Now!((void * )next_key + offsetof(structbpf_lpm_trie_key, data), data, data_size) |
723 | free_stack : |
724 | kfree(node_stack) |
725 | Return err |
Source code conversion tool public plug-in interface | X |
---|---|
Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |