Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\bpf\cpumap.c Create Date:2022-07-28 13:23:53
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:__cpu_map_entry_alloc

Proto:static struct bpf_cpu_map_entry *__cpu_map_entry_alloc(u32 qsize, u32 cpu, int map_id)

Type:struct bpf_cpu_map_entry

Parameter:

TypeParameterName
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 = kzalloc_node - allocate zeroed memory from a particular memory node.*@size: how many bytes of memory are required.*@flags: the type of memory to allocate (see kmalloc).*@node: memory node from which to allocate
346  If Not rcpu Then Return NULL
350  XDP can run multiple RX-ring queues, need __percpu enqueue store = __alloc_percpu_gfp( size of XDP can run multiple RX-ring queues, need __percpu enqueue store , size of * , gfp)
352  If Not XDP can run multiple RX-ring queues, need __percpu enqueue store Then Go to free_rcu
355  for_each_possible_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 = kzalloc_node - allocate zeroed memory from a particular memory node.*@size: how many bytes of memory are required.*@flags: the type of memory to allocate (see kmalloc).*@node: memory node from which to allocate
362  If Not Queue with potential multi-producers, and single-consumer kthread Then Go to free_bulkq
365  err = ptr_ring_init( Queue with potential multi-producers, and single-consumer kthread , qsize, gfp)
366  If err Then Go to 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  If IS_ERR(kthread) Then Go to 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  wake_up_process - Wake up a specific process*@p: The process to be woken up.* Attempt to wake up the nominated process and move it to the set of runnable* processes.* Return: 1 if the process was woken up, 0 if it was already running.
386  Return 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  free previously allocated percpu memory
394  free_rcu :
395  kfree(rcpu)
396  Return NULL
Caller
NameDescribe
cpu_map_update_elem