函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\bpf\xskmap.c Create Date:2022-07-27 14:42:48
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:xsk_map_alloc

函数原型:static struct bpf_map *xsk_map_alloc(union bpf_attr *attr)

返回类型:struct bpf_map

参数:

类型参数名称
union bpf_attr *attr
79  如果非操作权限检查则返回:错误号
82  如果 max number of entries in a map 恒等于0或 size of key in bytes 不等于4或 size of value in bytes 不等于4或 BPF_MAP_CREATE related * flags defined above.按位与Specify numa node during map creation 按位或Flags for accessing BPF object from syscall side. 按位或BPF_F_WRONLY的值的反则返回:错误号
87  numa_node等于bpf_map_attr_numa_node(attr)
88  size等于struct_size() - Calculate size of structure with trailing array.*@p: Pointer to the structure.*@member: Name of the array member.*@n: Number of elements in the array.* Calculates size of memory needed for structure @p followed by an(m, xsk_map, max number of entries in a map )
89  cost等于sizearray_size() - Calculate size of 2-dimensional array.*@a: dimension one*@b: dimension two* Calculates size of 2-dimensional array: @a *@b.* Returns: number of bytes needed to represent the array or SIZE_MAX on* overflow.
91  err等于bpf_map_charge_init( & mem, cost)
92  如果err小于0则返回:错误号
95  m等于bpf_map_area_alloc(size, numa_node)
96  如果非m
97  bpf_map_charge_finish( & mem)
98  返回:错误号
101  bpf_map_init_from_attr( & map, attr)
102  bpf_map_charge_move( & memory, & mem)
103  spin_lock_init( & Synchronize map updates )
105  flush_list等于alloc_percpu(structlist_head)
106  如果非flush_list
107  bpf_map_charge_finish( & memory)
108  bpf_map_area_free(m)
109  返回:错误号
112  遍历可用CPU(cpu)
113  初始化链表头
115  返回:map