BPF_TCX_INGRESS
case BPF_TCX_INGRESS:
if (attach_type != BPF_TCX_INGRESS &&
if (attr->attach_type == BPF_TCX_INGRESS ||
if (attr->attach_type == BPF_TCX_INGRESS ||
case BPF_TCX_INGRESS:
if (attr->link_create.attach_type == BPF_TCX_INGRESS ||
bool created, ingress = attr->attach_type == BPF_TCX_INGRESS;
bool ingress = attr->query.attach_type == BPF_TCX_INGRESS;
bool created, ingress = link->attach_type == BPF_TCX_INGRESS;
bool ingress = link->attach_type == BPF_TCX_INGRESS;
bool ingress = link->attach_type == BPF_TCX_INGRESS;
link->attach_type == BPF_TCX_INGRESS ? "ingress" : "egress");
bool ingress = attr->attach_type == BPF_TCX_INGRESS;
__show_dev_tc_bpf(dev, BPF_TCX_INGRESS);
return BPF_TCX_INGRESS;
[BPF_TCX_INGRESS] = "tcx/ingress",
case BPF_TCX_INGRESS:
[BPF_TCX_INGRESS] = "tcx_ingress",
SEC_DEF("tc/ingress", SCHED_CLS, BPF_TCX_INGRESS, SEC_NONE), /* alias for tcx */
SEC_DEF("tcx/ingress", SCHED_CLS, BPF_TCX_INGRESS, SEC_NONE),
err = bpf_prog_attach_opts(tc_fd, loopback, BPF_TCX_INGRESS, &opta);
err = bpf_prog_detach_opts(tc_fd, loopback, BPF_TCX_INGRESS, &optd);
assert_mprog_count(BPF_TCX_INGRESS, 0);
test_tc_links_invalid_target(BPF_TCX_INGRESS);
test_tc_links_prepend_target(BPF_TCX_INGRESS);
test_tc_links_append_target(BPF_TCX_INGRESS);
test_tc_links_dev_cleanup_target(BPF_TCX_INGRESS);
tc_hook.attach_point = target == BPF_TCX_INGRESS ?
test_tc_chain_mixed(BPF_TCX_INGRESS);
test_tc_links_ingress(BPF_TCX_INGRESS, true, true);
test_tc_links_ingress(BPF_TCX_INGRESS, true, false);
test_tc_links_ingress(BPF_TCX_INGRESS, false, false);
tc_hook.attach_point = target == BPF_TCX_INGRESS ?
test_tc_links_dev_mixed(BPF_TCX_INGRESS);
test_tc_links_before_target(BPF_TCX_INGRESS);
assert_mprog_count(BPF_TCX_INGRESS, 0);
test_tc_links_after_target(BPF_TCX_INGRESS);
assert_mprog_count(BPF_TCX_INGRESS, 1);
test_tc_links_revision_target(BPF_TCX_INGRESS);
tc_hook.attach_point = target == BPF_TCX_INGRESS ?
err = bpf_prog_query_opts(loopback, BPF_TCX_INGRESS, &optq);
test_tc_chain_classic(BPF_TCX_INGRESS, false);
test_tc_chain_classic(BPF_TCX_INGRESS, true);
assert_mprog_count(BPF_TCX_INGRESS, 1);
test_tc_links_replace_target(BPF_TCX_INGRESS);
BPF_TCX_INGRESS), 0, "tc7_attach_type");
assert_mprog_count_ifindex(ifindex2, BPF_TCX_INGRESS, 0);
assert_mprog_count_ifindex(ifindex2, BPF_TCX_INGRESS, 0);
assert_mprog_count_ifindex(ifindex2, BPF_TCX_INGRESS, 1);
err = bpf_prog_detach_opts(fd1, loopback, BPF_TCX_INGRESS, &optd);
test_tc_opts_invalid_target(BPF_TCX_INGRESS);
assert_mprog_count(BPF_TCX_INGRESS, 0);
test_tc_opts_prepend_target(BPF_TCX_INGRESS);
test_tc_opts_append_target(BPF_TCX_INGRESS);
test_tc_opts_dev_cleanup_target(BPF_TCX_INGRESS);
test_tc_opts_mixed_target(BPF_TCX_INGRESS);
test_tc_opts_demixed_target(BPF_TCX_INGRESS);
test_tc_opts_detach_target(BPF_TCX_INGRESS);
test_tc_opts_detach_before_target(BPF_TCX_INGRESS);
test_tc_opts_detach_after_target(BPF_TCX_INGRESS);
tc_hook.attach_point = target == BPF_TCX_INGRESS ?
test_tc_opts_delete_empty(BPF_TCX_INGRESS, false);
test_tc_opts_delete_empty(BPF_TCX_INGRESS, true);
tc_hook.attach_point = target == BPF_TCX_INGRESS ?
test_tc_chain_mixed(BPF_TCX_INGRESS);
test_tc_opts_max_target(BPF_TCX_INGRESS, 0, false);
test_tc_opts_max_target(BPF_TCX_INGRESS, BPF_F_BEFORE, false);
test_tc_opts_max_target(BPF_TCX_INGRESS, BPF_F_AFTER, true);
test_tc_opts_before_target(BPF_TCX_INGRESS);
test_tc_opts_query_target(BPF_TCX_INGRESS);
test_tc_opts_query_attach_target(BPF_TCX_INGRESS);
assert_mprog_count(BPF_TCX_INGRESS, 0);
err = bpf_prog_attach_opts(fd1, loopback, BPF_TCX_INGRESS, &opta);
assert_mprog_count(BPF_TCX_INGRESS, 1);
test_tc_opts_after_target(BPF_TCX_INGRESS);
err = bpf_prog_query_opts(loopback, BPF_TCX_INGRESS, &optq);
test_tc_opts_revision_target(BPF_TCX_INGRESS);
tc_hook.attach_point = target == BPF_TCX_INGRESS ?
test_tc_chain_classic(BPF_TCX_INGRESS, false);
test_tc_chain_classic(BPF_TCX_INGRESS, true);
assert_mprog_count(BPF_TCX_INGRESS, 1);
test_tc_opts_replace_target(BPF_TCX_INGRESS);
assert_mprog_count(BPF_TCX_INGRESS, 1);