Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:bq_xmit_all

Proto:static int bq_xmit_all(struct xdp_bulk_queue *bq, u32 flags, bool in_napi_ctx)

Type:int

Parameter:

TypeParameterName
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  If Value for the false possibility is greater at compile time(!count) Then Return 0
360  When i < count cycle
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  If sent < 0 Then
368  err = sent
369  sent = 0
370  Go to error
372  drops = count - sent
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  Return 0
381  error :
385  When i < count cycle
386  xdpf = q[i]
389  If Value is more likely to compile time(in_napi_ctx) Then xdp_return_frame_rx_napi(xdpf)
391  Else xdp_return_frame(xdpf)
393  drops++
395  Go to out
Caller
NameDescribe
__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