Lines Matching refs:i
24 __u32 i, next_id, info_len, nr_id_found, duration = 0; in test_bpf_obj_id() local
39 for (i = 0; i < nr_iters; i++) in test_bpf_obj_id()
40 objs[i] = NULL; in test_bpf_obj_id()
44 for (i = 0; i < nr_iters; i++) { in test_bpf_obj_id()
47 &objs[i], &prog_fds[i]); in test_bpf_obj_id()
55 map_fds[i] = bpf_find_map(__func__, objs[i], "test_map_id"); in test_bpf_obj_id()
56 if (CHECK_FAIL(map_fds[i] < 0)) in test_bpf_obj_id()
58 err = bpf_map_update_elem(map_fds[i], &array_key, in test_bpf_obj_id()
65 bzero(&map_infos[i], info_len); in test_bpf_obj_id()
66 err = bpf_obj_get_info_by_fd(map_fds[i], &map_infos[i], in test_bpf_obj_id()
69 map_infos[i].type != BPF_MAP_TYPE_ARRAY || in test_bpf_obj_id()
70 map_infos[i].key_size != sizeof(__u32) || in test_bpf_obj_id()
71 map_infos[i].value_size != sizeof(__u64) || in test_bpf_obj_id()
72 map_infos[i].max_entries != 1 || in test_bpf_obj_id()
73 map_infos[i].map_flags != 0 || in test_bpf_obj_id()
75 strcmp((char *)map_infos[i].name, expected_map_name), in test_bpf_obj_id()
79 map_infos[i].type, BPF_MAP_TYPE_ARRAY, in test_bpf_obj_id()
81 map_infos[i].key_size, in test_bpf_obj_id()
82 map_infos[i].value_size, in test_bpf_obj_id()
83 map_infos[i].max_entries, in test_bpf_obj_id()
84 map_infos[i].map_flags, in test_bpf_obj_id()
85 map_infos[i].name, expected_map_name)) in test_bpf_obj_id()
90 bzero(&prog_infos[i], info_len); in test_bpf_obj_id()
93 prog_infos[i].jited_prog_insns = ptr_to_u64(jited_insns); in test_bpf_obj_id()
94 prog_infos[i].jited_prog_len = sizeof(jited_insns); in test_bpf_obj_id()
95 prog_infos[i].xlated_prog_insns = ptr_to_u64(xlated_insns); in test_bpf_obj_id()
96 prog_infos[i].xlated_prog_len = sizeof(xlated_insns); in test_bpf_obj_id()
97 prog_infos[i].map_ids = ptr_to_u64(map_ids + i); in test_bpf_obj_id()
98 prog_infos[i].nr_map_ids = 2; in test_bpf_obj_id()
105 err = bpf_obj_get_info_by_fd(prog_fds[i], &prog_infos[i], in test_bpf_obj_id()
108 + (prog_infos[i].load_time / nsec_per_sec); in test_bpf_obj_id()
110 prog_infos[i].type != BPF_PROG_TYPE_SOCKET_FILTER || in test_bpf_obj_id()
112 (env.jit_enabled && !prog_infos[i].jited_prog_len) || in test_bpf_obj_id()
115 !prog_infos[i].xlated_prog_len || in test_bpf_obj_id()
118 prog_infos[i].created_by_uid != my_uid || in test_bpf_obj_id()
119 prog_infos[i].nr_map_ids != 1 || in test_bpf_obj_id()
120 *(int *)(long)prog_infos[i].map_ids != map_infos[i].id || in test_bpf_obj_id()
121 strcmp((char *)prog_infos[i].name, expected_prog_name), in test_bpf_obj_id()
124 err, errno, i, in test_bpf_obj_id()
125 prog_infos[i].type, BPF_PROG_TYPE_SOCKET_FILTER, in test_bpf_obj_id()
128 prog_infos[i].jited_prog_len, in test_bpf_obj_id()
129 prog_infos[i].xlated_prog_len, in test_bpf_obj_id()
133 prog_infos[i].created_by_uid, my_uid, in test_bpf_obj_id()
134 prog_infos[i].nr_map_ids, 1, in test_bpf_obj_id()
135 *(int *)(long)prog_infos[i].map_ids, map_infos[i].id, in test_bpf_obj_id()
136 prog_infos[i].name, expected_prog_name)) in test_bpf_obj_id()
159 for (i = 0; i < nr_iters; i++) in test_bpf_obj_id()
160 if (prog_infos[i].id == next_id) in test_bpf_obj_id()
163 if (i == nr_iters) in test_bpf_obj_id()
181 saved_map_id = *(int *)((long)prog_infos[i].map_ids); in test_bpf_obj_id()
182 prog_info.map_ids = prog_infos[i].map_ids; in test_bpf_obj_id()
185 prog_infos[i].jited_prog_insns = 0; in test_bpf_obj_id()
186 prog_infos[i].xlated_prog_insns = 0; in test_bpf_obj_id()
188 memcmp(&prog_info, &prog_infos[i], info_len) || in test_bpf_obj_id()
193 memcmp(&prog_info, &prog_infos[i], info_len), in test_bpf_obj_id()
220 for (i = 0; i < nr_iters; i++) in test_bpf_obj_id()
221 if (map_infos[i].id == next_id) in test_bpf_obj_id()
224 if (i == nr_iters) in test_bpf_obj_id()
235 memcmp(&map_info, &map_infos[i], info_len) || in test_bpf_obj_id()
240 memcmp(&map_info, &map_infos[i], info_len), in test_bpf_obj_id()
251 for (i = 0; i < nr_iters; i++) in test_bpf_obj_id()
252 bpf_object__close(objs[i]); in test_bpf_obj_id()