Function report |
Source Code:kernel\bpf\arraymap.c |
Create Date:2022-07-28 13:10:58 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:array_map_alloc
Proto:static struct bpf_map *array_map_alloc(union bpf_attr *attr)
Type:struct bpf_map
Parameter:
Type | Parameter | Name |
---|---|---|
union bpf_attr * | attr |
80 | unpriv = Not Check operation authority |
93 | mask64 = fls_long(max_entries - 1) |
95 | mask64 -= 1 |
97 | index_mask = mask64 |
98 | If unpriv Then |
102 | max_entries = index_mask + 1 |
104 | If max_entries < max number of entries in a map Then Return ERR_PTR( - E2BIG) |
108 | array_size = size of array |
109 | If percpu Then |
110 | array_size += max_entries * size of * |
111 | Else |
124 | cost = array_size |
125 | If percpu Then cost += max number of entries in a map * elem_size * num_possible_cpus() |
128 | ret = bpf_map_charge_init( & mem, cost) |
138 | If Not data Then |
139 | bpf_map_charge_finish( & mem) |
144 | Else |
145 | array = bpf_map_area_alloc(array_size, numa_node) |
147 | If Not array Then |
148 | bpf_map_charge_finish( & mem) |
151 | index_mask = index_mask |
152 | unpriv_array = unpriv |
155 | bpf_map_init_from_attr( & map, attr) |
156 | bpf_map_charge_move( & memory, & mem) |
159 | If percpu && bpf_array_alloc_percpu(array) Then |
165 | Return map |
Name | Describe |
---|---|
prog_array_map_alloc | |
array_of_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 |