函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:__cpu_map_entry_alloc

函数原型:static struct bpf_cpu_map_entry *__cpu_map_entry_alloc(u32 qsize, u32 cpu, int map_id)

返回类型:struct bpf_cpu_map_entry

参数:

类型参数名称
u32qsize
u32cpu
intmap_id
337  gfp等于GFP_KERNEL按位或DOC: Action modifiers* Action modifiers* ~~~~~~~~~~~~~~~~* %__GFP_NOWARN suppresses allocation failure reports.* %__GFP_COMP address compound page metadata.* %__GFP_ZERO returns a zeroed page on success.
343  numa等于cpu_to_node(cpu)
345  rcpu等于根据内存节点分配内存
346  如果非rcpu则返回:NULL
350  XDP can run multiple RX-ring queues, need __percpu enqueue store 等于__alloc_percpu_gfp( XDP can run multiple RX-ring queues, need __percpu enqueue store 的长度, *的长度, gfp)
352  如果非 XDP can run multiple RX-ring queues, need __percpu enqueue store 则转到:free_rcu
355  遍历可用CPU(i)
356  bq等于per_cpu_ptr( XDP can run multiple RX-ring queues, need __percpu enqueue store , i)
357  obj等于rcpu
361  Queue with potential multi-producers, and single-consumer kthread 等于根据内存节点分配内存
362  如果非 Queue with potential multi-producers, and single-consumer kthread 则转到:free_bulkq
365  err等于ptr_ring_init( Queue with potential multi-producers, and single-consumer kthread , qsize, gfp)
366  如果err则转到:free_queue
369  kthread CPU and map index 等于cpu
370  Back reference to map 等于map_id
371  Queue size placeholder for map lookup 等于qsize
374  kthread等于kthread_create_on_node - create a kthread
376  如果是错误则转到:free_ptr_ring
379  get_cpu_map_entry(rcpu)
380  get_cpu_map_entry(rcpu)
383  kthread_bind - bind a just-created kthread to a cpu
384  唤醒中断线程
386  返回:rcpu
388  free_ptr_ring :
389  ptr_ring_cleanup( Queue with potential multi-producers, and single-consumer kthread , NULL)
390  free_queue :
391  kfree( Queue with potential multi-producers, and single-consumer kthread )
392  free_bulkq :
393  释放内存
394  free_rcu :
395  kfree(rcpu)
396  返回:NULL
调用者
名称描述
cpu_map_update_elem