#define pr_fmt(fmt) …
#include <linux/init.h>
#include <linux/module.h>
#include <linux/filter.h>
#include <linux/bpf.h>
#include <linux/skbuff.h>
#include <linux/netdevice.h>
#include <linux/if_vlan.h>
#include <linux/random.h>
#include <linux/highmem.h>
#include <linux/sched.h>
#define MAX_SUBTESTS …
#define MAX_TESTRUNS …
#define MAX_DATA …
#define MAX_INSNS …
#define MAX_K …
#define SKB_TYPE …
#define SKB_MARK …
#define SKB_HASH …
#define SKB_QUEUE_MAP …
#define SKB_VLAN_TCI …
#define SKB_VLAN_PRESENT …
#define SKB_DEV_IFINDEX …
#define SKB_DEV_TYPE …
#define R0 …
#define R1 …
#define R2 …
#define R3 …
#define R4 …
#define R5 …
#define R6 …
#define R7 …
#define R8 …
#define R9 …
#define R10 …
#define FLAG_NO_DATA …
#define FLAG_EXPECTED_FAIL …
#define FLAG_SKB_FRAG …
#define FLAG_VERIFIER_ZEXT …
#define FLAG_LARGE_MEM …
enum { … };
#define TEST_TYPE_MASK …
struct bpf_test { … };
static int bpf_fill_maxinsns1(struct bpf_test *self)
{ … }
static int bpf_fill_maxinsns2(struct bpf_test *self)
{ … }
static int bpf_fill_maxinsns3(struct bpf_test *self)
{ … }
static int bpf_fill_maxinsns4(struct bpf_test *self)
{ … }
static int bpf_fill_maxinsns5(struct bpf_test *self)
{ … }
static int bpf_fill_maxinsns6(struct bpf_test *self)
{ … }
static int bpf_fill_maxinsns7(struct bpf_test *self)
{ … }
static int bpf_fill_maxinsns8(struct bpf_test *self)
{ … }
static int bpf_fill_maxinsns9(struct bpf_test *self)
{ … }
static int bpf_fill_maxinsns10(struct bpf_test *self)
{ … }
static int __bpf_fill_ja(struct bpf_test *self, unsigned int len,
unsigned int plen)
{ … }
static int bpf_fill_maxinsns11(struct bpf_test *self)
{ … }
static int bpf_fill_maxinsns12(struct bpf_test *self)
{ … }
static int bpf_fill_maxinsns13(struct bpf_test *self)
{ … }
static int bpf_fill_ja(struct bpf_test *self)
{ … }
static int bpf_fill_ld_abs_get_processor_id(struct bpf_test *self)
{ … }
static int __bpf_fill_stxdw(struct bpf_test *self, int size)
{ … }
static int bpf_fill_stxw(struct bpf_test *self)
{ … }
static int bpf_fill_stxdw(struct bpf_test *self)
{ … }
static int __bpf_ld_imm64(struct bpf_insn insns[2], u8 reg, s64 imm64)
{ … }
static int __bpf_fill_max_jmp(struct bpf_test *self, int jmp, int imm)
{ … }
static int bpf_fill_max_jmp_taken(struct bpf_test *self)
{ … }
static int bpf_fill_max_jmp_not_taken(struct bpf_test *self)
{ … }
static int bpf_fill_max_jmp_always_taken(struct bpf_test *self)
{ … }
static int bpf_fill_max_jmp_never_taken(struct bpf_test *self)
{ … }
static bool __bpf_alu_result(u64 *res, u64 v1, u64 v2, u8 op)
{ … }
static int __bpf_fill_alu_shift(struct bpf_test *self, u8 op,
u8 mode, bool alu32)
{ … }
static int bpf_fill_alu64_lsh_imm(struct bpf_test *self)
{ … }
static int bpf_fill_alu64_rsh_imm(struct bpf_test *self)
{ … }
static int bpf_fill_alu64_arsh_imm(struct bpf_test *self)
{ … }
static int bpf_fill_alu64_lsh_reg(struct bpf_test *self)
{ … }
static int bpf_fill_alu64_rsh_reg(struct bpf_test *self)
{ … }
static int bpf_fill_alu64_arsh_reg(struct bpf_test *self)
{ … }
static int bpf_fill_alu32_lsh_imm(struct bpf_test *self)
{ … }
static int bpf_fill_alu32_rsh_imm(struct bpf_test *self)
{ … }
static int bpf_fill_alu32_arsh_imm(struct bpf_test *self)
{ … }
static int bpf_fill_alu32_lsh_reg(struct bpf_test *self)
{ … }
static int bpf_fill_alu32_rsh_reg(struct bpf_test *self)
{ … }
static int bpf_fill_alu32_arsh_reg(struct bpf_test *self)
{ … }
static int __bpf_fill_alu_shift_same_reg(struct bpf_test *self, u8 op,
bool alu32)
{ … }
static int bpf_fill_alu64_lsh_same_reg(struct bpf_test *self)
{ … }
static int bpf_fill_alu64_rsh_same_reg(struct bpf_test *self)
{ … }
static int bpf_fill_alu64_arsh_same_reg(struct bpf_test *self)
{ … }
static int bpf_fill_alu32_lsh_same_reg(struct bpf_test *self)
{ … }
static int bpf_fill_alu32_rsh_same_reg(struct bpf_test *self)
{ … }
static int bpf_fill_alu32_arsh_same_reg(struct bpf_test *self)
{ … }
static inline s64 value(int msb, int delta, int sign)
{ … }
static int __bpf_fill_pattern(struct bpf_test *self, void *arg,
int dbits, int sbits, int block1, int block2,
int (*emit)(struct bpf_test*, void*,
struct bpf_insn*, s64, s64))
{ … }
#define PATTERN_BLOCK1 …
#define PATTERN_BLOCK2 …
#define NR_PATTERN_RUNS …
static int __bpf_emit_alu64_imm(struct bpf_test *self, void *arg,
struct bpf_insn *insns, s64 dst, s64 imm)
{ … }
static int __bpf_emit_alu32_imm(struct bpf_test *self, void *arg,
struct bpf_insn *insns, s64 dst, s64 imm)
{ … }
static int __bpf_emit_alu64_reg(struct bpf_test *self, void *arg,
struct bpf_insn *insns, s64 dst, s64 src)
{ … }
static int __bpf_emit_alu32_reg(struct bpf_test *self, void *arg,
struct bpf_insn *insns, s64 dst, s64 src)
{ … }
static int __bpf_fill_alu64_imm(struct bpf_test *self, int op)
{ … }
static int __bpf_fill_alu32_imm(struct bpf_test *self, int op)
{ … }
static int __bpf_fill_alu64_reg(struct bpf_test *self, int op)
{ … }
static int __bpf_fill_alu32_reg(struct bpf_test *self, int op)
{ … }
static int bpf_fill_alu64_mov_imm(struct bpf_test *self)
{ … }
static int bpf_fill_alu64_and_imm(struct bpf_test *self)
{ … }
static int bpf_fill_alu64_or_imm(struct bpf_test *self)
{ … }
static int bpf_fill_alu64_xor_imm(struct bpf_test *self)
{ … }
static int bpf_fill_alu64_add_imm(struct bpf_test *self)
{ … }
static int bpf_fill_alu64_sub_imm(struct bpf_test *self)
{ … }
static int bpf_fill_alu64_mul_imm(struct bpf_test *self)
{ … }
static int bpf_fill_alu64_div_imm(struct bpf_test *self)
{ … }
static int bpf_fill_alu64_mod_imm(struct bpf_test *self)
{ … }
static int bpf_fill_alu32_mov_imm(struct bpf_test *self)
{ … }
static int bpf_fill_alu32_and_imm(struct bpf_test *self)
{ … }
static int bpf_fill_alu32_or_imm(struct bpf_test *self)
{ … }
static int bpf_fill_alu32_xor_imm(struct bpf_test *self)
{ … }
static int bpf_fill_alu32_add_imm(struct bpf_test *self)
{ … }
static int bpf_fill_alu32_sub_imm(struct bpf_test *self)
{ … }
static int bpf_fill_alu32_mul_imm(struct bpf_test *self)
{ … }
static int bpf_fill_alu32_div_imm(struct bpf_test *self)
{ … }
static int bpf_fill_alu32_mod_imm(struct bpf_test *self)
{ … }
static int bpf_fill_alu64_mov_reg(struct bpf_test *self)
{ … }
static int bpf_fill_alu64_and_reg(struct bpf_test *self)
{ … }
static int bpf_fill_alu64_or_reg(struct bpf_test *self)
{ … }
static int bpf_fill_alu64_xor_reg(struct bpf_test *self)
{ … }
static int bpf_fill_alu64_add_reg(struct bpf_test *self)
{ … }
static int bpf_fill_alu64_sub_reg(struct bpf_test *self)
{ … }
static int bpf_fill_alu64_mul_reg(struct bpf_test *self)
{ … }
static int bpf_fill_alu64_div_reg(struct bpf_test *self)
{ … }
static int bpf_fill_alu64_mod_reg(struct bpf_test *self)
{ … }
static int bpf_fill_alu32_mov_reg(struct bpf_test *self)
{ … }
static int bpf_fill_alu32_and_reg(struct bpf_test *self)
{ … }
static int bpf_fill_alu32_or_reg(struct bpf_test *self)
{ … }
static int bpf_fill_alu32_xor_reg(struct bpf_test *self)
{ … }
static int bpf_fill_alu32_add_reg(struct bpf_test *self)
{ … }
static int bpf_fill_alu32_sub_reg(struct bpf_test *self)
{ … }
static int bpf_fill_alu32_mul_reg(struct bpf_test *self)
{ … }
static int bpf_fill_alu32_div_reg(struct bpf_test *self)
{ … }
static int bpf_fill_alu32_mod_reg(struct bpf_test *self)
{ … }
static int __bpf_fill_alu_imm_regs(struct bpf_test *self, u8 op, bool alu32)
{ … }
static int bpf_fill_alu64_mov_imm_regs(struct bpf_test *self)
{ … }
static int bpf_fill_alu64_and_imm_regs(struct bpf_test *self)
{ … }
static int bpf_fill_alu64_or_imm_regs(struct bpf_test *self)
{ … }
static int bpf_fill_alu64_xor_imm_regs(struct bpf_test *self)
{ … }
static int bpf_fill_alu64_lsh_imm_regs(struct bpf_test *self)
{ … }
static int bpf_fill_alu64_rsh_imm_regs(struct bpf_test *self)
{ … }
static int bpf_fill_alu64_arsh_imm_regs(struct bpf_test *self)
{ … }
static int bpf_fill_alu64_add_imm_regs(struct bpf_test *self)
{ … }
static int bpf_fill_alu64_sub_imm_regs(struct bpf_test *self)
{ … }
static int bpf_fill_alu64_mul_imm_regs(struct bpf_test *self)
{ … }
static int bpf_fill_alu64_div_imm_regs(struct bpf_test *self)
{ … }
static int bpf_fill_alu64_mod_imm_regs(struct bpf_test *self)
{ … }
static int bpf_fill_alu32_mov_imm_regs(struct bpf_test *self)
{ … }
static int bpf_fill_alu32_and_imm_regs(struct bpf_test *self)
{ … }
static int bpf_fill_alu32_or_imm_regs(struct bpf_test *self)
{ … }
static int bpf_fill_alu32_xor_imm_regs(struct bpf_test *self)
{ … }
static int bpf_fill_alu32_lsh_imm_regs(struct bpf_test *self)
{ … }
static int bpf_fill_alu32_rsh_imm_regs(struct bpf_test *self)
{ … }
static int bpf_fill_alu32_arsh_imm_regs(struct bpf_test *self)
{ … }
static int bpf_fill_alu32_add_imm_regs(struct bpf_test *self)
{ … }
static int bpf_fill_alu32_sub_imm_regs(struct bpf_test *self)
{ … }
static int bpf_fill_alu32_mul_imm_regs(struct bpf_test *self)
{ … }
static int bpf_fill_alu32_div_imm_regs(struct bpf_test *self)
{ … }
static int bpf_fill_alu32_mod_imm_regs(struct bpf_test *self)
{ … }
static int __bpf_fill_alu_reg_pairs(struct bpf_test *self, u8 op, bool alu32)
{ … }
static int bpf_fill_alu64_mov_reg_pairs(struct bpf_test *self)
{ … }
static int bpf_fill_alu64_and_reg_pairs(struct bpf_test *self)
{ … }
static int bpf_fill_alu64_or_reg_pairs(struct bpf_test *self)
{ … }
static int bpf_fill_alu64_xor_reg_pairs(struct bpf_test *self)
{ … }
static int bpf_fill_alu64_lsh_reg_pairs(struct bpf_test *self)
{ … }
static int bpf_fill_alu64_rsh_reg_pairs(struct bpf_test *self)
{ … }
static int bpf_fill_alu64_arsh_reg_pairs(struct bpf_test *self)
{ … }
static int bpf_fill_alu64_add_reg_pairs(struct bpf_test *self)
{ … }
static int bpf_fill_alu64_sub_reg_pairs(struct bpf_test *self)
{ … }
static int bpf_fill_alu64_mul_reg_pairs(struct bpf_test *self)
{ … }
static int bpf_fill_alu64_div_reg_pairs(struct bpf_test *self)
{ … }
static int bpf_fill_alu64_mod_reg_pairs(struct bpf_test *self)
{ … }
static int bpf_fill_alu32_mov_reg_pairs(struct bpf_test *self)
{ … }
static int bpf_fill_alu32_and_reg_pairs(struct bpf_test *self)
{ … }
static int bpf_fill_alu32_or_reg_pairs(struct bpf_test *self)
{ … }
static int bpf_fill_alu32_xor_reg_pairs(struct bpf_test *self)
{ … }
static int bpf_fill_alu32_lsh_reg_pairs(struct bpf_test *self)
{ … }
static int bpf_fill_alu32_rsh_reg_pairs(struct bpf_test *self)
{ … }
static int bpf_fill_alu32_arsh_reg_pairs(struct bpf_test *self)
{ … }
static int bpf_fill_alu32_add_reg_pairs(struct bpf_test *self)
{ … }
static int bpf_fill_alu32_sub_reg_pairs(struct bpf_test *self)
{ … }
static int bpf_fill_alu32_mul_reg_pairs(struct bpf_test *self)
{ … }
static int bpf_fill_alu32_div_reg_pairs(struct bpf_test *self)
{ … }
static int bpf_fill_alu32_mod_reg_pairs(struct bpf_test *self)
{ … }
static int __bpf_emit_atomic64(struct bpf_test *self, void *arg,
struct bpf_insn *insns, s64 dst, s64 src)
{ … }
static int __bpf_emit_atomic32(struct bpf_test *self, void *arg,
struct bpf_insn *insns, s64 dst, s64 src)
{ … }
static int __bpf_emit_cmpxchg64(struct bpf_test *self, void *arg,
struct bpf_insn *insns, s64 dst, s64 src)
{ … }
static int __bpf_emit_cmpxchg32(struct bpf_test *self, void *arg,
struct bpf_insn *insns, s64 dst, s64 src)
{ … }
static int __bpf_fill_atomic64(struct bpf_test *self, int op)
{ … }
static int __bpf_fill_atomic32(struct bpf_test *self, int op)
{ … }
static int bpf_fill_atomic64_add(struct bpf_test *self)
{ … }
static int bpf_fill_atomic64_and(struct bpf_test *self)
{ … }
static int bpf_fill_atomic64_or(struct bpf_test *self)
{ … }
static int bpf_fill_atomic64_xor(struct bpf_test *self)
{ … }
static int bpf_fill_atomic64_add_fetch(struct bpf_test *self)
{ … }
static int bpf_fill_atomic64_and_fetch(struct bpf_test *self)
{ … }
static int bpf_fill_atomic64_or_fetch(struct bpf_test *self)
{ … }
static int bpf_fill_atomic64_xor_fetch(struct bpf_test *self)
{ … }
static int bpf_fill_atomic64_xchg(struct bpf_test *self)
{ … }
static int bpf_fill_cmpxchg64(struct bpf_test *self)
{ … }
static int bpf_fill_atomic32_add(struct bpf_test *self)
{ … }
static int bpf_fill_atomic32_and(struct bpf_test *self)
{ … }
static int bpf_fill_atomic32_or(struct bpf_test *self)
{ … }
static int bpf_fill_atomic32_xor(struct bpf_test *self)
{ … }
static int bpf_fill_atomic32_add_fetch(struct bpf_test *self)
{ … }
static int bpf_fill_atomic32_and_fetch(struct bpf_test *self)
{ … }
static int bpf_fill_atomic32_or_fetch(struct bpf_test *self)
{ … }
static int bpf_fill_atomic32_xor_fetch(struct bpf_test *self)
{ … }
static int bpf_fill_atomic32_xchg(struct bpf_test *self)
{ … }
static int bpf_fill_cmpxchg32(struct bpf_test *self)
{ … }
static int __bpf_fill_atomic_reg_pairs(struct bpf_test *self, u8 width, u8 op)
{ … }
static int bpf_fill_atomic64_add_reg_pairs(struct bpf_test *self)
{ … }
static int bpf_fill_atomic64_and_reg_pairs(struct bpf_test *self)
{ … }
static int bpf_fill_atomic64_or_reg_pairs(struct bpf_test *self)
{ … }
static int bpf_fill_atomic64_xor_reg_pairs(struct bpf_test *self)
{ … }
static int bpf_fill_atomic64_add_fetch_reg_pairs(struct bpf_test *self)
{ … }
static int bpf_fill_atomic64_and_fetch_reg_pairs(struct bpf_test *self)
{ … }
static int bpf_fill_atomic64_or_fetch_reg_pairs(struct bpf_test *self)
{ … }
static int bpf_fill_atomic64_xor_fetch_reg_pairs(struct bpf_test *self)
{ … }
static int bpf_fill_atomic64_xchg_reg_pairs(struct bpf_test *self)
{ … }
static int bpf_fill_atomic64_cmpxchg_reg_pairs(struct bpf_test *self)
{ … }
static int bpf_fill_atomic32_add_reg_pairs(struct bpf_test *self)
{ … }
static int bpf_fill_atomic32_and_reg_pairs(struct bpf_test *self)
{ … }
static int bpf_fill_atomic32_or_reg_pairs(struct bpf_test *self)
{ … }
static int bpf_fill_atomic32_xor_reg_pairs(struct bpf_test *self)
{ … }
static int bpf_fill_atomic32_add_fetch_reg_pairs(struct bpf_test *self)
{ … }
static int bpf_fill_atomic32_and_fetch_reg_pairs(struct bpf_test *self)
{ … }
static int bpf_fill_atomic32_or_fetch_reg_pairs(struct bpf_test *self)
{ … }
static int bpf_fill_atomic32_xor_fetch_reg_pairs(struct bpf_test *self)
{ … }
static int bpf_fill_atomic32_xchg_reg_pairs(struct bpf_test *self)
{ … }
static int bpf_fill_atomic32_cmpxchg_reg_pairs(struct bpf_test *self)
{ … }
static int bpf_fill_ld_imm64_magn(struct bpf_test *self)
{ … }
static int __bpf_fill_ld_imm64_bytes(struct bpf_test *self,
u8 base1, u8 mask1,
u8 base2, u8 mask2)
{ … }
static int bpf_fill_ld_imm64_checker(struct bpf_test *self)
{ … }
static int bpf_fill_ld_imm64_pos_neg(struct bpf_test *self)
{ … }
static int bpf_fill_ld_imm64_pos_zero(struct bpf_test *self)
{ … }
static int bpf_fill_ld_imm64_neg_zero(struct bpf_test *self)
{ … }
static bool __bpf_match_jmp_cond(s64 v1, s64 v2, u8 op)
{ … }
static int __bpf_emit_jmp_imm(struct bpf_test *self, void *arg,
struct bpf_insn *insns, s64 dst, s64 imm)
{ … }
static int __bpf_emit_jmp32_imm(struct bpf_test *self, void *arg,
struct bpf_insn *insns, s64 dst, s64 imm)
{ … }
static int __bpf_emit_jmp_reg(struct bpf_test *self, void *arg,
struct bpf_insn *insns, s64 dst, s64 src)
{ … }
static int __bpf_emit_jmp32_reg(struct bpf_test *self, void *arg,
struct bpf_insn *insns, s64 dst, s64 src)
{ … }
static int __bpf_fill_jmp_imm(struct bpf_test *self, int op)
{ … }
static int __bpf_fill_jmp32_imm(struct bpf_test *self, int op)
{ … }
static int __bpf_fill_jmp_reg(struct bpf_test *self, int op)
{ … }
static int __bpf_fill_jmp32_reg(struct bpf_test *self, int op)
{ … }
static int bpf_fill_jmp_jset_imm(struct bpf_test *self)
{ … }
static int bpf_fill_jmp_jeq_imm(struct bpf_test *self)
{ … }
static int bpf_fill_jmp_jne_imm(struct bpf_test *self)
{ … }
static int bpf_fill_jmp_jgt_imm(struct bpf_test *self)
{ … }
static int bpf_fill_jmp_jge_imm(struct bpf_test *self)
{ … }
static int bpf_fill_jmp_jlt_imm(struct bpf_test *self)
{ … }
static int bpf_fill_jmp_jle_imm(struct bpf_test *self)
{ … }
static int bpf_fill_jmp_jsgt_imm(struct bpf_test *self)
{ … }
static int bpf_fill_jmp_jsge_imm(struct bpf_test *self)
{ … }
static int bpf_fill_jmp_jslt_imm(struct bpf_test *self)
{ … }
static int bpf_fill_jmp_jsle_imm(struct bpf_test *self)
{ … }
static int bpf_fill_jmp32_jset_imm(struct bpf_test *self)
{ … }
static int bpf_fill_jmp32_jeq_imm(struct bpf_test *self)
{ … }
static int bpf_fill_jmp32_jne_imm(struct bpf_test *self)
{ … }
static int bpf_fill_jmp32_jgt_imm(struct bpf_test *self)
{ … }
static int bpf_fill_jmp32_jge_imm(struct bpf_test *self)
{ … }
static int bpf_fill_jmp32_jlt_imm(struct bpf_test *self)
{ … }
static int bpf_fill_jmp32_jle_imm(struct bpf_test *self)
{ … }
static int bpf_fill_jmp32_jsgt_imm(struct bpf_test *self)
{ … }
static int bpf_fill_jmp32_jsge_imm(struct bpf_test *self)
{ … }
static int bpf_fill_jmp32_jslt_imm(struct bpf_test *self)
{ … }
static int bpf_fill_jmp32_jsle_imm(struct bpf_test *self)
{ … }
static int bpf_fill_jmp_jset_reg(struct bpf_test *self)
{ … }
static int bpf_fill_jmp_jeq_reg(struct bpf_test *self)
{ … }
static int bpf_fill_jmp_jne_reg(struct bpf_test *self)
{ … }
static int bpf_fill_jmp_jgt_reg(struct bpf_test *self)
{ … }
static int bpf_fill_jmp_jge_reg(struct bpf_test *self)
{ … }
static int bpf_fill_jmp_jlt_reg(struct bpf_test *self)
{ … }
static int bpf_fill_jmp_jle_reg(struct bpf_test *self)
{ … }
static int bpf_fill_jmp_jsgt_reg(struct bpf_test *self)
{ … }
static int bpf_fill_jmp_jsge_reg(struct bpf_test *self)
{ … }
static int bpf_fill_jmp_jslt_reg(struct bpf_test *self)
{ … }
static int bpf_fill_jmp_jsle_reg(struct bpf_test *self)
{ … }
static int bpf_fill_jmp32_jset_reg(struct bpf_test *self)
{ … }
static int bpf_fill_jmp32_jeq_reg(struct bpf_test *self)
{ … }
static int bpf_fill_jmp32_jne_reg(struct bpf_test *self)
{ … }
static int bpf_fill_jmp32_jgt_reg(struct bpf_test *self)
{ … }
static int bpf_fill_jmp32_jge_reg(struct bpf_test *self)
{ … }
static int bpf_fill_jmp32_jlt_reg(struct bpf_test *self)
{ … }
static int bpf_fill_jmp32_jle_reg(struct bpf_test *self)
{ … }
static int bpf_fill_jmp32_jsgt_reg(struct bpf_test *self)
{ … }
static int bpf_fill_jmp32_jsge_reg(struct bpf_test *self)
{ … }
static int bpf_fill_jmp32_jslt_reg(struct bpf_test *self)
{ … }
static int bpf_fill_jmp32_jsle_reg(struct bpf_test *self)
{ … }
#define MAX_STAGGERED_JMP_SIZE …
#define NR_STAGGERED_JMP_RUNS …
static int __bpf_fill_staggered_jumps(struct bpf_test *self,
const struct bpf_insn *jmp,
u64 r1, u64 r2)
{ … }
static int bpf_fill_staggered_ja(struct bpf_test *self)
{ … }
static int bpf_fill_staggered_jeq_imm(struct bpf_test *self)
{ … }
static int bpf_fill_staggered_jne_imm(struct bpf_test *self)
{ … }
static int bpf_fill_staggered_jset_imm(struct bpf_test *self)
{ … }
static int bpf_fill_staggered_jgt_imm(struct bpf_test *self)
{ … }
static int bpf_fill_staggered_jge_imm(struct bpf_test *self)
{ … }
static int bpf_fill_staggered_jlt_imm(struct bpf_test *self)
{ … }
static int bpf_fill_staggered_jle_imm(struct bpf_test *self)
{ … }
static int bpf_fill_staggered_jsgt_imm(struct bpf_test *self)
{ … }
static int bpf_fill_staggered_jsge_imm(struct bpf_test *self)
{ … }
static int bpf_fill_staggered_jslt_imm(struct bpf_test *self)
{ … }
static int bpf_fill_staggered_jsle_imm(struct bpf_test *self)
{ … }
static int bpf_fill_staggered_jeq_reg(struct bpf_test *self)
{ … }
static int bpf_fill_staggered_jne_reg(struct bpf_test *self)
{ … }
static int bpf_fill_staggered_jset_reg(struct bpf_test *self)
{ … }
static int bpf_fill_staggered_jgt_reg(struct bpf_test *self)
{ … }
static int bpf_fill_staggered_jge_reg(struct bpf_test *self)
{ … }
static int bpf_fill_staggered_jlt_reg(struct bpf_test *self)
{ … }
static int bpf_fill_staggered_jle_reg(struct bpf_test *self)
{ … }
static int bpf_fill_staggered_jsgt_reg(struct bpf_test *self)
{ … }
static int bpf_fill_staggered_jsge_reg(struct bpf_test *self)
{ … }
static int bpf_fill_staggered_jslt_reg(struct bpf_test *self)
{ … }
static int bpf_fill_staggered_jsle_reg(struct bpf_test *self)
{ … }
static int bpf_fill_staggered_jeq32_imm(struct bpf_test *self)
{ … }
static int bpf_fill_staggered_jne32_imm(struct bpf_test *self)
{ … }
static int bpf_fill_staggered_jset32_imm(struct bpf_test *self)
{ … }
static int bpf_fill_staggered_jgt32_imm(struct bpf_test *self)
{ … }
static int bpf_fill_staggered_jge32_imm(struct bpf_test *self)
{ … }
static int bpf_fill_staggered_jlt32_imm(struct bpf_test *self)
{ … }
static int bpf_fill_staggered_jle32_imm(struct bpf_test *self)
{ … }
static int bpf_fill_staggered_jsgt32_imm(struct bpf_test *self)
{ … }
static int bpf_fill_staggered_jsge32_imm(struct bpf_test *self)
{ … }
static int bpf_fill_staggered_jslt32_imm(struct bpf_test *self)
{ … }
static int bpf_fill_staggered_jsle32_imm(struct bpf_test *self)
{ … }
static int bpf_fill_staggered_jeq32_reg(struct bpf_test *self)
{ … }
static int bpf_fill_staggered_jne32_reg(struct bpf_test *self)
{ … }
static int bpf_fill_staggered_jset32_reg(struct bpf_test *self)
{ … }
static int bpf_fill_staggered_jgt32_reg(struct bpf_test *self)
{ … }
static int bpf_fill_staggered_jge32_reg(struct bpf_test *self)
{ … }
static int bpf_fill_staggered_jlt32_reg(struct bpf_test *self)
{ … }
static int bpf_fill_staggered_jle32_reg(struct bpf_test *self)
{ … }
static int bpf_fill_staggered_jsgt32_reg(struct bpf_test *self)
{ … }
static int bpf_fill_staggered_jsge32_reg(struct bpf_test *self)
{ … }
static int bpf_fill_staggered_jslt32_reg(struct bpf_test *self)
{ … }
static int bpf_fill_staggered_jsle32_reg(struct bpf_test *self)
{ … }
static struct bpf_test tests[] = …;
static struct net_device dev;
static struct sk_buff *populate_skb(char *buf, int size)
{ … }
static void *generate_test_data(struct bpf_test *test, int sub)
{ … }
static void release_test_data(const struct bpf_test *test, void *data)
{ … }
static int filter_length(int which)
{ … }
static void *filter_pointer(int which)
{ … }
static struct bpf_prog *generate_filter(int which, int *err)
{ … }
static void release_filter(struct bpf_prog *fp, int which)
{ … }
static int __run_one(const struct bpf_prog *fp, const void *data,
int runs, u64 *duration)
{ … }
static int run_one(const struct bpf_prog *fp, struct bpf_test *test)
{ … }
static char test_name[64];
module_param_string(…);
static int test_id = …;
module_param(test_id, int, 0);
static int test_range[2] = …;
module_param_array(…);
static bool exclude_test(int test_id)
{ … }
static __init struct sk_buff *build_test_skb(void)
{ … }
static __init struct sk_buff *build_test_skb_linear_no_head_frag(void)
{ … }
struct skb_segment_test { … };
static struct skb_segment_test skb_segment_tests[] __initconst = …;
static __init int test_skb_segment_single(const struct skb_segment_test *test)
{ … }
static __init int test_skb_segment(void)
{ … }
static __init int test_bpf(void)
{ … }
struct tail_call_test { … };
#define FLAG_NEED_STATE …
#define FLAG_RESULT_IN_STATE …
#define TAIL_CALL_MARKER …
#define TAIL_CALL_NULL …
#define TAIL_CALL_INVALID …
#define TAIL_CALL(offset) …
BPF_CALL_1(bpf_test_func, u64, arg)
{ … }
#define BPF_FUNC_test_func …
static struct tail_call_test tail_call_tests[] = …;
static void __init destroy_tail_call_tests(struct bpf_array *progs)
{ … }
static __init int prepare_tail_call_tests(struct bpf_array **pprogs)
{ … }
static __init int test_tail_calls(struct bpf_array *progs)
{ … }
static char test_suite[32];
module_param_string(…);
static __init int find_test_index(const char *test_name)
{ … }
static __init int prepare_test_range(void)
{ … }
static int __init test_bpf_init(void)
{ … }
static void __exit test_bpf_exit(void)
{ … }
module_init(test_bpf_init);
module_exit(test_bpf_exit);
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;