| /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 136 err = nfp_map_ptr_record(bpf, nfp_prog, in nfp_map_ptrs_record() 139 nfp_map_ptrs_forget(bpf, nfp_prog); in nfp_map_ptrs_record() 203 nfp_prog->bpf = bpf_offload_dev_priv(prog->aux->offload->offdev); in nfp_bpf_verifier_prep() 244 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 19 bpf = timerlat_bpf__open(); in timerlat_bpf_init() 20 if (!bpf) in timerlat_bpf_init() 24 bpf->rodata->output_divisor = params->common.output_divisor; in timerlat_bpf_init() 25 bpf->rodata->entries = params->common.hist.entries; in timerlat_bpf_init() 26 bpf->rodata->irq_threshold = params->common.stop_us; in timerlat_bpf_init() 27 bpf->rodata->thread_threshold = params->common.stop_total_us; in timerlat_bpf_init() 28 bpf->rodata->aa_only = params->common.aa_only; in timerlat_bpf_init() 32 bpf->rodata->bucket_size = params->common.hist.bucket_size; in timerlat_bpf_init() 35 bpf_map__set_max_entries(bpf->maps.hist_irq, params->common.hist.entries); 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;) 69 # Check whether bpf cpu=v4 is supported or not by clang 70 ifneq ($(shell $(CLANG) --target=bpf -mcpu=help 2>&1 | grep 'v4'),) 81 # Also test bpf-gcc, if present 365 $(APIDIR)/linux/bpf.h \ 374 $(APIDIR)/linux/bpf.h \ 399 $(TOOLSDIR)/bpf/resolve_btfids/main.c \ 405 $(Q)$(MAKE) $(submake_extras) -C $(TOOLSDIR)/bpf/resolve_btfid [all...] |
| /linux/drivers/hid/bpf/ |
| H A D | hid_bpf_dispatch.c | 32 .allocated_size = hdev->bpf.allocated_data, in dispatch_hid_bpf_device_event() 35 .data = hdev->bpf.device_data, in dispatch_hid_bpf_device_event() 41 if (unlikely(hdev->bpf.destroyed)) in dispatch_hid_bpf_device_event() 48 if (!hdev->bpf.device_data) in dispatch_hid_bpf_device_event() 51 memset(ctx_kern.data, 0, hdev->bpf.allocated_data); in dispatch_hid_bpf_device_event() 55 list_for_each_entry_rcu(e, &hdev->bpf.prog_list, list) { in dispatch_hid_bpf_device_event() 99 if (unlikely(hdev->bpf.destroyed)) in dispatch_hid_bpf_raw_requests() 105 idx = srcu_read_lock(&hdev->bpf.srcu); in dispatch_hid_bpf_raw_requests() 106 list_for_each_entry_srcu(e, &hdev->bpf.prog_list, list, in dispatch_hid_bpf_raw_requests() 107 srcu_read_lock_held(&hdev->bpf.srcu)) { in dispatch_hid_bpf_raw_requests() [all …]
|
| H A D | hid_bpf_struct_ops.c | 196 mutex_lock(&hdev->bpf.prog_list_lock); in hid_bpf_reg() 198 count = list_count_nodes(&hdev->bpf.prog_list); in hid_bpf_reg() 205 if (hdev->bpf.rdesc_ops) { in hid_bpf_reg() 210 hdev->bpf.rdesc_ops = ops; in hid_bpf_reg() 220 list_add_rcu(&ops->list, &hdev->bpf.prog_list); in hid_bpf_reg() 222 list_add_tail_rcu(&ops->list, &hdev->bpf.prog_list); in hid_bpf_reg() 223 synchronize_srcu(&hdev->bpf.srcu); in hid_bpf_reg() 226 mutex_unlock(&hdev->bpf.prog_list_lock); in hid_bpf_reg() 229 if (hdev->bpf.rdesc_ops == ops) in hid_bpf_reg() 230 hdev->bpf.rdesc_ops = NULL; in hid_bpf_reg() [all …]
|
| /linux/drivers/net/netdevsim/ |
| H A D | bpf.c | 180 static int nsim_xdp_offload_prog(struct netdevsim *ns, struct netdev_bpf *bpf) in nsim_xdp_offload_prog() argument 182 if (!nsim_xdp_offload_active(ns) && !bpf->prog) in nsim_xdp_offload_prog() 184 if (!nsim_xdp_offload_active(ns) && bpf->prog && ns->bpf_offloaded) { in nsim_xdp_offload_prog() 185 NSIM_EA(bpf->extack, "TC program is already loaded"); in nsim_xdp_offload_prog() 189 return nsim_bpf_offload(ns, bpf->prog, nsim_xdp_offload_active(ns)); in nsim_xdp_offload_prog() 193 nsim_xdp_set_prog(struct netdevsim *ns, struct netdev_bpf *bpf, in nsim_xdp_set_prog() argument 198 if (bpf->command == XDP_SETUP_PROG && !ns->bpf_xdpdrv_accept) { in nsim_xdp_set_prog() 199 NSIM_EA(bpf->extack, "driver XDP disabled in DebugFS"); in nsim_xdp_set_prog() 202 if (bpf->command == XDP_SETUP_PROG_HW && !ns->bpf_xdpoffload_accept) { in nsim_xdp_set_prog() 203 NSIM_EA(bpf->extack, "XDP offload disabled in DebugFS"); in nsim_xdp_set_prog() [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 …]
|
| H A D | bpftool-net.rst | 7 tool for inspection of networking related bpf prog attachments 37 List bpf program attachments in the kernel networking subsystem. 49 msg, reuseport} and lwt/seg6 bpf programs, users should consult other 53 all tcx, netkit, then tc class/qdisc bpf program attachments, then 55 tcx/netkit/tc programs are ordered based on ifindex number. If multiple bpf 57 will be first all bpf programs attached to tcx, netkit, then tc classes, 58 then all bpf programs attached to non clsact qdiscs, and finally all bpf 62 Attach bpf program *PROG* to network interface *NAME* with type specified 63 by *ATTACH_TYPE*. Previously attached bpf program can be replaced by the 76 Detach bpf program attached to network interface *NAME* with type specified [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/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() 188 run_array = rcu_dereference_protected(net->bpf.run_array[type], in bpf_netns_link_update_prog() 254 run_array = rcu_dereference_protected(net->bpf.run_array[type], in __netns_bpf_prog_query() 315 if (!list_empty(&net->bpf.links[type])) { in netns_bpf_prog_attach() 331 attached = net->bpf.progs[type]; in netns_bpf_prog_attach() [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 \ 138 $(APIDIR)/linux/bpf.h \ 148 $(APIDIR)/linux/bpf.h \ 175 $(SCXOBJ_DIR)/%.bpf.o: %.bpf.c $(INCLUDE_DIR)/vmlinux.h include/scx/*.h \ 178 $(Q)$(CLANG) $(BPF_CFLAGS) -target bpf -c $< -o $@ 180 $(INCLUDE_DIR)/%.bpf.skel.h: $(SCXOBJ_DIR)/%.bpf.o $(INCLUDE_DIR)/vmlinux.h $(BPFTOOL) 187 $(Q)$(BPFTOOL) gen skeleton $(<:.o=.linked3.o) name $(subst .bpf.skel.h,,$(sched)) > $@ 188 …$(Q)$(BPFTOOL) gen subskeleton $(<:.o=.linked3.o) name $(subst .bpf.skel.h,,$(sched)) > $(@:.skel.… [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/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 \ 108 $(APIDIR)/linux/bpf.h \ 134 $(SCXOBJ_DIR)/%.bpf.o: %.bpf.c $(INCLUDE_DIR)/vmlinux.h | $(BPFOBJ) $(SCXOBJ_DIR) 136 $(Q)$(CLANG) $(BPF_CFLAGS) -target bpf -c $< -o $@ 138 $(INCLUDE_DIR)/%.bpf.skel.h: $(SCXOBJ_DIR)/%.bpf.o $(INCLUDE_DIR)/vmlinux.h $(BPFTOOL) | $(INCLUDE_… 145 $(Q)$(BPFTOOL) gen skeleton $(<:.o=.linked3.o) name $(subst .bpf.skel.h,,$(sched)) > $@ 146 …$(Q)$(BPFTOOL) gen subskeleton $(<:.o=.linked3.o) name $(subst .bpf.skel.h,,$(sched)) > $(@:.skel.… 160 all_test_bpfprogs := $(foreach prog,$(wildcard *.bpf.c),$(INCLUDE_DIR)/$(patsubst %.c,%.skel.h,$(pr…
|
| /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/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) \
|
| /linux/tools/tracing/rtla/ |
| H A D | Makefile | 37 FEATURE_TESTS += clang-bpf-co-re 43 FEATURE_DISPLAY += clang-bpf-co-re 71 src/timerlat.bpf.o: src/timerlat.bpf.c 72 $(QUIET_CLANG)$(CLANG) -g -O2 -target bpf -c $(filter %.c,$^) -o $@ 74 src/timerlat.skel.h: src/timerlat.bpf.o 99 $(Q)rm -f src/timerlat.bpf.o src/timerlat.skel.h
|