| Function report | 
| Source Code: kernel\bpf\offload.c | Create Date:2022-07-28 13:25:09 | 
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick | 
| home page | Tree | 
| Annotation kernel can get tool activity | Download SCCT | Chinese | 
Name:bpf_prog_offload_init
Proto:int bpf_prog_offload_init(struct bpf_prog *prog, union bpf_attr *attr)
Type:int
Parameter:
| Type | Parameter | Name | 
|---|---|---|
| struct bpf_prog * | prog | |
| union bpf_attr * | attr | 
| 86 | If one of enum bpf_prog_type != BPF_PROG_TYPE_SCHED_CLS && one of enum bpf_prog_type != BPF_PROG_TYPE_XDP Then Return -EINVAL | 
| 90 | If prog_flags Then Return -EINVAL | 
| 93 | offload = 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). | 
| 101 | err = bpf_dev_offload_check(netdev) | 
| 102 | If err Then Go to err_maybe_put | 
| 105 | lock for writing | 
| 106 | ondev = bpf_offload_find_netdev(netdev) | 
| 107 | If Not ondev Then | 
| 109 | Go to err_unlock | 
| 117 | Return 0 | 
| 118 | err_unlock : | 
| 120 | err_maybe_put : | 
| 121 | If netdev Then dev_put - release reference to device*@dev: network device* Release reference to device to allow it to be freed. | 
| 124 | Return err | 
| Name | Describe | 
|---|---|
| bpf_prog_load | 
| 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 |