函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Called from syscall only.* The "nsk" in the fd refcnt.* The "osk" and "reuse" are protected by reuseport_lock.

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

返回类型:int

参数:

类型参数名称
struct bpf_map *map
void *key
void *value
u64map_flags
251  array等于reuseport_array(map)
252  free_osk等于NULL
254  index等于key
258  如果map_flags大于update existing element 则返回:负EINVAL
261  如果index大于等于max_entries则返回:负E2BIG
264  如果value_size恒等于sizeof(u64)则
265  fd64等于value
267  如果fd64大于S32_MAX则返回:负EINVAL
269  fd等于fd64
270  否则
271  fd等于value
274  socket等于sockfd_lookup(fd, & err)
275  如果非socket则返回:err
278  nsk等于sk
279  如果非nsk
280  err等于负EINVAL
281  转到:put_file
285  err等于reuseport_array_update_check(array, nsk, 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(ptrs[index]), 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(sk_reuseport_cb), map_flags)
289  如果err则转到:put_file
292  spin_lock_bh( & reuseport_lock)
298  write_lock_bh( & sk_callback_lock)
300  osk等于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(ptrs[index], lockdep_is_held( & reuseport_lock))
302  reuse等于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(sk_reuseport_cb, lockdep_is_held( & reuseport_lock))
304  err等于reuseport_array_update_check(array, nsk, osk, reuse, map_flags)
305  如果err则转到:put_file_unlock
309  err等于reuseport_get_id(reuse)
310  如果err小于0则转到:put_file_unlock
313  WRITE_ONCE(sk_user_data, & ptrs[index])
314  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(ptrs[index], nsk)
315  free_osk等于osk
316  err等于0
318  put_file_unlock :
319  write_unlock_bh( & sk_callback_lock)
321  如果free_osk
322  write_lock_bh( & sk_callback_lock)
323  WRITE_ONCE(sk_user_data, NULL)
324  write_unlock_bh( & sk_callback_lock)
327  spin_unlock_bh( & reuseport_lock)
328  put_file :
329  fput(file)
330  返回:err
调用者
名称描述
map_update_elem