Function report | 
Source Code:kernel\bpf\hashtab.c | 
Create Date:2022-07-28 13:09:09 | 
| Last Modify:2022-05-23 09:15:29 | Copyright©Brick | 
| home page | Tree | 
| Annotation kernel can get tool activity | Download SCCT | Chinese | 
Name:prealloc_init
Proto:static int prealloc_init(struct bpf_htab *htab)
Type:int
Parameter:
| Type | Parameter | Name | 
|---|---|---|
| struct bpf_htab * | htab | 
| 136 | num_entries = max_entries | 
| 139 | If Not htab_is_percpu(htab) && Not htab_is_lru(htab) Then num_entries += num_possible_cpus() | 
| 147 | If Not htab_is_percpu(htab) Then Go to skip_percpu_elems | 
| 150 | When i < num_entries cycle | 
| 155 | If Not pptr Then Go to free_elems | 
| 157 | htab_elem_set_ptr(get_htab_elem(htab, i), key_size, pptr) | 
| 159 | cond_resched() | 
| 162 | skip_percpu_elems : | 
| 170 | Else err = pcpu_freelist_init( & freelist) | 
| 173 | If err Then Go to free_elems | 
| 176 | If htab_is_lru(htab) Then bpf_lru_populate( & lru, elems, offsetof(structhtab_elem, lru_node), size of each element in bytes , num_entries) | 
| 180 | Else pcpu_freelist_populate( & freelist, elems + offsetof(structhtab_elem, fnode), size of each element in bytes , num_entries) | 
| 185 | Return 0 | 
| 187 | free_elems : | 
| 188 | htab_free_elems(htab) | 
| 189 | Return err | 
| Name | Describe | 
|---|---|
| htab_map_alloc | 
| 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  |