函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:bq_flush_to_queue

函数原型:static int bq_flush_to_queue(struct xdp_bulk_queue *bq, bool in_napi_ctx)

返回类型:int

参数:

类型参数名称
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  如果此条件成立可能性小(为编译器优化)(!count)则返回:0
613  q等于 Queue with potential multi-producers, and single-consumer kthread
614  加自旋锁
616 i小于count循环
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  如果err
622  drops自加
625  否则xdp_return_frame(xdpf)
628  processed自加
630  count等于0
631  自旋锁解锁
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  返回:0
调用者
名称描述
__cpu_map_entry_free
bq_enqueueRuns under RCU-read-side, plus in softirq under NAPI protection.* Thus, safe percpu variable access.
__cpu_map_flush