函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Called from syscall or from eBPF program

函数原型:static int trie_delete_elem(struct bpf_map *map, void *_key)

返回类型:int

参数:

类型参数名称
struct bpf_map *map
void *_key
433  trie等于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, structlpm_trie, map)
434  key等于_key
435  __rcutrim
439  matchlen等于0
440  ret等于0
442  如果up to 32 for AF_INET, 128 for AF_INET6 大于max_prefixlen则返回:负EINVAL
445  raw_spin_lock_irqsave( & lock, irq_flags)
453  trim等于root
454  trim2等于trim
455  parent = NULL
456 node等于cu_dereference_protected() - fetch RCU pointer when updates prevented*@p: The pointer to read, prior to dereferencing*@c: The conditions under which the dereference will take place* Return the value of the specified RCU-protected pointer, but omit( * trim, lockdep_is_held( & lock))循环
458  matchlen等于longest_prefix_match() - determine the longest prefix*@trie: The trie to get internal sizes from*@node: The node to operate on*@key: The key to compare to @node* Determine the longest prefix of @node that matches the bits in @key.
460  如果prefixlen不等于matchlenprefixlen恒等于up to 32 for AF_INET, 128 for AF_INET6 退出
464  parent等于node
465  trim2等于trim
466  next_bit等于This trie implements a longest prefix match algorithm that can be used to* match IP addresses to a stored set of ranges.* Data stored in @data of struct bpf_lpm_key and struct lpm_trie_node is
467  trim等于child[next_bit]
470  如果非nodeprefixlen不等于up to 32 for AF_INET, 128 for AF_INET6 prefixlen不等于matchlenflags按位与Intermediate node
473  ret等于负ENOENT
474  转到:out
477  n_entries自减
482  如果cu_access_pointer() - fetch RCU pointer with no dereferencing*@p: The pointer to read* Return the value of the specified RCU-protected pointer, but omit the* lockdep checks for being in an RCU read-side critical section(child[0])且cu_access_pointer() - fetch RCU pointer with no dereferencing*@p: The pointer to read* Return the value of the specified RCU-protected pointer, but omit the* lockdep checks for being in an RCU read-side critical section(child[1])则
484  flags或等于Intermediate node
485  转到:out
495  如果parentflags按位与Intermediate node 且非child[0]且非child[1]则
497  如果node恒等于cu_access_pointer() - fetch RCU pointer with no dereferencing*@p: The pointer to read* Return the value of the specified RCU-protected pointer, but omit the* lockdep checks for being in an RCU read-side critical section(child[0])则cu_assign_pointer() - assign to RCU-protected pointer*@p: pointer to assign to*@v: value to assign (publish)* Assigns the specified value to the specified RCU-protected* pointer, ensuring that any concurrent RCU readers will see* any prior initialization( * trim2, cu_access_pointer() - fetch RCU pointer with no dereferencing*@p: The pointer to read* Return the value of the specified RCU-protected pointer, but omit the* lockdep checks for being in an RCU read-side critical section(child[1]))
500  否则cu_assign_pointer() - assign to RCU-protected pointer*@p: pointer to assign to*@v: value to assign (publish)* Assigns the specified value to the specified RCU-protected* pointer, ensuring that any concurrent RCU readers will see* any prior initialization( * trim2, cu_access_pointer() - fetch RCU pointer with no dereferencing*@p: The pointer to read* Return the value of the specified RCU-protected pointer, but omit the* lockdep checks for being in an RCU read-side critical section(child[0]))
503  kfree_rcu() - kfree an object after a grace period(parent, rcu)
504  kfree_rcu() - kfree an object after a grace period(node, rcu)
505  转到:out
512  如果child[0]则cu_assign_pointer() - assign to RCU-protected pointer*@p: pointer to assign to*@v: value to assign (publish)* Assigns the specified value to the specified RCU-protected* pointer, ensuring that any concurrent RCU readers will see* any prior initialization( * trim, cu_access_pointer() - fetch RCU pointer with no dereferencing*@p: The pointer to read* Return the value of the specified RCU-protected pointer, but omit the* lockdep checks for being in an RCU read-side critical section(child[0]))
514  否则如果child[1]则cu_assign_pointer() - assign to RCU-protected pointer*@p: pointer to assign to*@v: value to assign (publish)* Assigns the specified value to the specified RCU-protected* pointer, ensuring that any concurrent RCU readers will see* any prior initialization( * trim, cu_access_pointer() - fetch RCU pointer with no dereferencing*@p: The pointer to read* Return the value of the specified RCU-protected pointer, but omit the* lockdep checks for being in an RCU read-side critical section(child[1]))
516  否则RCU_INIT_POINTER() - initialize an RCU protected pointer*@p: The pointer to be initialized.*@v: The value to initialized the pointer to.* Initialize an RCU-protected pointer in special cases where readers( * trim, NULL)
518  kfree_rcu() - kfree an object after a grace period(node, rcu)
520  out :
521  raw_spin_unlock_irqrestore( & lock, irq_flags)
523  返回:ret