函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\bpf\hashtab.c Create Date:2022-07-27 14:25:04
Last Modify:2022-05-23 09:15:29 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:Called from syscall

函数原型:static int htab_map_alloc_check(union bpf_attr *attr)

返回类型:int

参数:

类型参数名称
union bpf_attr *attr
228  percpu等于 one of enum bpf_map_type 恒等于BPF_MAP_TYPE_PERCPU_HASH one of enum bpf_map_type 恒等于BPF_MAP_TYPE_LRU_PERCPU_HASH
230  lru等于 one of enum bpf_map_type 恒等于BPF_MAP_TYPE_LRU_HASH one of enum bpf_map_type 恒等于BPF_MAP_TYPE_LRU_PERCPU_HASH
237  percpu_lru等于 BPF_MAP_CREATE related * flags defined above.按位与Instead of having one common LRU list in the* BPF_MAP_TYPE_LRU_[PERCPU_]HASH map, use a percpu LRU list* which can scale and perform better.* Note, the LRU nodes (including free nodes) cannot be moved* across different LRU lists.
238  prealloc等于非 BPF_MAP_CREATE related * flags defined above.按位与lags for BPF_MAP_CREATE command 的值
239  zero_seed等于 BPF_MAP_CREATE related * flags defined above.按位与Zero-initialize hash function seed. This should only be used for testing.
240  numa_node等于bpf_map_attr_numa_node(attr)
242  BUILD_BUG_ON - break compile if a condition is true(offsetof(structhtab_elem, htab) != offsetof(structhtab_elem, pprev))
244  BUILD_BUG_ON - break compile if a condition is true(offsetof(structhtab_elem, next) != offsetof(structhtab_elem, pprev))
247  如果lru且非操作权限检查则返回:负EPERM
253  如果zero_seed且非操作权限检查则返回:负EPERM
257  如果 BPF_MAP_CREATE related * flags defined above.按位与HTAB_CREATE_FLAG_MASK的反或非bpf_map_flags_access_ok( BPF_MAP_CREATE related * flags defined above.)则返回:负EINVAL
261  如果非lrupercpu_lru则返回:负EINVAL
264  如果lru且非prealloc则返回:负Operation is not supported
267  如果numa_node不等于NUMA_NO_NODEpercpupercpu_lru的值则返回:负EINVAL
273  如果 max number of entries in a map 恒等于0或 size of key in bytes 恒等于0或 size of value in bytes 恒等于0则返回:负EINVAL
277  如果 size of key in bytes 大于BPF program can access up to 512 bytes of stack space. 则返回:负E2BIG
283  如果 size of value in bytes 大于等于Maximum allocatable size BPF program can access up to 512 bytes of stack space. sizeof(structhtab_elem)则返回:负E2BIG
292  返回:0
调用者
名称描述
fd_htab_map_alloc_check