Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:bpf_offload_dev_netdev_register

Proto:int bpf_offload_dev_netdev_register(struct bpf_offload_dev *offdev, struct net_device *netdev)

Type:int

Parameter:

TypeParameterName
struct bpf_offload_dev *offdev
struct net_device *netdev
601  ondev = kzalloc - allocate memory. The memory is set to zero.*@size: how many bytes of memory are required.*@flags: the type of memory to allocate (see kmalloc).
602  If Not ondev Then Return -ENOMEM
605  netdev = netdev
606  offdev = offdev
607  Initialization list head
608  Initialization list head
610  lock for writing
611  err = hashtable_insert_fast - insert object into hash table*@ht: hash table*@obj: pointer to hash head inside object*@params: hash table parameters* Will take the per bucket bitlock to protect against mutual mutations* on the same bucket
612  If err Then
613  netdev_warn(netdev, "failed to register for BPF offload\n")
614  Go to err_unlock_free
617  list_add - add a new entry*@new: new entry to be added*@head: list head to add it after* Insert a new entry after the specified head.* This is good for implementing stacks.
618  lease a write lock
619  Return 0
621  err_unlock_free :
622  lease a write lock
623  kfree(ondev)
624  Return err