Lines Matching refs:hook

25 static int test_tc_bpf_basic(const struct bpf_tc_hook *hook, int fd)  in test_tc_bpf_basic()  argument
36 ret = bpf_tc_attach(hook, &opts); in test_tc_bpf_basic()
47 ret = bpf_tc_attach(hook, &opts); in test_tc_bpf_basic()
52 ret = bpf_tc_query(hook, &opts); in test_tc_bpf_basic()
63 ret = bpf_tc_detach(hook, &opts); in test_tc_bpf_basic()
68 static int test_tc_bpf_api(struct bpf_tc_hook *hook, int fd) in test_tc_bpf_api() argument
208 ret = bpf_tc_detach(hook, NULL); in test_tc_bpf_api()
212 ret = bpf_tc_detach(hook, &opts_hpr); in test_tc_bpf_api()
216 ret = bpf_tc_detach(hook, &opts_hpf); in test_tc_bpf_api()
220 ret = bpf_tc_detach(hook, &opts_hpi); in test_tc_bpf_api()
224 ret = bpf_tc_detach(hook, &opts_p); in test_tc_bpf_api()
228 ret = bpf_tc_detach(hook, &opts_h); in test_tc_bpf_api()
232 ret = bpf_tc_detach(hook, &opts_prio_max); in test_tc_bpf_api()
245 ret = bpf_tc_query(hook, NULL); in test_tc_bpf_api()
249 ret = bpf_tc_query(hook, &opts_hpr); in test_tc_bpf_api()
253 ret = bpf_tc_query(hook, &opts_hpf); in test_tc_bpf_api()
257 ret = bpf_tc_query(hook, &opts_hpi); in test_tc_bpf_api()
261 ret = bpf_tc_query(hook, &opts_p); in test_tc_bpf_api()
265 ret = bpf_tc_query(hook, &opts_h); in test_tc_bpf_api()
269 ret = bpf_tc_query(hook, &opts_prio_max); in test_tc_bpf_api()
274 ret = bpf_tc_query(hook, &opts_hp); in test_tc_bpf_api()
287 ret = bpf_tc_attach(hook, NULL); in test_tc_bpf_api()
292 ret = bpf_tc_attach(hook, &opts_hp); in test_tc_bpf_api()
296 ret = bpf_tc_attach(hook, NULL); in test_tc_bpf_api()
300 ret = bpf_tc_attach(hook, &opts_hpi); in test_tc_bpf_api()
304 ret = bpf_tc_attach(hook, &opts_pf); in test_tc_bpf_api()
308 ASSERT_OK(bpf_tc_detach(hook, &opts_pf), "bpf_tc_detach"); in test_tc_bpf_api()
310 ret = bpf_tc_attach(hook, &opts_hf); in test_tc_bpf_api()
314 ASSERT_OK(bpf_tc_detach(hook, &opts_hf), "bpf_tc_detach"); in test_tc_bpf_api()
316 ret = bpf_tc_attach(hook, &opts_prio_max); in test_tc_bpf_api()
320 ret = bpf_tc_attach(hook, &opts_f); in test_tc_bpf_api()
324 ASSERT_OK(bpf_tc_detach(hook, &opts_f), "bpf_tc_detach"); in test_tc_bpf_api()
332 DECLARE_LIBBPF_OPTS(bpf_tc_hook, hook, .ifindex = LO_IFINDEX, in test_tc_bpf()
344 ret = bpf_tc_hook_create(&hook); in test_tc_bpf()
352 hook.attach_point = BPF_TC_CUSTOM; in test_tc_bpf()
353 hook.parent = TC_H_MAKE(TC_H_CLSACT, TC_H_MIN_INGRESS); in test_tc_bpf()
354 ret = bpf_tc_hook_create(&hook); in test_tc_bpf()
358 ret = test_tc_bpf_basic(&hook, cls_fd); in test_tc_bpf()
362 ret = bpf_tc_hook_destroy(&hook); in test_tc_bpf()
366 hook.attach_point = BPF_TC_INGRESS; in test_tc_bpf()
367 hook.parent = 0; in test_tc_bpf()
368 bpf_tc_hook_destroy(&hook); in test_tc_bpf()
370 ret = test_tc_bpf_basic(&hook, cls_fd); in test_tc_bpf()
374 bpf_tc_hook_destroy(&hook); in test_tc_bpf()
376 hook.attach_point = BPF_TC_EGRESS; in test_tc_bpf()
377 ret = test_tc_bpf_basic(&hook, cls_fd); in test_tc_bpf()
381 bpf_tc_hook_destroy(&hook); in test_tc_bpf()
383 ret = test_tc_bpf_api(&hook, cls_fd); in test_tc_bpf()
387 bpf_tc_hook_destroy(&hook); in test_tc_bpf()
391 hook.attach_point = BPF_TC_INGRESS | BPF_TC_EGRESS; in test_tc_bpf()
392 bpf_tc_hook_destroy(&hook); in test_tc_bpf()