Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:bq_flush_to_queue

Proto:static int bq_flush_to_queue(struct xdp_bulk_queue *bq, bool in_napi_ctx)

Type:int

Parameter:

TypeParameterName
struct xdp_bulk_queue *bq
boolin_napi_ctx
604  rcpu = obj
605  processed = 0 , drops = 0
606  to_cpu = kthread CPU and map index
610  If Value for the false possibility is greater at compile time(!count) Then Return 0
613  q = Queue with potential multi-producers, and single-consumer kthread
614  spin_lock( & producer_lock)
616  When i < count cycle
617  xdpf = q[i]
620  err = Note: callers invoking this in a loop must use a compiler barrier,* for example cpu_relax(). Callers must hold producer_lock.* Callers are responsible for making sure pointer that is being queued* points to a valid data.
621  If err Then
622  drops++
625  Else xdp_return_frame(xdpf)
628  processed++
630  count = 0
631  spin_unlock( & producer_lock)
633  Delete a list entry and clear the 'prev' pointer.* This is a special-purpose list clearing method used in the networking code* for lists allocated as per-cpu, where we don't want to incur the extra* WRITE_ONCE() overhead of a regular list_del_init()
636  trace_xdp_cpumap_enqueue( Back reference to map , processed, drops, to_cpu)
637  Return 0
Caller
NameDescribe
__cpu_map_entry_free
bq_enqueueRuns under RCU-read-side, plus in softirq under NAPI protection.* Thus, safe percpu variable access.
__cpu_map_flush