函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:dev_map_free

函数原型:static void dev_map_free(struct bpf_map *map)

返回类型:void

参数:

类型参数名称
struct bpf_map *map
203  dtab等于container_of - cast a member of a structure out to the containing structure*@ptr: the pointer to the member.*@type: the type of the container struct this is embedded in.*@member: the name of the member within the struct.(map, structbpf_dtab, map)
214  加自旋锁
215  删除不需要重新初始化的列表项
216  自旋锁解锁
218  bpf_clear_redirect_map(map)
219  Wait for a grace period to elapse. But it is illegal to invoke* synchronize_rcu() from within an RCU read-side critical section.* Therefore, any legal call to synchronize_rcu() is a quiescent
222  rcu_barrier()
229  遍历在线CPU(cpu)
230  flush_list等于per_cpu_ptr(flush_list, cpu)
232  当非链表为空循环
233  cond_resched()
236  如果map_type恒等于BPF_MAP_TYPE_DEVMAP_HASH
237 i小于n_buckets循环
242  head等于dev_map_index_hash(dtab, i)
246  释放内存
248  kfree(dev)
252  kfree( these are only used for DEVMAP_HASH type maps )
253  否则
254 i小于max_entries循环
257  dev等于 DEVMAP type only [i]
258  如果非dev则继续下一循环
261  释放内存
263  kfree(dev)
266  bpf_map_area_free( DEVMAP type only )
269  释放内存
270  kfree(dtab)