Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:cpu_map_kthread_run

Proto:static int cpu_map_kthread_run(void *data)

Type:int

Parameter:

TypeParameterName
void *data
251  rcpu = data
253  set_current_state(TASK_INTERRUPTIBLE)
260  When Not 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(). || Not Test ring empty status without taking any locks cycle
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  schedule()
273  sched = 1
274  Else
277  Else
278  sched = cond_resched()
286  n = ptr_ring_consume_batched( Queue with potential multi-producers, and single-consumer kthread , frames, CPUMAP_BATCH)
288  When i < n cycle
289  f = frames[i]
299  m = kmem_cache_alloc_bulk(skbuff_head_cache, gfp, n, skbs)
301  When i < n cycle skbs[i] = NULL
303  drops = n
306  local_bh_disable()
307  When i < n cycle
308  xdpf = frames[i]
309  skb = skbs[i]
313  If Not skb Then
315  Continue
320  If ret == packet dropped Then 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;* (Used in tsk->state: )
330  put_cpu_map_entry(rcpu)
331  Return 0