函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:bq_xmit_all

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

返回类型:int

参数:

类型参数名称
struct xdp_bulk_queue *bq
u32flags
boolin_napi_ctx
352  obj等于obj
353  dev等于 must be first member, due to tracepoint
354  sent等于0, drops等于0, err等于0
357  如果此条件成立可能性小(为编译器优化)(!count)则返回:0
360 i小于count循环
361  xdpf等于q[i]
363  Prefetch instructions for Pentium III (+) and AMD Athlon (+)* It's not worth to care about 3dnow prefetches for the K6* because they are microcoded there and very slow.
366  sent等于ndo_xdp_xmit(dev, count, q, flags)
367  如果sent小于0则
368  err等于sent
369  sent等于0
370  转到:error
372  drops等于countsent
373  out :
374  count等于0
376  trace_xdp_devmap_xmit( & map, keep track of map index for tracepoint , sent, drops, dev_rx, dev, err)
378  dev_rx = NULL
379  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()
380  返回:0
381  error :
385 i小于count循环
386  xdpf等于q[i]
389  如果此条件成立可能性大(为编译器优化)(in_napi_ctx)则xdp_return_frame_rx_napi(xdpf)
391  否则xdp_return_frame(xdpf)
393  drops自加
395  转到:out
调用者
名称描述
__dev_map_flush__dev_map_flush is called from xdp_do_flush_map() which _must_ be signaled* from the driver before returning from its napi->poll() routine. The poll()* routine is called either from busy_poll context or net_rx_action signaled* from NET_RX_SOFTIRQ
bq_enqueueRuns under RCU-read-side, plus in softirq under NAPI protection.* Thus, safe percpu variable access.
dev_map_flush_old