Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\bpf\syscall.c Create Date:2022-07-28 12:51:40
Last Modify:2022-05-19 18:06:12 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:find_and_alloc_map

Proto:static struct bpf_map *find_and_alloc_map(union bpf_attr *attr)

Type:struct bpf_map

Parameter:

TypeParameterName
union bpf_attr *attr
105  type = one of enum bpf_map_type
109  If type >= ARRAY_SIZE - get the number of elements in array @arr*@arr: array to be sized(bpf_map_types) Then Return ERR_PTR( - EINVAL)
111  type = array_index_nospec - sanitize an array index after a bounds check* For a code sequence like:* if (index < size) {* index = array_index_nospec(index, size);* val = array[index];* }* (type, ARRAY_SIZE - get the number of elements in array @arr*@arr: array to be sized(bpf_map_types))
112  ops = bpf_map_types[type]
113  If Not ops Then Return ERR_PTR( - EINVAL)
116  If map_alloc_check Then
117  err = map_alloc_check(attr)
118  If err Then Return ERR_PTR(err)
121  If ifindex of netdev to create on Then ops = bpf_map_offload_ops
123  map = map_alloc(attr)
124  If IS_ERR(map) Then Return map
126  The first two cachelines with read-mostly members of which some * are also accessed in fast-path (e.g. ops, max_entries). = ops
127  map_type = type
128  Return map
Caller
NameDescribe
map_createalled via syscall