Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:__dev_map_alloc_node

Proto:static struct bpf_dtab_netdev *__dev_map_alloc_node(struct net *net, struct bpf_dtab *dtab, u32 ifindex, unsigned int idx)

Type:struct bpf_dtab_netdev

Parameter:

TypeParameterName
struct net *net
struct bpf_dtab *dtab
u32ifindex
unsigned intidx
589  gfp = 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 | DOC: Action modifiers* Action modifiers* ~~~~~~~~~~~~~~~~* %__GFP_NOWARN suppresses allocation failure reports.* %__GFP_COMP address compound page metadata.* %__GFP_ZERO returns a zeroed page on success.
594  dev = kmalloc_node( size of dev , gfp, numa_node)
595  If Not dev Then Return ERR_PTR( - ENOMEM)
598  bulkq = __alloc_percpu_gfp( size of bulkq , size of * , gfp)
600  If Not bulkq Then
601  kfree(dev)
602  Return ERR_PTR( - ENOMEM)
605  for_each_possible_cpu(cpu)
606  bq = per_cpu_ptr(bulkq, cpu)
607  obj = dev
610  must be first member, due to tracepoint = find a device by its ifindex
611  If Not must be first member, due to tracepoint Then
612  free previously allocated percpu memory
613  kfree(dev)
614  Return ERR_PTR( - EINVAL)
617  keep track of map index for tracepoint = idx
618  dtab = dtab
620  Return dev
Caller
NameDescribe
__dev_map_update_elem
__dev_map_hash_update_elem