Lines Matching refs:opts

36 static int load_prog(struct bpf_prog_load_opts *opts, bool expect_load_error)  in load_prog()  argument
41 "GPL", insns, insn_cnt, opts); in load_prog()
49 LIBBPF_OPTS(bpf_prog_load_opts, opts); in verif_log_subtest()
77 opts.log_buf = logs.reference; in verif_log_subtest()
78 opts.log_size = sizeof(logs.reference); in verif_log_subtest()
79 opts.log_level = log_level | 8 /* BPF_LOG_FIXED */; in verif_log_subtest()
80 load_prog(&opts, expect_load_error); in verif_log_subtest()
100 opts.log_buf = logs.buf; in verif_log_subtest()
101 opts.log_level = log_level | 8; /* fixed-length log */ in verif_log_subtest()
102 opts.log_size = 25; in verif_log_subtest()
105 "GPL", insns, insn_cnt, &opts); in verif_log_subtest()
120 opts.log_buf = logs.buf; in verif_log_subtest()
131 opts.log_size = i; in verif_log_subtest()
132 opts.log_level = log_level | (mode ? 0 : 8 /* BPF_LOG_FIXED */); in verif_log_subtest()
137 "GPL", insns, insn_cnt, &opts); in verif_log_subtest()
178 opts.log_buf = logs.buf; in verif_log_subtest()
179 opts.log_level = log_level | 8; /* BPF_LOG_FIXED */ in verif_log_subtest()
180 opts.log_size = sizeof(logs.buf); in verif_log_subtest()
181 opts.log_true_size = 0; in verif_log_subtest()
182 res = load_prog(&opts, expect_load_error); in verif_log_subtest()
185 log_true_sz_fixed = opts.log_true_size; in verif_log_subtest()
189 opts.log_buf = NULL; in verif_log_subtest()
190 opts.log_level = log_level | 8; /* BPF_LOG_FIXED */ in verif_log_subtest()
191 opts.log_size = 0; in verif_log_subtest()
192 opts.log_true_size = 0; in verif_log_subtest()
193 res = load_prog(&opts, expect_load_error); in verif_log_subtest()
195 ASSERT_EQ(opts.log_true_size, log_true_sz_fixed, "log_sz_fixed_null_eq"); in verif_log_subtest()
198 opts.log_buf = logs.buf; in verif_log_subtest()
199 opts.log_level = log_level; in verif_log_subtest()
200 opts.log_size = sizeof(logs.buf); in verif_log_subtest()
201 opts.log_true_size = 0; in verif_log_subtest()
202 res = load_prog(&opts, expect_load_error); in verif_log_subtest()
205 log_true_sz_rolling = opts.log_true_size; in verif_log_subtest()
209 opts.log_buf = NULL; in verif_log_subtest()
210 opts.log_level = log_level; in verif_log_subtest()
211 opts.log_size = 0; in verif_log_subtest()
212 opts.log_true_size = 0; in verif_log_subtest()
213 res = load_prog(&opts, expect_load_error); in verif_log_subtest()
215 ASSERT_EQ(opts.log_true_size, log_true_sz_rolling, "log_true_sz_null_eq"); in verif_log_subtest()
218 opts.log_buf = logs.buf; in verif_log_subtest()
219 opts.log_level = log_level | 8; /* BPF_LOG_FIXED */ in verif_log_subtest()
220 opts.log_size = log_true_sz_fixed - 1; in verif_log_subtest()
221 opts.log_true_size = 0; in verif_log_subtest()
222 res = load_prog(&opts, true /* should fail */); in verif_log_subtest()
226 opts.log_buf = logs.buf; in verif_log_subtest()
227 opts.log_level = log_level | 8; /* BPF_LOG_FIXED */ in verif_log_subtest()
228 opts.log_size = log_true_sz_fixed; in verif_log_subtest()
229 opts.log_true_size = 0; in verif_log_subtest()
230 res = load_prog(&opts, expect_load_error); in verif_log_subtest()
234 opts.log_buf = logs.buf; in verif_log_subtest()
235 opts.log_level = log_level; in verif_log_subtest()
236 opts.log_size = log_true_sz_rolling - 1; in verif_log_subtest()
237 res = load_prog(&opts, true /* should fail */); in verif_log_subtest()
241 opts.log_buf = logs.buf; in verif_log_subtest()
242 opts.log_level = log_level; in verif_log_subtest()
243 opts.log_size = log_true_sz_rolling; in verif_log_subtest()
244 opts.log_true_size = 0; in verif_log_subtest()
245 res = load_prog(&opts, expect_load_error); in verif_log_subtest()
255 static int load_btf(struct bpf_btf_load_opts *opts, bool expect_err) in load_btf() argument
259 fd = bpf_btf_load(btf_data, btf_data_sz, opts); in load_btf()
271 LIBBPF_OPTS(bpf_btf_load_opts, opts); in verif_btf_log_subtest()
301 load_btf(&opts, bad_btf); in verif_btf_log_subtest()
303 opts.log_buf = logs.reference; in verif_btf_log_subtest()
304 opts.log_size = sizeof(logs.reference); in verif_btf_log_subtest()
305 opts.log_level = 1 | 8 /* BPF_LOG_FIXED */; in verif_btf_log_subtest()
306 load_btf(&opts, bad_btf); in verif_btf_log_subtest()
314 opts.log_buf = logs.buf; in verif_btf_log_subtest()
315 opts.log_level = 1 | 8; /* fixed-length log */ in verif_btf_log_subtest()
316 opts.log_size = 25; in verif_btf_log_subtest()
317 res = load_btf(&opts, true); in verif_btf_log_subtest()
325 opts.log_buf = logs.buf; in verif_btf_log_subtest()
326 opts.log_level = 1; /* rolling log */ in verif_btf_log_subtest()
335 opts.log_size = i; in verif_btf_log_subtest()
338 res = load_btf(&opts, true); in verif_btf_log_subtest()
362 opts.log_buf = logs.buf; in verif_btf_log_subtest()
363 opts.log_level = 1 | 8; /* BPF_LOG_FIXED */ in verif_btf_log_subtest()
364 opts.log_size = sizeof(logs.buf); in verif_btf_log_subtest()
365 opts.log_true_size = 0; in verif_btf_log_subtest()
366 res = load_btf(&opts, bad_btf); in verif_btf_log_subtest()
369 log_true_sz_fixed = opts.log_true_size; in verif_btf_log_subtest()
373 opts.log_buf = NULL; in verif_btf_log_subtest()
374 opts.log_level = 1 | 8; /* BPF_LOG_FIXED */ in verif_btf_log_subtest()
375 opts.log_size = 0; in verif_btf_log_subtest()
376 opts.log_true_size = 0; in verif_btf_log_subtest()
377 res = load_btf(&opts, bad_btf); in verif_btf_log_subtest()
379 ASSERT_EQ(opts.log_true_size, log_true_sz_fixed, "log_sz_fixed_null_eq"); in verif_btf_log_subtest()
382 opts.log_buf = logs.buf; in verif_btf_log_subtest()
383 opts.log_level = 1; in verif_btf_log_subtest()
384 opts.log_size = sizeof(logs.buf); in verif_btf_log_subtest()
385 opts.log_true_size = 0; in verif_btf_log_subtest()
386 res = load_btf(&opts, bad_btf); in verif_btf_log_subtest()
389 log_true_sz_rolling = opts.log_true_size; in verif_btf_log_subtest()
393 opts.log_buf = NULL; in verif_btf_log_subtest()
394 opts.log_level = 1; in verif_btf_log_subtest()
395 opts.log_size = 0; in verif_btf_log_subtest()
396 opts.log_true_size = 0; in verif_btf_log_subtest()
397 res = load_btf(&opts, bad_btf); in verif_btf_log_subtest()
399 ASSERT_EQ(opts.log_true_size, log_true_sz_rolling, "log_true_sz_null_eq"); in verif_btf_log_subtest()
402 opts.log_buf = logs.buf; in verif_btf_log_subtest()
403 opts.log_level = 1 | 8; /* BPF_LOG_FIXED */ in verif_btf_log_subtest()
404 opts.log_size = log_true_sz_fixed - 1; in verif_btf_log_subtest()
405 opts.log_true_size = 0; in verif_btf_log_subtest()
406 res = load_btf(&opts, true); in verif_btf_log_subtest()
410 opts.log_buf = logs.buf; in verif_btf_log_subtest()
411 opts.log_level = 1 | 8; /* BPF_LOG_FIXED */ in verif_btf_log_subtest()
412 opts.log_size = log_true_sz_fixed; in verif_btf_log_subtest()
413 opts.log_true_size = 0; in verif_btf_log_subtest()
414 res = load_btf(&opts, bad_btf); in verif_btf_log_subtest()
418 opts.log_buf = logs.buf; in verif_btf_log_subtest()
419 opts.log_level = 1; in verif_btf_log_subtest()
420 opts.log_size = log_true_sz_rolling - 1; in verif_btf_log_subtest()
421 res = load_btf(&opts, true); in verif_btf_log_subtest()
425 opts.log_buf = logs.buf; in verif_btf_log_subtest()
426 opts.log_level = 1; in verif_btf_log_subtest()
427 opts.log_size = log_true_sz_rolling; in verif_btf_log_subtest()
428 opts.log_true_size = 0; in verif_btf_log_subtest()
429 res = load_btf(&opts, bad_btf); in verif_btf_log_subtest()