| /linux/tools/testing/selftests/bpf/prog_tests/ |
| H A D | sockopt.c | 29 enum bpf_attach_type attach_type; member 57 .attach_type = BPF_CGROUP_GETSOCKOPT, 69 .attach_type = BPF_CGROUP_GETSOCKOPT, 80 .attach_type = BPF_CGROUP_GETSOCKOPT, 101 .attach_type = BPF_CGROUP_GETSOCKOPT, 125 .attach_type = BPF_CGROUP_GETSOCKOPT, 151 .attach_type = BPF_CGROUP_GETSOCKOPT, 167 .attach_type = BPF_CGROUP_GETSOCKOPT, 194 .attach_type = BPF_CGROUP_GETSOCKOPT, 212 .attach_type = BPF_CGROUP_GETSOCKOPT, [all …]
|
| H A D | test_sysctl.c | 18 enum bpf_attach_type attach_type; member 40 .attach_type = 0, 51 .attach_type = BPF_CGROUP_SYSCTL, 62 .attach_type = BPF_CGROUP_SYSCTL, 83 .attach_type = BPF_CGROUP_SYSCTL, 104 .attach_type = BPF_CGROUP_SYSCTL, 127 .attach_type = BPF_CGROUP_SYSCTL, 143 .attach_type = BPF_CGROUP_SYSCTL, 164 .attach_type = BPF_CGROUP_SYSCTL, 191 .attach_type = BPF_CGROUP_SYSCTL, [all …]
|
| H A D | section_names.c | 16 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 D | cg_storage_multi.c | 96 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 D | libbpf_str.c | 40 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 D | bpf_verif_scale.c | 49 enum bpf_prog_type attach_type, in scale_test() argument 60 err = check_load(file, attach_type); in scale_test()
|
| H A D | sock_addr.c | 63 enum bpf_attach_type attach_type, 354 enum bpf_attach_type attach_type; member 378 enum bpf_attach_type attach_type, \ 390 if (bpf_prog_attach(prog_fd, cgroup_fd, attach_type, \ 399 bpf_prog_detach(cgroup_fd, attach_type); \ 410 enum bpf_attach_type attach_type, \ 417 attach_type), \ 2612 skel = test->loadfn(cgroup_fd, test->attach_type, in test_sock_addr()
|
| H A D | fill_link_info.c | 474 enum bpf_attach_type attach_type = bpf_program__expected_attach_type(prog); in verify_tracing_multi_link_info() local 489 ASSERT_EQ(info.tracing_multi.attach_type, attach_type, "info.tracing_multi.attach_type"); in verify_tracing_multi_link_info() 508 ASSERT_EQ(info.tracing_multi.attach_type, attach_type, "info.tracing_multi.attach_type"); in verify_tracing_multi_link_info()
|
| H A D | flow_dissector_reattach.c | 512 CHECK_FAIL(info.netns.attach_type != BPF_FLOW_DISSECTOR); in test_link_get_info() 536 CHECK_FAIL(info.netns.attach_type != BPF_FLOW_DISSECTOR); in test_link_get_info() 561 CHECK_FAIL(info.netns.attach_type != BPF_FLOW_DISSECTOR); in test_link_get_info()
|
| /linux/tools/bpf/bpftool/ |
| H A D | net.c | 643 static int do_attach_detach_xdp(int progfd, enum net_attach_type attach_type, in do_attach_detach_xdp() argument 650 if (attach_type == NET_ATTACH_TYPE_XDP_GENERIC) in do_attach_detach_xdp() 652 if (attach_type == NET_ATTACH_TYPE_XDP_DRIVER) in do_attach_detach_xdp() 654 if (attach_type == NET_ATTACH_TYPE_XDP_OFFLOAD) in do_attach_detach_xdp() 660 static int get_tcx_type(enum net_attach_type attach_type) in get_tcx_type() argument 662 switch (attach_type) { in get_tcx_type() 672 static int do_attach_tcx(int progfd, enum net_attach_type attach_type, int ifindex, bool prepend) in do_attach_tcx() argument 674 int type = get_tcx_type(attach_type); in do_attach_tcx() 685 static int do_detach_tcx(int targetfd, enum net_attach_type attach_type) in do_detach_tcx() argument 687 int type = get_tcx_type(attach_type); in do_detach_tcx() 694 enum net_attach_type attach_type; do_attach() local 778 enum net_attach_type attach_type; do_detach() local [all...] |
| H A D | cgroup.c | 141 static int show_bpf_prog(int id, enum bpf_attach_type attach_type, in show_bpf_prog() argument 161 attach_type_str = libbpf_bpf_attach_type_str(attach_type); in show_bpf_prog() 183 jsonw_uint_field(json_wtr, "attach_type", attach_type); in show_bpf_prog() 197 printf("type %-10u", attach_type); in show_bpf_prog() 562 enum bpf_attach_type attach_type; in do_attach() local 579 attach_type = parse_attach_type(argv[1]); in do_attach() 580 if (attach_type == __MAX_BPF_ATTACH_TYPE) { in do_attach() 602 if (bpf_prog_attach(prog_fd, cgroup_fd, attach_type, attach_flags)) { in do_attach() 622 enum bpf_attach_type attach_type; in do_detach() local 637 attach_type = parse_attach_type(argv[1]); in do_detach() [all …]
|
| H A D | link.c | 142 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() 436 show_link_attach_type_json(info->tracing_multi.attach_type, wtr); in show_tracing_multi_json() 610 show_link_attach_type_json(info->tracing.attach_type, in show_link_close_json() 619 show_link_attach_type_json(info->cgroup.attach_type, json_wtr); in show_link_close_json() 627 show_link_attach_type_json(info->netns.attach_type, json_wtr); in show_link_close_json() 634 show_link_attach_type_json(info->tcx.attach_type, json_wtr); in show_link_close_json() 638 show_link_attach_type_json(info->netkit.attach_type, json_wtr); in show_link_close_json() 642 show_link_attach_type_json(info->sockmap.attach_type, json_wtr); in show_link_close_json() [all …]
|
| /linux/kernel/bpf/ |
| H A D | tcx.c | 12 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() 145 bool created, ingress = link->attach_type == BPF_TCX_INGRESS; in tcx_link_prog_attach() 172 bool ingress = link->attach_type == BPF_TCX_INGRESS; in tcx_link_release() 207 bool ingress = link->attach_type == BPF_TCX_INGRESS; in tcx_link_update() 263 link->attach_type, in tcx_link_fdinfo() 264 link->attach_type == BPF_TCX_INGRESS ? "ingress" : "egress"); in tcx_link_fdinfo() 279 info->tcx.attach_type = link->attach_type; in tcx_link_fill_info() 305 attr->link_create.attach_type); in tcx_link_init()
|
| H A D | net_namespace.c | 213 info->netns.attach_type = link->attach_type; in bpf_netns_link_fill_info() 227 link->attach_type); in bpf_netns_link_show_fdinfo() 275 type = to_netns_bpf_attach_type(attr->query.attach_type); in netns_bpf_prog_query() 302 type = to_netns_bpf_attach_type(attr->attach_type); in netns_bpf_prog_attach() 386 type = to_netns_bpf_attach_type(attr->attach_type); in netns_bpf_prog_detach() 483 type = attr->link_create.attach_type; in netns_bpf_link_create()
|
| H A D | syscall.c | 2668 enum bpf_prog_type *attach_type, bool attach_drv) in __bpf_prog_get() 2671 if (!attach_type) in __bpf_prog_get() 2674 if (prog->type != *attach_type) in __bpf_prog_get() 2682 static struct bpf_prog *__bpf_prog_get(u32 ufd, enum bpf_prog_type *attach_type, in __bpf_prog_get() 2694 if (!bpf_prog_get_ok(prog, attach_type, attach_drv)) 3248 enum bpf_attach_type attach_type, bool sleepable) in bpf_link_init() 3257 link->attach_type = attach_type; in bpf_tramp_link_init() 3262 enum bpf_attach_type attach_type) in bpf_link_free_id() 3264 bpf_link_init_sleepable(link, type, ops, prog, attach_type, fals in bpf_link_free_id() 2651 bpf_prog_get_ok(struct bpf_prog * prog,enum bpf_prog_type * attach_type,bool attach_drv) bpf_prog_get_ok() argument 2665 __bpf_prog_get(u32 ufd,enum bpf_prog_type * attach_type,bool attach_drv) __bpf_prog_get() argument 3231 bpf_link_init_sleepable(struct bpf_link * link,enum bpf_link_type type,const struct bpf_link_ops * ops,struct bpf_prog * prog,enum bpf_attach_type attach_type,bool sleepable) bpf_link_init_sleepable() argument 3245 bpf_link_init(struct bpf_link * link,enum bpf_link_type type,const struct bpf_link_ops * ops,struct bpf_prog * prog,enum bpf_attach_type attach_type) bpf_link_init() argument 3252 bpf_tramp_link_init(struct bpf_tramp_link * link,enum bpf_link_type type,const struct bpf_link_ops * ops,struct bpf_prog * prog,enum bpf_attach_type attach_type,u64 cookie) bpf_tramp_link_init() argument 3638 bpf_tracing_prog_attach(struct bpf_prog * prog,int tgt_prog_fd,u32 btf_id,u64 bpf_cookie,enum bpf_attach_type attach_type) bpf_tracing_prog_attach() argument 4299 bpf_raw_tp_link_attach(struct bpf_prog * prog,const char __user * user_tp_name,u64 cookie,enum bpf_attach_type attach_type) bpf_raw_tp_link_attach() argument 4398 attach_type_to_prog_type(enum bpf_attach_type attach_type) attach_type_to_prog_type() argument 4475 bpf_prog_attach_check_attach_type(const struct bpf_prog * prog,enum bpf_attach_type attach_type) bpf_prog_attach_check_attach_type() argument [all...] |
| H A D | local_storage.c | 50 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() 404 offset = offsetof(struct bpf_cgroup_storage_key, attach_type); in cgroup_storage_check_btf() 405 size = sizeof_field(struct bpf_cgroup_storage_key, attach_type); in cgroup_storage_check_btf() 588 storage->key.attach_type = type; in bpf_cgroup_storage_link()
|
| H A D | cgroup.c | 183 bpf_cgroup_atype_find(enum bpf_attach_type attach_type, u32 attach_btf_id) in bpf_cgroup_atype_find() argument 189 if (attach_type != BPF_LSM_CGROUP) in bpf_cgroup_atype_find() 190 return to_cgroup_bpf_attach_type(attach_type); in bpf_cgroup_atype_find() 234 bpf_cgroup_atype_find(enum bpf_attach_type attach_type, u32 attach_btf_id) in bpf_cgroup_atype_find() argument 236 if (attach_type != BPF_LSM_CGROUP) in bpf_cgroup_atype_find() 237 return to_cgroup_bpf_attach_type(attach_type); in bpf_cgroup_atype_find() 267 key.attach_type = type; in bpf_cgroup_storages_alloc() 301 enum bpf_attach_type attach_type) in bpf_cgroup_storages_link() argument 306 bpf_cgroup_storage_link(storages[stype], cgrp, attach_type); in bpf_cgroup_storages_link() 1063 atype = bpf_cgroup_atype_find(link->link.attach_type, new_prog->aux->attach_btf_id); in __cgroup_bpf_replace() [all …]
|
| H A D | token.c | 255 enum bpf_attach_type attach_type) in bpf_token_allow_prog_type() argument 257 if (!token || prog_type >= __MAX_BPF_PROG_TYPE || attach_type >= __MAX_BPF_ATTACH_TYPE) in bpf_token_allow_prog_type() 261 (token->allowed_attachs & BIT_ULL(attach_type)); in bpf_token_allow_prog_type()
|
| /linux/include/linux/ |
| H A D | bpf-netns.h | 10 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/net/core/ |
| H A D | sock_map.c | 82 ret = sock_map_prog_update(map, prog, NULL, NULL, attr->attach_type); in sock_map_get_from_fd() 111 ret = sock_map_prog_update(map, NULL, prog, NULL, attr->attach_type); in sock_map_prog_detach() 1521 static int sock_map_prog_attach_check(enum bpf_attach_type attach_type, in sock_map_prog_attach_check() argument 1525 if (prog && attach_type == BPF_SK_SKB_STREAM_PARSER && in sock_map_prog_attach_check() 1594 ret = sock_map_prog_link_lookup(map, &pprog, NULL, attr->query.attach_type); in sock_map_bpf_prog_query() 1752 link->attach_type)); in sock_map_link_release() 1798 ret = sock_map_prog_attach_check(link->attach_type, prog); in sock_map_link_update_prog() 1808 link->attach_type); in sock_map_link_update_prog() 1853 info->sockmap.attach_type = link->attach_type; in sock_map_link_fill_info() 1864 seq_printf(seq, "attach_type:\t%u\n", link->attach_type); in sock_map_link_show_fdinfo() [all …]
|
| /linux/tools/include/uapi/linux/ |
| H A D | bpf.h | 113 __u32 attach_type; /* program attach type (enum bpf_attach_type) */ member 1693 __u32 attach_type; member 1751 __u32 attach_type; member 1819 __u32 attach_type; /* attach type */ member 6850 __u32 attach_type; member 6858 __u32 attach_type; member 6886 __u32 attach_type; member 6918 __u32 attach_type; member 6961 __u32 attach_type; member 6965 __u32 attach_type; member [all …]
|
| /linux/include/uapi/linux/ |
| H A D | bpf.h | 113 __u32 attach_type; /* program attach type (enum bpf_attach_type) */ member 1693 __u32 attach_type; member 1751 __u32 attach_type; member 1819 __u32 attach_type; /* attach type */ member 6850 __u32 attach_type; member 6858 __u32 attach_type; member 6886 __u32 attach_type; member 6918 __u32 attach_type; member 6961 __u32 attach_type; member 6965 __u32 attach_type; member [all …]
|
| /linux/tools/bpf/bpftool/Documentation/ |
| H A D | bpftool-link.rst | 81 cgroup_id 614 attach_type egress 92 "attach_type": "egress",
|
| /linux/tools/lib/bpf/ |
| H A D | skel_internal.h | 326 enum bpf_attach_type attach_type) in skel_link_create() argument 334 attr.link_create.attach_type = attach_type; in skel_link_create()
|
| /linux/Documentation/bpf/ |
| H A D | map_cgroup_storage.rst | 30 __u32 attach_type; 34 ``attach_type`` is the program's attach type. 84 .attach_type = type,
|