函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:__dev_map_update_elem

函数原型:static int __dev_map_update_elem(struct net *net, struct bpf_map *map, void *key, void *value, u64 map_flags)

返回类型:int

参数:

类型参数名称
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  如果此条件成立可能性小(为编译器优化)(map_flags > update existing element )则返回:负EINVAL
633  如果此条件成立可能性小(为编译器优化)(i >= max_entries)则返回:负E2BIG
635  如果此条件成立可能性小(为编译器优化)(map_flags == create new element if it didn't exist )则返回:负EEXIST
638  如果非ifindex
639  dev = NULL
640  否则
641  dev等于__dev_map_alloc_node(net, dtab, ifindex, i)
642  如果是错误则返回:错误
650  old_dev等于xchg( & DEVMAP type only [i], dev)
651  如果old_devall_rcu() - Queue an RCU callback for invocation after a grace period
654  返回:0
调用者
名称描述
dev_map_update_elem