Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:__dev_map_update_elem

Proto:static int __dev_map_update_elem(struct net *net, struct bpf_map *map, void *key, void *value, u64 map_flags)

Type:int

Parameter:

TypeParameterName
struct net *net
struct bpf_map *map
void *key
void *value
u64map_flags
626  dtab = container_of - cast a member of a structure out to the containing structure*@ptr: the pointer to the member.*@type: the type of the container struct this is embedded in.*@member: the name of the member within the struct.(map, structbpf_dtab, map)
628  ifindex = value
629  i = key
631  If Value for the false possibility is greater at compile time(map_flags > update existing element ) Then Return -EINVAL
633  If Value for the false possibility is greater at compile time(i >= max_entries) Then Return -E2BIG
635  If Value for the false possibility is greater at compile time(map_flags == create new element if it didn't exist ) Then Return -EEXIST
638  If Not ifindex Then
639  dev = NULL
640  Else
641  dev = __dev_map_alloc_node(net, dtab, ifindex, i)
642  If IS_ERR(dev) Then Return PTR_ERR(dev)
650  old_dev = xchg( & DEVMAP type only [i], dev)
651  If old_dev Then all_rcu() - Queue an RCU callback for invocation after a grace period
654  Return 0
Caller
NameDescribe
dev_map_update_elem