/linux/drivers/net/ethernet/netronome/nfp/bpf/ |
A D | main.c | 223 if (bpf->adjust_head.off_min > bpf->adjust_head.off_max) { in nfp_bpf_parse_cap_adjust_head() 230 memset(&bpf->adjust_head, 0, sizeof(bpf->adjust_head)); in nfp_bpf_parse_cap_adjust_head() 327 if (bpf->abi_version < 2 || bpf->abi_version > 3) { in nfp_bpf_parse_cap_abi_version() 449 bpf->cmsg_cache_cnt = nfp_bpf_ctrl_cmsg_cache_cnt(bpf); in nfp_bpf_start() 461 bpf = kzalloc(sizeof(*bpf), GFP_KERNEL); in nfp_bpf_init() 462 if (!bpf) in nfp_bpf_init() 487 bpf->cmsg_key_sz = bpf->maps.max_key_sz; in nfp_bpf_init() 488 bpf->cmsg_val_sz = bpf->maps.max_val_sz; in nfp_bpf_init() 504 kfree(bpf); in nfp_bpf_init() 515 WARN_ON(bpf->maps_in_use || bpf->map_elems_in_use); in nfp_bpf_clean() [all …]
|
A D | cmsg.c | 34 size += (bpf->cmsg_key_sz + bpf->cmsg_val_sz) * n; in nfp_bpf_cmsg_map_req_size() 42 return nfp_bpf_cmsg_alloc(bpf, nfp_bpf_cmsg_map_req_size(bpf, n)); in nfp_bpf_cmsg_map_req_alloc() 51 size += (bpf->cmsg_key_sz + bpf->cmsg_val_sz) * n; in nfp_bpf_cmsg_map_reply_size() 155 return &req->data[bpf->cmsg_key_sz * n + bpf->cmsg_val_sz * n]; in nfp_bpf_ctrl_req_key() 162 return &req->data[bpf->cmsg_key_sz * (n + 1) + bpf->cmsg_val_sz * n]; in nfp_bpf_ctrl_req_val() 169 return &reply->data[bpf->cmsg_key_sz * n + bpf->cmsg_val_sz * n]; in nfp_bpf_ctrl_reply_key() 176 return &reply->data[bpf->cmsg_key_sz * (n + 1) + bpf->cmsg_val_sz * n]; in nfp_bpf_ctrl_reply_val() 203 struct nfp_app_bpf *bpf = nfp_map->bpf; in nfp_bpf_ctrl_op_cache_get() local 297 struct nfp_app_bpf *bpf = nfp_map->bpf; in nfp_bpf_ctrl_entry_op() local 435 entry_sz = bpf->cmsg_key_sz + bpf->cmsg_val_sz; in nfp_bpf_ctrl_cmsg_cache_cnt() [all …]
|
A D | offload.c | 139 nfp_map_ptrs_forget(bpf, nfp_prog); in nfp_map_ptrs_record() 338 if (!bpf->maps.types) in nfp_bpf_map_alloc() 351 if (bpf->maps.max_maps == bpf->maps_in_use) { in nfp_bpf_map_alloc() 355 if (bpf->maps.max_elems - bpf->map_elems_in_use < in nfp_bpf_map_alloc() 359 bpf->maps.max_elems - bpf->map_elems_in_use); in nfp_bpf_map_alloc() 368 bpf->maps.max_elem_sz); in nfp_bpf_map_alloc() 391 nfp_map->bpf = bpf; in nfp_bpf_map_alloc() 402 bpf->maps_in_use++; in nfp_bpf_map_alloc() 414 nfp_bpf_ctrl_free_map(bpf, nfp_map); in nfp_bpf_map_free() 419 bpf->maps_in_use--; in nfp_bpf_map_free() [all …]
|
A D | main.h | 21 #define cmsg_warn(bpf, msg...) nn_dp_warn(&(bpf)->app->ctrl->dp, msg) argument 211 struct nfp_app_bpf *bpf; member 514 struct nfp_app_bpf *bpf; member 581 struct netdev_bpf *bpf); 591 unsigned int nfp_bpf_ctrl_cmsg_min_mtu(struct nfp_app_bpf *bpf); 592 unsigned int nfp_bpf_ctrl_cmsg_mtu(struct nfp_app_bpf *bpf); 593 unsigned int nfp_bpf_ctrl_cmsg_cache_cnt(struct nfp_app_bpf *bpf); 595 nfp_bpf_ctrl_alloc_map(struct nfp_app_bpf *bpf, struct bpf_map *map); 597 nfp_bpf_ctrl_free_map(struct nfp_app_bpf *bpf, struct nfp_bpf_map *nfp_map); 608 int nfp_bpf_event_output(struct nfp_app_bpf *bpf, const void *data,
|
/linux/tools/testing/selftests/bpf/ |
A D | test_bpftool_build.sh | 23 if [ ! -e tools/bpf/bpftool/Makefile ]; then 92 make_and_clean tools/bpf 96 make -C tools/bpf/runqslower OUTPUT=${KDIR_ROOT_DIR}/tools/bpf/runqslower/ clean 104 make_with_tmpdir tools/bpf O 113 make_and_clean -C tools/bpf/bpftool 115 make_with_tmpdir -C tools/bpf/bpftool OUTPUT 117 make_with_tmpdir -C tools/bpf/bpftool O 122 make_and_clean bpf 142 make_with_tmpdir bpf O 145 cd bpf/bpftool
|
A D | test_flow_dissector.sh | 25 $bpftool prog loadall ./bpf_flow.o /sys/fs/bpf/flow \ 29 /sys/fs/bpf/flow/_dissect flow_dissector; then 34 $bpftool prog attach pinned /sys/fs/bpf/flow/_dissect \ 38 /sys/fs/bpf/flow/_dissect flow_dissector; then 44 /sys/fs/bpf/flow/_dissect flow_dissector; then 49 rm -rf /sys/fs/bpf/flow 89 if /bin/mount | grep /sys/fs/bpf > /dev/null; then 94 /bin/mount bpffs /sys/fs/bpf -t bpf
|
/linux/samples/bpf/ |
A D | Makefile | 381 $(obj)/xdp_redirect_cpu.bpf.o: $(obj)/xdp_sample.bpf.o 382 $(obj)/xdp_redirect_map_multi.bpf.o: $(obj)/xdp_sample.bpf.o 383 $(obj)/xdp_redirect_map.bpf.o: $(obj)/xdp_sample.bpf.o 384 $(obj)/xdp_redirect.bpf.o: $(obj)/xdp_sample.bpf.o 385 $(obj)/xdp_monitor.bpf.o: $(obj)/xdp_sample.bpf.o 387 $(obj)/%.bpf.o: $(src)/%.bpf.c $(obj)/vmlinux.h $(src)/xdp_sample.bpf.h $(src)/xdp_sample_shared.h 399 xdp_redirect_cpu.skel.h-deps := xdp_redirect_cpu.bpf.o xdp_sample.bpf.o 401 xdp_redirect_map.skel.h-deps := xdp_redirect_map.bpf.o xdp_sample.bpf.o 402 xdp_redirect.skel.h-deps := xdp_redirect.bpf.o xdp_sample.bpf.o 403 xdp_monitor.skel.h-deps := xdp_monitor.bpf.o xdp_sample.bpf.o [all …]
|
/linux/drivers/net/netdevsim/ |
A D | bpf.c | 207 if (bpf->command == XDP_SETUP_PROG_HW) { in nsim_xdp_set_prog() 208 err = nsim_xdp_offload_prog(ns, bpf); in nsim_xdp_set_prog() 213 xdp_attachment_setup(xdp, bpf); in nsim_xdp_set_prog() 295 if (bpf->prog && bpf->prog->aux->offload) { in nsim_setup_prog_checks() 311 if (!bpf->prog) in nsim_setup_prog_hw_checks() 314 if (!bpf->prog->aux->offload) { in nsim_setup_prog_hw_checks() 323 state = bpf->prog->aux->offload->dev_priv; in nsim_setup_prog_hw_checks() 556 switch (bpf->command) { in nsim_bpf() 558 err = nsim_setup_prog_checks(ns, bpf); in nsim_bpf() 564 err = nsim_setup_prog_hw_checks(ns, bpf); in nsim_bpf() [all …]
|
/linux/tools/bpf/bpftool/Documentation/ |
A D | bpftool-iter.rst | 31 A bpf iterator combines a kernel iterating of 33 and a bpf program called for each kernel data object 37 The *pin* command creates a bpf iterator from *OBJ*, 43 Map element bpf iterator requires an additional parameter 44 *MAP* so bpf program can iterate over map elements for 45 that map. User can have a bpf program in kernel to run 49 User can then *cat PATH* to see the bpf iterator output. 60 **# bpftool iter pin bpf_iter_netlink.o /sys/fs/bpf/my_netlink** 64 Create a file-based bpf iterator from bpf_iter_netlink.o and pin it 65 to /sys/fs/bpf/my_netlink [all …]
|
A D | bpftool-net.rst | 5 tool for inspection of netdev/tc related bpf prog attachments 34 List bpf program attachments in the kernel networking subsystem. 45 bpf programs, users should consult other tools, e.g., iproute2. 48 all tc class/qdisc bpf program attachments. Both xdp programs and 49 tc programs are ordered based on ifindex number. If multiple bpf 52 all bpf programs attached to non clsact qdiscs, and finally all 53 bpf programs attached to root and clsact qdisc. 56 Attach bpf program *PROG* to network interface *NAME* with 57 type specified by *ATTACH_TYPE*. Previously attached bpf program 68 Detach bpf program attached to network interface *NAME* with [all …]
|
A D | bpftool-gen.rst | 164 **$ cat example1.bpf.c** 170 #include <linux/bpf.h> 171 #include <bpf/bpf_helpers.h> 188 **$ cat example2.bpf.c** 193 #include <linux/bpf.h> 194 #include <bpf/bpf_helpers.h> 214 **$ clang -target bpf -g example1.bpf.c -o example1.bpf.o** 215 **$ clang -target bpf -g example2.bpf.c -o example2.bpf.o** 216 **$ bpftool gen object example.bpf.o example1.bpf.o example2.bpf.o** 218 This set of commands compiles *example1.bpf.c* and *example2.bpf.c* [all …]
|
/linux/net/core/ |
A D | lwt_bpf.c | 118 struct bpf_lwt *bpf; in bpf_input() local 122 if (bpf->in.prog) { in bpf_input() 141 struct bpf_lwt *bpf; in bpf_output() local 145 if (bpf->out.prog) { in bpf_output() 153 bpf->out.name); in bpf_output() 272 struct bpf_lwt *bpf; in bpf_xmit() local 275 if (bpf->xmit.prog) { in bpf_xmit() 322 bpf_lwt_prog_destroy(&bpf->in); in bpf_destroy_state() 377 struct bpf_lwt *bpf; in bpf_build_state() local 396 bpf = bpf_lwt_lwtunnel(newts); in bpf_build_state() [all …]
|
/linux/kernel/bpf/ |
A D | net_namespace.c | 84 list_for_each(pos, &net->bpf.links[type]) in link_count() 315 if (!list_empty(&net->bpf.links[type])) { in netns_bpf_prog_attach() 331 attached = net->bpf.progs[type]; in netns_bpf_prog_attach() 352 net->bpf.progs[type] = prog; in netns_bpf_prog_attach() 370 if (!list_empty(&net->bpf.links[type])) in __netns_bpf_prog_detach() 373 attached = net->bpf.progs[type]; in __netns_bpf_prog_detach() 377 net->bpf.progs[type] = NULL; in __netns_bpf_prog_detach() 436 if (net->bpf.progs[type]) { in netns_bpf_link_attach() 533 INIT_LIST_HEAD(&net->bpf.links[type]); in netns_bpf_pernet_init() 550 if (net->bpf.progs[type]) in netns_bpf_pernet_pre_exit() [all …]
|
A D | cgroup.c | 28 percpu_ref_kill(&cgrp->bpf.refcnt); in cgroup_bpf_offline() 111 bpf.release_work); in cgroup_bpf_release() 134 cgrp->bpf.effective[atype], in cgroup_bpf_release() 207 u32 flags = p->bpf.flags[atype]; in hierarchy_allows_attach() 355 desc->bpf.inactive = NULL; in update_effective_progs() 361 desc->bpf.inactive = NULL; in update_effective_progs() 374 desc->bpf.inactive = NULL; in update_effective_progs() 566 head = &cg->bpf.progs[atype]; in replace_effective_prog() 578 desc->bpf.effective[atype], in replace_effective_prog() 710 flags = cgrp->bpf.flags[atype]; in __cgroup_bpf_detach() [all …]
|
A D | .built-in.a.cmd | 1 …bpf/built-in.a := echo >/dev/null; rm -f kernel/bpf/built-in.a; /usr/bin/ccache /home/test/workspa…
|
/linux/Documentation/bpf/ |
A D | bpf_devel_QA.rst | 27 bpf@vger.kernel.org 51 bpf@vger.kernel.org 81 the 'bpf' delegate). 89 * https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf.git/ 90 * https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/ 92 The bpf tree itself is for fixes only, whereas bpf-next for features, 126 maintainers know whether it is targeted at bpf or bpf-next. 144 If it is clear that patches should go into bpf or bpf-next tree, 158 Q: What does it mean when a patch gets applied to bpf or bpf-next tree? 195 accumulate too many patches in bpf or bpf-next. [all …]
|
A D | index.rst | 18 Documentation/bpf/libbpf/index.rst is a userspace library for loading and interacting with bpf prog… 43 The primary info for the bpf syscall is available in the `man-pages`_ 44 for `bpf(2)`_. For more information about the userspace API, see 50 * `bpf-helpers(7)`_ maintains a list of helpers available to eBPF programs. 106 .. _bpf(2): https://man7.org/linux/man-pages/man2/bpf.2.html 107 .. _bpf-helpers(7): https://man7.org/linux/man-pages/man7/bpf-helpers.7.html 108 .. _BPF and XDP Reference Guide: https://docs.cilium.io/en/latest/bpf/
|
A D | bpf_lsm.rst | 23 eBPF programs that use Documentation/bpf/btf.rst do not need to include kernel 58 macros defined in `tools/lib/bpf/bpf_tracing.h`_. In this 91 Documentation/bpf/btf.rst information. Since the BPF verifier is aware of the 98 eBPF programs can be loaded with the :manpage:`bpf(2)` syscall's 120 The LSM allows attachment of eBPF programs as LSM hooks using :manpage:`bpf(2)` 134 `tools/testing/selftests/bpf/progs/lsm.c`_ and the corresponding 135 userspace code in `tools/testing/selftests/bpf/prog_tests/test_lsm.c`_ 138 .. _tools/lib/bpf/bpf_tracing.h: 139 https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/tools/lib/bpf/bpf_tracing.h 140 .. _tools/testing/selftests/bpf/progs/lsm.c: [all …]
|
/linux/samples/seccomp/ |
A D | Makefile | 2 userprogs-always-y += bpf-fancy dropper bpf-direct user-trap 4 bpf-fancy-objs := bpf-fancy.o bpf-helper.o
|
/linux/Documentation/userspace-api/ebpf/ |
A D | syscall.rst | 10 The primary info for the bpf syscall is available in the `man-pages`_ 11 for `bpf(2)`_. 13 bpf() subcommand reference 16 .. kernel-doc:: include/uapi/linux/bpf.h 19 .. kernel-doc:: include/uapi/linux/bpf.h 24 .. _bpf(2): https://man7.org/linux/man-pages/man2/bpf.2.html
|
/linux/arch/um/drivers/ |
A D | vector_user.c | 754 int uml_vector_attach_bpf(int fd, void *bpf) in uml_vector_attach_bpf() argument 756 struct sock_fprog *prog = bpf; in uml_vector_attach_bpf() 767 struct sock_fprog *prog = bpf; in uml_vector_detach_bpf() 776 struct sock_filter *bpf; in uml_vector_default_bpf() local 788 bpf = uml_kmalloc( in uml_vector_default_bpf() 790 if (bpf) { in uml_vector_default_bpf() 791 bpf_prog->filter = bpf; in uml_vector_default_bpf() 815 struct sock_filter *bpf; in uml_vector_user_bpf() local 840 if (bpf == NULL) { in uml_vector_user_bpf() 844 bpf_prog->filter = bpf; in uml_vector_user_bpf() [all …]
|
/linux/kernel/bpf/preload/iterators/ |
A D | Makefile | 10 BPFTOOL_SRC := $(TOOLS_PATH)/bpf/bpftool 15 LIBBPF_SRC := $(TOOLS_PATH)/lib/bpf 44 iterators.skel.h: $(OUTPUT)/iterators.bpf.o | $(BPFTOOL) 49 $(OUTPUT)/iterators.bpf.o: iterators.bpf.c $(BPFOBJ) | $(OUTPUT) 51 $(Q)$(CLANG) -g -O2 -target bpf $(INCLUDES) \
|
/linux/tools/bpf/runqslower/ |
A D | Makefile | 9 LIBBPF_SRC := $(abspath ../../lib/bpf) 55 $(OUTPUT)/runqslower.bpf.o | libbpf_hdrs 57 $(OUTPUT)/runqslower.bpf.o: $(OUTPUT)/vmlinux.h runqslower.h | libbpf_hdrs 59 $(OUTPUT)/%.skel.h: $(OUTPUT)/%.bpf.o | $(BPFTOOL) 62 $(OUTPUT)/%.bpf.o: %.bpf.c $(BPFOBJ) | $(OUTPUT) 63 $(QUIET_GEN)$(CLANG) -g -O2 -target bpf $(INCLUDES) \
|
/linux/tools/bpf/bpftool/ |
A D | Makefile | 17 BPF_DIR = $(srctree)/tools/lib/bpf 29 LIBBPF_HDRS_DIR := $(LIBBPF_INCLUDE)/bpf 35 LIBBPF_BOOTSTRAP_HDRS_DIR := $(LIBBPF_BOOTSTRAP_INCLUDE)/bpf 84 -I$(srctree)/kernel/bpf/ \ 100 clang-bpf-co-re 102 clang-bpf-co-re 174 ifeq ($(feature-clang-bpf-co-re),1) 185 $(OUTPUT)%.bpf.o: skeleton/%.bpf.c $(OUTPUT)vmlinux.h $(LIBBPF_BOOTSTRAP) 192 $(OUTPUT)%.skel.h: $(OUTPUT)%.bpf.o $(BPFTOOL_BOOTSTRAP) 204 $(BOOTSTRAP_OUTPUT)disasm.o: $(srctree)/kernel/bpf/disasm.c [all …]
|
/linux/tools/lib/bpf/ |
A D | Makefile | 143 @(test -f ../../include/uapi/linux/bpf.h -a -f ../../../include/uapi/linux/bpf.h && ( \ 144 (diff -B ../../include/uapi/linux/bpf.h ../../../include/uapi/linux/bpf.h >/dev/null) || \ 157 $(BPF_HELPER_DEFS): $(srctree)/tools/include/uapi/linux/bpf.h 159 --file $(srctree)/tools/include/uapi/linux/bpf.h > $(BPF_HELPER_DEFS) 238 SRC_HDRS := bpf.h libbpf.h btf.h libbpf_common.h libbpf_legacy.h xsk.h \ 243 INSTALL_PFX := $(DESTDIR)$(prefix)/include/bpf 249 $(call do_install,$<,$(prefix)/include/bpf,644) 253 $(call do_install,$<,$(prefix)/include/bpf,644)
|