函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:cpu_map_kthread_run

函数原型:static int cpu_map_kthread_run(void *data)

返回类型:int

参数:

类型参数名称
void *data
251  rcpu等于data
253  set_current_state(睡眠态)
260  当非kthread_should_stop - should this kthread return now?* When someone calls kthread_stop() on your kthread, it will be woken* and this will return true. You should then return, and your return* value will be passed through to kthread_stop().或非Test ring empty status without taking any locks循环
261  drops等于0, sched等于0
264  gfp等于__GFP_ZERO按位或DOC: Useful GFP flag combinations* Useful GFP flag combinations* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~* Useful GFP flag combinations that are commonly used. It is recommended* that subsystems start with one of these combinations and then set/clear
272  进程调度
273  sched等于1
274  否则
277  否则
278  sched等于cond_resched()
286  n等于ptr_ring_consume_batched( Queue with potential multi-producers, and single-consumer kthread , frames, CPUMAP_BATCH)
288 i小于n循环
289  f等于frames[i]
299  m等于kmem_cache_alloc_bulk(skbuff_head_cache, gfp, n, skbs)
301 i小于n循环skbs[i] = NULL
303  drops等于n
306  local_bh_disable()
307 i小于n循环
308  xdpf等于frames[i]
309  skb等于skbs[i]
313  如果非skb
315  继续下一循环
320  如果ret恒等于packet dropped drops自加
324  trace_xdp_cpumap_kthread( Back reference to map , n, drops, sched)
326  local_bh_enable()
328  set_current_state() includes a barrier so that the write of current->state* is correctly serialised wrt the caller's subsequent test of whether to* actually sleep:* for (;;) {* set_current_state(TASK_UNINTERRUPTIBLE);* if (!need_sleep)* break;* (就绪态)
330  put_cpu_map_entry(rcpu)
331  返回:0