Home
last modified time | relevance | path

Searched refs:attach_type (Results 1 – 25 of 36) sorted by relevance

12

/linux/tools/testing/selftests/bpf/prog_tests/
H A Dsockopt.c28 enum bpf_attach_type attach_type; member
56 .attach_type = BPF_CGROUP_GETSOCKOPT,
68 .attach_type = BPF_CGROUP_GETSOCKOPT,
79 .attach_type = BPF_CGROUP_GETSOCKOPT,
100 .attach_type = BPF_CGROUP_GETSOCKOPT,
124 .attach_type = BPF_CGROUP_GETSOCKOPT,
150 .attach_type = BPF_CGROUP_GETSOCKOPT,
166 .attach_type = BPF_CGROUP_GETSOCKOPT,
193 .attach_type = BPF_CGROUP_GETSOCKOPT,
211 .attach_type = BPF_CGROUP_GETSOCKOPT,
[all …]
H A Dsection_names.c16 enum bpf_attach_type attach_type; member
234 enum bpf_attach_type attach_type; in test_attach_type_by_name() local
237 rc = libbpf_attach_type_by_name(test->sec_name, &attach_type); in test_attach_type_by_name()
245 CHECK(attach_type != test->expected_attach.attach_type, in test_attach_type_by_name()
247 attach_type, test->sec_name); in test_attach_type_by_name()
H A Dcg_storage_multi.c96 key.attach_type = BPF_CGROUP_INET_EGRESS; in test_egress_only()
196 key.attach_type = BPF_CGROUP_INET_EGRESS; in test_isolated()
201 key.attach_type = BPF_CGROUP_INET_INGRESS; in test_isolated()
207 key.attach_type = BPF_CGROUP_INET_EGRESS; in test_isolated()
210 key.attach_type = BPF_CGROUP_INET_INGRESS; in test_isolated()
238 key.attach_type = BPF_CGROUP_INET_EGRESS; in test_isolated()
243 key.attach_type = BPF_CGROUP_INET_INGRESS; in test_isolated()
249 key.attach_type = BPF_CGROUP_INET_EGRESS; in test_isolated()
254 key.attach_type = BPF_CGROUP_INET_INGRESS; in test_isolated()
H A Dlibbpf_str.c40 enum bpf_attach_type attach_type = (enum bpf_attach_type)e->val; in test_libbpf_bpf_attach_type_str() local
45 if (attach_type == __MAX_BPF_ATTACH_TYPE) in test_libbpf_bpf_attach_type_str()
49 attach_type_str = libbpf_bpf_attach_type_str(attach_type); in test_libbpf_bpf_attach_type_str()
H A Dbpf_verif_scale.c49 enum bpf_prog_type attach_type, in scale_test() argument
60 err = check_load(file, attach_type); in scale_test()
H A Dsockmap_basic.c442 static void test_sockmap_progs_query(enum bpf_attach_type attach_type) in test_sockmap_progs_query() argument
456 if (attach_type == BPF_SK_MSG_VERDICT) in test_sockmap_progs_query()
461 err = bpf_prog_query(map_fd, attach_type, 0 /* query flags */, in test_sockmap_progs_query()
467 err = bpf_prog_attach(verdict_fd, map_fd, attach_type, 0); in test_sockmap_progs_query()
472 err = bpf_prog_query(map_fd, attach_type, 0 /* query flags */, in test_sockmap_progs_query()
480 bpf_prog_detach2(verdict_fd, map_fd, attach_type); in test_sockmap_progs_query()
/linux/tools/testing/selftests/bpf/
H A Dtest_sysctl.c32 enum bpf_attach_type attach_type; member
53 .attach_type = 0,
64 .attach_type = BPF_CGROUP_SYSCTL,
75 .attach_type = BPF_CGROUP_SYSCTL,
96 .attach_type = BPF_CGROUP_SYSCTL,
117 .attach_type = BPF_CGROUP_SYSCTL,
140 .attach_type = BPF_CGROUP_SYSCTL,
156 .attach_type = BPF_CGROUP_SYSCTL,
177 .attach_type = BPF_CGROUP_SYSCTL,
204 .attach_type = BPF_CGROUP_SYSCTL,
[all …]
H A Dveristat.c1012 enum bpf_attach_type *attach_type) in guess_prog_type_by_ctx_name() argument
1026 enum bpf_attach_type attach_type; in guess_prog_type_by_ctx_name() member
1057 *attach_type = ctx_map[i].attach_type; in guess_prog_type_by_ctx_name()
1133 enum bpf_attach_type attach_type; in fixup_obj() local
1161 if (guess_prog_type_by_ctx_name(ctx_name, &prog_type, &attach_type) == 0) { in fixup_obj()
1163 bpf_program__set_expected_attach_type(prog, attach_type); in fixup_obj()
1750 enum bpf_attach_type attach_type = 0; in parse_stat_value() local
1753 while ((type = libbpf_bpf_attach_type_str(attach_type))) { in parse_stat_value()
1755 st->stats[id] = attach_type; in parse_stat_value()
1758 attach_type++; in parse_stat_value()
/linux/tools/bpf/bpftool/
H A Dnet.c637 static int do_attach_detach_xdp(int progfd, enum net_attach_type attach_type, in do_attach_detach_xdp() argument
644 if (attach_type == NET_ATTACH_TYPE_XDP_GENERIC) in do_attach_detach_xdp()
646 if (attach_type == NET_ATTACH_TYPE_XDP_DRIVER) in do_attach_detach_xdp()
648 if (attach_type == NET_ATTACH_TYPE_XDP_OFFLOAD) in do_attach_detach_xdp()
654 static int get_tcx_type(enum net_attach_type attach_type) in get_tcx_type() argument
656 switch (attach_type) { in get_tcx_type()
666 static int do_attach_tcx(int progfd, enum net_attach_type attach_type, int ifindex) in do_attach_tcx() argument
668 int type = get_tcx_type(attach_type); in do_attach_tcx()
673 static int do_detach_tcx(int targetfd, enum net_attach_type attach_type) in do_detach_tcx() argument
675 int type = get_tcx_type(attach_type); in do_detach_tcx()
[all …]
H A Dcgroup.c130 static int show_bpf_prog(int id, enum bpf_attach_type attach_type, in show_bpf_prog() argument
150 attach_type_str = libbpf_bpf_attach_type_str(attach_type); in show_bpf_prog()
172 jsonw_uint_field(json_wtr, "attach_type", attach_type); in show_bpf_prog()
186 printf("type %-10u", attach_type); in show_bpf_prog()
546 enum bpf_attach_type attach_type; in do_attach() local
563 attach_type = parse_attach_type(argv[1]); in do_attach()
564 if (attach_type == __MAX_BPF_ATTACH_TYPE) { in do_attach()
586 if (bpf_prog_attach(prog_fd, cgroup_fd, attach_type, attach_flags)) { in do_attach()
606 enum bpf_attach_type attach_type; in do_detach() local
621 attach_type = parse_attach_type(argv[1]); in do_detach()
[all …]
H A Dlink.c142 static void show_link_attach_type_json(__u32 attach_type, json_writer_t *wtr) in show_link_attach_type_json() argument
146 attach_type_str = libbpf_bpf_attach_type_str(attach_type); in show_link_attach_type_json()
150 jsonw_uint_field(wtr, "attach_type", attach_type); in show_link_attach_type_json()
500 show_link_attach_type_json(info->tracing.attach_type, in show_link_close_json()
508 show_link_attach_type_json(info->cgroup.attach_type, json_wtr); in show_link_close_json()
516 show_link_attach_type_json(info->netns.attach_type, json_wtr); in show_link_close_json()
523 show_link_attach_type_json(info->tcx.attach_type, json_wtr); in show_link_close_json()
527 show_link_attach_type_json(info->netkit.attach_type, json_wtr); in show_link_close_json()
531 show_link_attach_type_json(info->sockmap.attach_type, json_wtr); in show_link_close_json()
604 static void show_link_attach_type_plain(__u32 attach_type) in show_link_attach_type_plain() argument
[all …]
H A Dprog.c1040 enum bpf_attach_type *attach_type, in parse_attach_detach_args() argument
1050 *attach_type = parse_attach_type(*argv); in parse_attach_detach_args()
1051 if (*attach_type == __MAX_BPF_ATTACH_TYPE) { in parse_attach_detach_args()
1056 if (*attach_type == BPF_FLOW_DISSECTOR) { in parse_attach_detach_args()
1074 enum bpf_attach_type attach_type; in do_attach() local
1079 &progfd, &attach_type, &mapfd); in do_attach()
1083 err = bpf_prog_attach(progfd, mapfd, attach_type, 0); in do_attach()
1096 enum bpf_attach_type attach_type; in do_detach() local
1101 &progfd, &attach_type, &mapfd); in do_detach()
1105 err = bpf_prog_detach2(progfd, mapfd, attach_type); in do_detach()
/linux/include/linux/
H A Dbpf-netns.h10 to_netns_bpf_attach_type(enum bpf_attach_type attach_type) in to_netns_bpf_attach_type() argument
12 switch (attach_type) { in to_netns_bpf_attach_type()
/linux/kernel/bpf/
H A Dlocal_storage.c50 else if (key1->attach_type < key2->attach_type) in bpf_cgroup_storage_key_cmp()
52 else if (key1->attach_type > key2->attach_type) in bpf_cgroup_storage_key_cmp()
392 offset = offsetof(struct bpf_cgroup_storage_key, attach_type); in cgroup_storage_check_btf()
393 size = sizeof_field(struct bpf_cgroup_storage_key, attach_type); in cgroup_storage_check_btf()
583 storage->key.attach_type = type; in bpf_cgroup_storage_link()
H A Dtcx.c12 bool created, ingress = attr->attach_type == BPF_TCX_INGRESS; in tcx_prog_attach()
61 bool ingress = attr->attach_type == BPF_TCX_INGRESS; in tcx_prog_detach()
124 bool ingress = attr->query.attach_type == BPF_TCX_INGRESS; in tcx_prog_query()
279 info->tcx.attach_type = tcx->location; in tcx_link_fill_info()
305 tcx->location = attr->link_create.attach_type; in tcx_link_init()
H A Dnet_namespace.c219 info->netns.attach_type = net_link->type; in bpf_netns_link_fill_info()
233 info.netns.attach_type); in bpf_netns_link_show_fdinfo()
281 type = to_netns_bpf_attach_type(attr->query.attach_type); in netns_bpf_prog_query()
308 type = to_netns_bpf_attach_type(attr->attach_type); in netns_bpf_prog_attach()
392 type = to_netns_bpf_attach_type(attr->attach_type); in netns_bpf_prog_detach()
489 type = attr->link_create.attach_type; in netns_bpf_link_create()
H A Dsyscall.c2505 enum bpf_prog_type *attach_type, bool attach_drv) in bpf_prog_get_ok() argument
2508 if (!attach_type) in bpf_prog_get_ok()
2511 if (prog->type != *attach_type) in bpf_prog_get_ok()
2519 static struct bpf_prog *__bpf_prog_get(u32 ufd, enum bpf_prog_type *attach_type, in __bpf_prog_get() argument
2531 if (!bpf_prog_get_ok(prog, attach_type, attach_drv)) in __bpf_prog_get()
3387 tr_link->attach_type, in bpf_tracing_link_show_fdinfo()
3398 info->tracing.attach_type = tr_link->attach_type; in bpf_tracing_link_fill_link_info()
3485 link->attach_type = prog->expected_attach_type; in bpf_tracing_prog_attach()
4024 attach_type_to_prog_type(enum bpf_attach_type attach_type) in attach_type_to_prog_type() argument
4026 switch (attach_type) { in attach_type_to_prog_type()
[all …]
H A Dtoken.c248 enum bpf_attach_type attach_type) in bpf_token_allow_prog_type() argument
250 if (!token || prog_type >= __MAX_BPF_PROG_TYPE || attach_type >= __MAX_BPF_ATTACH_TYPE) in bpf_token_allow_prog_type()
254 (token->allowed_attachs & BIT_ULL(attach_type)); in bpf_token_allow_prog_type()
/linux/net/core/
H A Dsock_map.c81 ret = sock_map_prog_update(map, prog, NULL, NULL, attr->attach_type); in sock_map_get_from_fd()
110 ret = sock_map_prog_update(map, NULL, prog, NULL, attr->attach_type); in sock_map_prog_detach()
1576 ret = sock_map_prog_link_lookup(map, &pprog, NULL, attr->query.attach_type); in sock_map_bpf_prog_query()
1712 enum bpf_attach_type attach_type; member
1724 sockmap_link->attach_type)); in sock_map_link_release()
1775 sockmap_link->attach_type); in sock_map_link_update_prog()
1820 info->sockmap.attach_type = sockmap_link->attach_type; in sock_map_link_fill_info()
1831 seq_printf(seq, "attach_type:\t%u\n", sockmap_link->attach_type); in sock_map_link_show_fdinfo()
1847 enum bpf_attach_type attach_type; in sock_map_link_create() local
1868 attach_type = attr->link_create.attach_type; in sock_map_link_create()
[all …]
/linux/include/uapi/linux/
H A Dbpf.h110 __u32 attach_type; /* program attach type (enum bpf_attach_type) */ member
1607 __u32 attach_type; member
1664 __u32 attach_type; member
1732 __u32 attach_type; /* attach type */ member
6641 __u32 attach_type; member
6647 __u32 attach_type; member
6675 __u32 attach_type; member
6740 __u32 attach_type; member
6744 __u32 attach_type; member
6748 __u32 attach_type; member
/linux/tools/include/uapi/linux/
H A Dbpf.h110 __u32 attach_type; /* program attach type (enum bpf_attach_type) */ member
1607 __u32 attach_type; member
1664 __u32 attach_type; member
1732 __u32 attach_type; /* attach type */ member
6641 __u32 attach_type; member
6647 __u32 attach_type; member
6675 __u32 attach_type; member
6740 __u32 attach_type; member
6744 __u32 attach_type; member
6748 __u32 attach_type; member
/linux/tools/lib/bpf/
H A Dskel_internal.h290 enum bpf_attach_type attach_type) in skel_link_create() argument
298 attr.link_create.attach_type = attach_type; in skel_link_create()
/linux/tools/bpf/bpftool/Documentation/
H A Dbpftool-link.rst81 cgroup_id 614 attach_type egress
92 "attach_type": "egress",
/linux/drivers/net/
H A Dnetkit.c534 attr->attach_type); in netkit_prog_attach()
574 attr->attach_type); in netkit_prog_detach()
606 attr->query.attach_type); in netkit_prog_query()
749 info->netkit.attach_type = nkl->location; in netkit_link_fill_info()
776 nkl->location = attr->link_create.attach_type; in netkit_link_init()
791 attr->link_create.attach_type); in netkit_link_attach()
/linux/Documentation/bpf/
H A Dmap_cgroup_storage.rst30 __u32 attach_type;
34 ``attach_type`` is the program's attach type.
84 .attach_type = type,

12