Lines Matching refs:attr
25 union bpf_attr attr; in test_obj_name() local
30 ncopy = name_len < sizeof(attr.prog_name) ? in test_obj_name()
31 name_len : sizeof(attr.prog_name); in test_obj_name()
32 bzero(&attr, sizeof(attr)); in test_obj_name()
33 attr.prog_type = BPF_PROG_TYPE_SCHED_CLS; in test_obj_name()
34 attr.insn_cnt = 2; in test_obj_name()
35 attr.insns = ptr_to_u64(prog); in test_obj_name()
36 attr.license = ptr_to_u64(""); in test_obj_name()
37 memcpy(attr.prog_name, tests[i].name, ncopy); in test_obj_name()
39 fd = syscall(__NR_bpf, BPF_PROG_LOAD, &attr, sizeof(attr)); in test_obj_name()
51 ncopy = name_len < sizeof(attr.map_name) ? in test_obj_name()
52 name_len : sizeof(attr.map_name); in test_obj_name()
53 bzero(&attr, sizeof(attr)); in test_obj_name()
54 attr.map_type = BPF_MAP_TYPE_ARRAY; in test_obj_name()
55 attr.key_size = 4; in test_obj_name()
56 attr.value_size = 4; in test_obj_name()
57 attr.max_entries = 1; in test_obj_name()
58 attr.map_flags = 0; in test_obj_name()
59 memcpy(attr.map_name, tests[i].name, ncopy); in test_obj_name()
60 fd = syscall(__NR_bpf, BPF_MAP_CREATE, &attr, sizeof(attr)); in test_obj_name()