| Function report | 
| Source Code: kernel\bpf\offload.c | Create Date:2022-07-28 13:25:29 | 
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick | 
| home page | Tree | 
| Annotation kernel can get tool activity | Download SCCT | Chinese | 
Name:bpf_map_offload_map_alloc
Proto:struct bpf_map *bpf_map_offload_map_alloc(union bpf_attr *attr)
Type:struct bpf_map
Parameter:
| Type | Parameter | Name | 
|---|---|---|
| union bpf_attr * | attr | 
| 369 | If Not Check operation authority Then Return ERR_PTR( - EPERM) | 
| 371 | If one of enum bpf_map_type != BPF_MAP_TYPE_ARRAY && one of enum bpf_map_type != BPF_MAP_TYPE_HASH Then Return ERR_PTR( - EINVAL) | 
| 375 | offmap = 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). | 
| 379 | bpf_map_init_from_attr( & map, attr) | 
| 382 | lock for writing | 
| 384 | err = bpf_dev_offload_check(netdev) | 
| 385 | If err Then Go to err_unlock | 
| 388 | ondev = bpf_offload_find_netdev(netdev) | 
| 389 | If Not ondev Then | 
| 391 | Go to err_unlock | 
| 395 | If err Then Go to err_unlock | 
| 400 | rtnl_unlock() | 
| 402 | Return map | 
| 404 | err_unlock : | 
| 406 | rtnl_unlock() | 
| 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 |