| /linux/drivers/net/ethernet/netronome/nfp/bpf/ |
| H A D | main.c | 27 struct nfp_app_bpf *bpf = nn->app->priv; in nfp_net_ebpf_capable() local 30 bpf->abi_version && in nfp_net_ebpf_capable() 31 nn_readb(nn, NFP_NET_CFG_BPF_ABI) == bpf->abi_version; in nfp_net_ebpf_capable() 206 nfp_bpf_parse_cap_adjust_head(struct nfp_app_bpf *bpf, void __iomem *value, in nfp_bpf_parse_cap_adjust_head() argument 210 struct nfp_cpp *cpp = bpf->app->pf->cpp; in nfp_bpf_parse_cap_adjust_head() 217 bpf->adjust_head.flags = readl(&cap->flags); in nfp_bpf_parse_cap_adjust_head() 218 bpf->adjust_head.off_min = readl(&cap->off_min); in nfp_bpf_parse_cap_adjust_head() 219 bpf->adjust_head.off_max = readl(&cap->off_max); in nfp_bpf_parse_cap_adjust_head() 220 bpf->adjust_head.guaranteed_sub = readl(&cap->guaranteed_sub); in nfp_bpf_parse_cap_adjust_head() 221 bpf->adjust_head.guaranteed_add = readl(&cap->guaranteed_add); in nfp_bpf_parse_cap_adjust_head() [all …]
|
| H A D | cmsg.c | 18 nfp_bpf_cmsg_alloc(struct nfp_app_bpf *bpf, unsigned int size) in nfp_bpf_cmsg_alloc() argument 22 skb = nfp_app_ctrl_msg_alloc(bpf->app, size, GFP_KERNEL); in nfp_bpf_cmsg_alloc() 31 nfp_bpf_cmsg_map_req_size(struct nfp_app_bpf *bpf, unsigned int n) in nfp_bpf_cmsg_map_req_size() argument 36 size += (bpf->cmsg_key_sz + bpf->cmsg_val_sz) * n; in nfp_bpf_cmsg_map_req_size() 42 nfp_bpf_cmsg_map_req_alloc(struct nfp_app_bpf *bpf, unsigned int n) in nfp_bpf_cmsg_map_req_alloc() argument 44 return nfp_bpf_cmsg_alloc(bpf, nfp_bpf_cmsg_map_req_size(bpf, n)); in nfp_bpf_cmsg_map_req_alloc() 48 nfp_bpf_cmsg_map_reply_size(struct nfp_app_bpf *bpf, unsigned int n) in nfp_bpf_cmsg_map_reply_size() argument 53 size += (bpf->cmsg_key_sz + bpf->cmsg_val_sz) * n; in nfp_bpf_cmsg_map_reply_size() 59 nfp_bpf_ctrl_rc_to_errno(struct nfp_app_bpf *bpf, in nfp_bpf_ctrl_rc_to_errno() argument 76 cmsg_warn(bpf, "FW responded with invalid status: %u\n", rc); in nfp_bpf_ctrl_rc_to_errno() [all …]
|
| H A D | offload.c | 31 nfp_map_ptr_record(struct nfp_app_bpf *bpf, struct nfp_prog *nfp_prog, in nfp_map_ptr_record() argument 38 record = rhashtable_lookup_fast(&bpf->maps_neutral, &map->id, in nfp_map_ptr_record() 61 err = rhashtable_insert_fast(&bpf->maps_neutral, &record->l, in nfp_map_ptr_record() 78 nfp_map_ptrs_forget(struct nfp_app_bpf *bpf, struct nfp_prog *nfp_prog) in nfp_map_ptrs_forget() argument 89 WARN_ON(rhashtable_remove_fast(&bpf->maps_neutral, in nfp_map_ptrs_forget() 111 nfp_map_ptrs_record(struct nfp_app_bpf *bpf, struct nfp_prog *nfp_prog, in nfp_map_ptrs_record() argument 134 err = nfp_map_ptr_record(bpf, nfp_prog, in nfp_map_ptrs_record() 137 nfp_map_ptrs_forget(bpf, nfp_prog); in nfp_map_ptrs_record() 201 nfp_prog->bpf = bpf_offload_dev_priv(prog->aux->offload->offdev); in nfp_bpf_verifier_prep() 242 return nfp_map_ptrs_record(nfp_prog->bpf, nfp_prog, prog); in nfp_bpf_translate() [all …]
|
| /linux/tools/tracing/rtla/src/ |
| H A D | timerlat_bpf.c | 8 static struct timerlat_bpf *bpf; variable 23 bpf = timerlat_bpf__open(); in timerlat_bpf_init() 24 if (!bpf) in timerlat_bpf_init() 28 bpf->rodata->output_divisor = params->common.output_divisor; in timerlat_bpf_init() 29 bpf->rodata->entries = params->common.hist.entries; in timerlat_bpf_init() 30 bpf->rodata->irq_threshold = params->common.stop_us; in timerlat_bpf_init() 31 bpf->rodata->thread_threshold = params->common.stop_total_us; in timerlat_bpf_init() 32 bpf->rodata->aa_only = params->common.aa_only; in timerlat_bpf_init() 36 bpf->rodata->bucket_size = params->common.hist.bucket_size; in timerlat_bpf_init() 39 bpf_map__set_max_entries(bpf in timerlat_bpf_init() [all...] |
| /linux/drivers/hid/bpf/progs/ |
| H A D | README | 8 The .bpf.c files provided here are not automatically compiled in the kernel. 9 They should be loaded in the kernel by `udev-hid-bpf`: 11 https://gitlab.freedesktop.org/libevdev/udev-hid-bpf 17 Once a .bpf.c file is accepted here, it is duplicated in `udev-hid-bpf` 18 in the `src/bpf/stable` directory, and distributions are encouraged to 19 only ship those bpf objects. So adding a file here should eventually 20 land in distributions when they update `udev-hid-bpf` 30 Just run `sudo udev-hid-bpf install ./my-awesome-fix.bpf.o` 34 - copy the `.bpf.o` you want in `/etc/udev-hid-bpf/` 37 The following should do the trick (assuming udev-hid-bpf is available in [all …]
|
| H A D | Makefile | 10 BPFTOOL_SRC := $(TOOLS_PATH)/bpf/bpftool 15 LIBBPF_SRC := $(TOOLS_PATH)/lib/bpf 48 SOURCES = $(wildcard *.bpf.c) 49 TARGETS = $(SOURCES:.bpf.c=.bpf.o) 57 %.bpf.o: %.bpf.c vmlinux.h $(BPFOBJ) | $(OUTPUT) 59 $(Q)$(CLANG) -g -O2 --target=bpf -Wall -Werror $(INCLUDES) \
|
| /linux/samples/bpf/ |
| H A D | Makefile | 42 LIBBPF_SRC = $(TOOLS_PATH)/lib/bpf 48 CGROUP_HELPERS := ../../tools/testing/selftests/bpf/cgroup_helpers.o 49 TRACE_HELPERS := ../../tools/testing/selftests/bpf/trace_helpers.o 89 always-y += tracex1.bpf.o 90 always-y += tracex3.bpf.o 91 always-y += tracex4.bpf.o 92 always-y += tracex5.bpf.o 93 always-y += tracex6.bpf.o 94 always-y += trace_output.bpf.o 98 always-y += offwaketime.bpf.o [all …]
|
| /linux/tools/testing/selftests/bpf/ |
| H A D | test_bpftool_build.sh | 17 # Assume script is located under tools/testing/selftests/bpf/. We want to start 23 if [ ! -e tools/bpf/bpftool/Makefile ]; then 92 make_and_clean tools/bpf 97 # make_with_tmpdir tools/bpf OUTPUT 98 echo -e "skip: make tools/bpf OUTPUT=<dir> (not supported)\n" 100 make_with_tmpdir tools/bpf O 102 echo -e "skip: make tools/bpf (no .config found)\n" 103 echo -e "skip: make tools/bpf OUTPUT=<dir> (not supported)\n" 104 echo -e "skip: make tools/bpf O=<dir> (no .config found)\n" 109 make_and_clean -C tools/bpf/bpftoo [all...] |
| H A D | Makefile | 11 BPFDIR := $(LIBDIR)/bpf 14 BPFTOOLDIR := $(TOOLSDIR)/bpf/bpftool 28 BPF_GCC ?= $(shell command -v bpf-gcc;) 82 # Check whether bpf cpu=v4 is supported or not by clang 83 ifneq ($(shell $(CLANG) --target=bpf -mcpu=help 2>&1 | grep 'v4'),) 89 $(CLANG) --target=bpf -fsanitize=kernel-address \ 100 # Also test bpf-gcc, if present 392 $(APIDIR)/linux/bpf.h \ 401 $(APIDIR)/linux/bpf.h \ 426 $(TOOLSDIR)/bpf/resolve_btfid [all...] |
| /linux/drivers/hid/bpf/ |
| H A D | hid_bpf_dispatch.c | 34 .allocated_size = hdev->bpf.allocated_data, in dispatch_hid_bpf_device_event() 37 .data = hdev->bpf.device_data, in dispatch_hid_bpf_device_event() 43 if (unlikely(hdev->bpf.destroyed)) in dispatch_hid_bpf_device_event() 50 if (!hdev->bpf.device_data) in dispatch_hid_bpf_device_event() 53 memset(ctx_kern.data, 0, hdev->bpf.allocated_data); in dispatch_hid_bpf_device_event() 57 list_for_each_entry_rcu(e, &hdev->bpf.prog_list, list) { in dispatch_hid_bpf_device_event() 102 if (unlikely(hdev->bpf.destroyed)) in dispatch_hid_bpf_raw_requests() 108 idx = srcu_read_lock(&hdev->bpf.srcu); in dispatch_hid_bpf_raw_requests() 109 list_for_each_entry_srcu(e, &hdev->bpf.prog_list, list, in dispatch_hid_bpf_raw_requests() 110 srcu_read_lock_held(&hdev->bpf in dispatch_hid_bpf_raw_requests() [all...] |
| H A D | hid_bpf_struct_ops.c | 202 mutex_lock(&hdev->bpf.prog_list_lock); in hid_bpf_reg() 204 count = list_count_nodes(&hdev->bpf.prog_list); in hid_bpf_reg() 211 if (hdev->bpf.rdesc_ops) { in hid_bpf_reg() 216 hdev->bpf.rdesc_ops = ops; in hid_bpf_reg() 226 list_add_rcu(&ops->list, &hdev->bpf.prog_list); in hid_bpf_reg() 228 list_add_tail_rcu(&ops->list, &hdev->bpf.prog_list); in hid_bpf_reg() 229 synchronize_srcu(&hdev->bpf.srcu); in hid_bpf_reg() 232 mutex_unlock(&hdev->bpf.prog_list_lock); in hid_bpf_reg() 235 if (hdev->bpf.rdesc_ops == ops) in hid_bpf_reg() 236 hdev->bpf.rdesc_ops = NULL; in hid_bpf_reg() [all …]
|
| /linux/tools/bpf/bpftool/Documentation/ |
| H A D | bpftool-iter.rst | 35 A bpf iterator combines a kernel iterating of particular kernel data (e.g., 36 tasks, bpf_maps, etc.) and a bpf program called for each kernel data object 40 The *pin* command creates a bpf iterator from *OBJ*, and pin it to *PATH*. 44 Map element bpf iterator requires an additional parameter *MAP* so bpf 45 program can iterate over map elements for that map. User can have a bpf 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 67 **# bpftool iter pin bpf_iter_hashmap.o /sys/fs/bpf/my_hashmap map id 20** [all …]
|
| /linux/samples/hid/ |
| H A D | Makefile | 13 LIBBPF_SRC = $(TOOLS_PATH)/lib/bpf 85 BTF_LLC_PROBE := $(shell $(LLC) -march=bpf -mattr=help 2>&1 | grep dwarfris) 89 $(CLANG) --target=bpf -O2 -g -c -x c - -o ./llvm_btf_verify.o; \ 121 BPFTOOLDIR := $(TOOLS_PATH)/bpf/bpftool 147 @if ! (${LLC} -march=bpf -mattr=help > /dev/null 2>&1); then \ 199 $(obj)/%.bpf.o: $(src)/%.bpf.c $(EXTRA_BPF_HEADERS_SRC) $(obj)/vmlinux.h 201 $(Q)$(CLANG) -g -O2 --target=bpf -D__TARGET_ARCH_$(SRCARCH) \ 203 -I$(srctree)/samples/bpf -I$(srctree)/tools/include \ 205 -c $(filter %.bpf.c,$^) -o $@ 210 hid_mouse.skel.h-deps := hid_mouse.bpf.o [all …]
|
| /linux/net/core/ |
| H A D | lwt_bpf.c | 127 struct bpf_lwt *bpf; in bpf_input() local 130 bpf = bpf_lwt_lwtunnel(dst->lwtstate); in bpf_input() 131 if (bpf->in.prog) { in bpf_input() 132 ret = run_lwt_bpf(skb, &bpf->in, dst, NO_REDIRECT); in bpf_input() 150 struct bpf_lwt *bpf; in bpf_output() local 153 bpf = bpf_lwt_lwtunnel(dst->lwtstate); in bpf_output() 154 if (bpf->out.prog) { in bpf_output() 155 ret = run_lwt_bpf(skb, &bpf->out, dst, NO_REDIRECT); in bpf_output() 162 bpf->out.name); in bpf_output() 281 struct bpf_lwt *bpf; in bpf_xmit() local [all …]
|
| /linux/kernel/bpf/ |
| H A D | net_namespace.c | 60 run_array = rcu_replace_pointer(net->bpf.run_array[type], NULL, in netns_bpf_run_array_detach() 71 list_for_each_entry(pos, &net->bpf.links[type], node) { in link_index() 84 list_for_each(pos, &net->bpf.links[type]) in link_count() 95 list_for_each_entry(pos, &net->bpf.links[type], node) { in fill_prog_array() 133 old_array = rcu_dereference_protected(net->bpf.run_array[type], in bpf_netns_link_release() 141 rcu_assign_pointer(net->bpf.run_array[type], new_array); in bpf_netns_link_release() 186 run_array = rcu_dereference_protected(net->bpf.run_array[type], in bpf_netns_link_update_prog() 249 run_array = rcu_dereference_protected(net->bpf.run_array[type], in __netns_bpf_prog_query() 310 if (!list_empty(&net->bpf.links[type])) { in netns_bpf_prog_attach() 326 attached = net->bpf.progs[type]; in netns_bpf_prog_attach() [all …]
|
| H A D | cgroup.c | 134 ret = bpf_prog_run_array_cg(&cgrp->bpf, in __cgroup_bpf_run_lsm_sock() 156 ret = bpf_prog_run_array_cg(&cgrp->bpf, in __cgroup_bpf_run_lsm_socket() 175 ret = bpf_prog_run_array_cg(&cgrp->bpf, in __cgroup_bpf_run_lsm_current() 245 percpu_ref_kill(&cgrp->bpf.refcnt); in cgroup_bpf_offline() 328 bpf.release_work); in cgroup_bpf_release() 330 struct list_head *storages = &cgrp->bpf.storages; in cgroup_bpf_release() 337 for (atype = 0; atype < ARRAY_SIZE(cgrp->bpf.progs); atype++) { in cgroup_bpf_release() 338 struct hlist_head *progs = &cgrp->bpf.progs[atype]; in cgroup_bpf_release() 358 cgrp->bpf.effective[atype], in cgroup_bpf_release() 373 percpu_ref_exit(&cgrp->bpf.refcnt); in cgroup_bpf_release() [all …]
|
| /linux/tools/sched_ext/ |
| H A D | Makefile | 45 BPFDIR := $(LIBDIR)/bpf 47 BPFTOOLDIR := $(TOOLSDIR)/bpf/bpftool 120 -I$(CURDIR)/include -I$(CURDIR)/include/bpf-compat \ 140 $(APIDIR)/linux/bpf.h \ 150 $(APIDIR)/linux/bpf.h \ 177 $(SCXOBJ_DIR)/%.bpf.o: %.bpf.c $(INCLUDE_DIR)/vmlinux.h include/scx/*.h \ 180 $(Q)$(CLANG) $(BPF_CFLAGS) -target bpf -c $< -o $@ 182 $(INCLUDE_DIR)/%.bpf.skel.h: $(SCXOBJ_DIR)/%.bpf.o $(INCLUDE_DIR)/vmlinux.h $(BPFTOOL) 189 $(Q)$(BPFTOOL) gen skeleton $(<:.o=.linked3.o) name $(subst .bpf.skel.h,,$(sched)) > $@ 190 …$(Q)$(BPFTOOL) gen subskeleton $(<:.o=.linked3.o) name $(subst .bpf.skel.h,,$(sched)) > $(@:.skel.… [all …]
|
| /linux/tools/tracing/rtla/ |
| H A D | Makefile | 65 FEATURE_TESTS += clang-bpf-co-re 72 FEATURE_DISPLAY += clang-bpf-co-re 101 src/timerlat.bpf.o: src/timerlat.bpf.c 102 $(QUIET_CLANG)$(CLANG) -g -O2 -target bpf -c $(filter %.c,$^) -o $@ 104 src/timerlat.skel.h: src/timerlat.bpf.o 108 $(QUIET_CLANG)$(CLANG) -g -O2 -target bpf -c $(filter %.c,$^) -o $@ 110 tests/bpf/bpf_action_map.o: tests/bpf/bpf_action_map.c 111 $(QUIET_CLANG)$(CLANG) -g -O2 -target bpf -c $(filter %.c,$^) -o $@ 119 tests/bpf/bpf_action_map.o: tests/bpf/bpf_action_map.c 172 $(Q)rm -f src/timerlat.bpf.o src/timerlat.skel.h example/timerlat_bpf_action.o [all …]
|
| /linux/samples/seccomp/ |
| H 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/ |
| H 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/Documentation/bpf/ |
| H A D | bpf_devel_QA.rst | 23 loader development happens through the bpf kernel mailing list, 27 bpf@vger.kernel.org 49 A: BPF CI is GitHub based and hosted at https://github.com/kernel-patches/bpf. 58 - Clone the fork locally, check out a new branch tracking either the bpf-next 59 or bpf branch, and apply your to-be-tested patches on top of it 62 kernel-patches/bpf's bpf-next_base or bpf_base branch, respectively 68 Note furthermore that both base branches (bpf-next_base and bpf_base) will be 76 A: Please submit your BPF patches to the bpf kernel mailing list: 78 bpf@vger.kernel.org 92 Those patches which target BPF, are assigned to a 'bpf' delegate for [all …]
|
| H A D | prog_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/Documentation/translations/zh_CN/userspace-api/ebpf/ |
| H A D | syscall.rst | 18 bpf syscall的主要信息可以在 `man-pages`_ 中的 `bpf(2)`_ 找到。 20 bpf() 子命令参考 25 include/uapi/linux/bpf.h 29 .. _bpf(2): https://man7.org/linux/man-pages/man2/bpf.2.html
|
| /linux/tools/testing/selftests/sched_ext/ |
| H A D | Makefile | 17 BPFDIR := $(LIBDIR)/bpf 19 BPFTOOLDIR := $(TOOLSDIR)/bpf/bpftool 90 -I$(CURDIR)/include -I$(CURDIR)/include/bpf-compat \ 110 $(APIDIR)/linux/bpf.h \ 136 $(SCXOBJ_DIR)/%.bpf.o: %.bpf.c $(INCLUDE_DIR)/vmlinux.h | $(BPFOBJ) $(SCXOBJ_DIR) 138 $(Q)$(CLANG) $(BPF_CFLAGS) -target bpf -c $< -o $@ 140 $(INCLUDE_DIR)/%.bpf.skel.h: $(SCXOBJ_DIR)/%.bpf.o $(INCLUDE_DIR)/vmlinux.h $(BPFTOOL) | $(INCLUDE_… 147 $(Q)$(BPFTOOL) gen skeleton $(<:.o=.linked3.o) name $(subst .bpf.skel.h,,$(sched)) > $@ 148 …$(Q)$(BPFTOOL) gen subskeleton $(<:.o=.linked3.o) name $(subst .bpf.skel.h,,$(sched)) > $(@:.skel.… 162 all_test_bpfprogs := $(foreach prog,$(wildcard *.bpf.c),$(INCLUDE_DIR)/$(patsubst %.c,%.skel.h,$(pr…
|
| /linux/kernel/bpf/preload/iterators/ |
| H A D | Makefile | 10 BPFTOOL_SRC := $(TOOLS_PATH)/bpf/bpftool 15 LIBBPF_SRC := $(TOOLS_PATH)/lib/bpf 46 iterators.lskel-%.h: $(OUTPUT)/%/iterators.bpf.o | $(BPFTOOL) 50 $(OUTPUT)/%/iterators.bpf.o: iterators.bpf.c $(BPFOBJ) | $(OUTPUT) 53 $(Q)$(CLANG) -g -O2 --target=bpf -m$* $(INCLUDES) \
|