Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\test_bpf.c Create Date:2022-07-28 06:26:53
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:bpf_fill_maxinsns3

Proto:static int bpf_fill_maxinsns3(struct bpf_test *self)

Type:int

Parameter:

TypeParameterName
struct bpf_test *self
128  len = BPF_MAXINSNS
133  insn = kmalloc_array - allocate memory for an array.*@n: number of elements.*@size: element size.*@flags: the type of memory to allocate (see kmalloc).
134  If Not insn Then Return -ENOMEM
137  prandom_seed_state - set seed for prandom_u32_state().*@state: pointer to state structure to receive the seed.*@seed: arbitrary 64-bit value to use as a seed.
139  When i < len - 1 cycle
140  k = prandom_u32_state( & rnd)
142  insn[i] = Internal classic blocks for direct assignment (BPF_ALU | BPF_ADD | BPF_K, k)
145  insn[len - 1] = Internal classic blocks for direct assignment (BPF_RET | BPF_A, 0)
147  insns = insn
148  len = len
150  Return 0