| Function report | 
| Source Code: kernel\bpf\lpm_trie.c | Create Date:2022-07-28 13:13:29 | 
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick | 
| home page | Tree | 
| Annotation kernel can get tool activity | Download SCCT | Chinese | 
Name:trie_alloc
Proto:static struct bpf_map *trie_alloc(union bpf_attr *attr)
Type:struct bpf_map
Parameter:
| Type | Parameter | Name | 
|---|---|---|
| union bpf_attr * | attr | 
| 546 | If Not Check operation authority Then Return ERR_PTR( - EPERM) | 
| 560 | trie = kzalloc - allocate memory. The memory is set to zero.*@size: how many bytes of memory are required.*@flags: the type of memory to allocate (see kmalloc). | 
| 565 | bpf_map_init_from_attr( & map, attr) | 
| 566 | data_size = size of key in bytes - offsetof(structbpf_lpm_trie_key, data) | 
| 568 | max_prefixlen = data_size * 8 | 
| 570 | cost_per_node = sizeof(structlpm_trie_node) + size of value in bytes + data_size | 
| 574 | ret = bpf_map_charge_init( & memory, cost) | 
| 578 | raw_spin_lock_init( & lock) | 
| 580 | Return map | 
| 581 | out_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 |