/linux-6.12.1/drivers/net/ethernet/netronome/nfp/bpf/ |
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 …]
|
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() 29 nfp_bpf_cmsg_map_req_size(struct nfp_app_bpf *bpf, unsigned int n) in nfp_bpf_cmsg_map_req_size() argument 34 size += (bpf->cmsg_key_sz + bpf->cmsg_val_sz) * n; in nfp_bpf_cmsg_map_req_size() 40 nfp_bpf_cmsg_map_req_alloc(struct nfp_app_bpf *bpf, unsigned int n) in nfp_bpf_cmsg_map_req_alloc() argument 42 return nfp_bpf_cmsg_alloc(bpf, nfp_bpf_cmsg_map_req_size(bpf, n)); in nfp_bpf_cmsg_map_req_alloc() 46 nfp_bpf_cmsg_map_reply_size(struct nfp_app_bpf *bpf, unsigned int n) in nfp_bpf_cmsg_map_reply_size() argument 51 size += (bpf->cmsg_key_sz + bpf->cmsg_val_sz) * n; in nfp_bpf_cmsg_map_reply_size() 57 nfp_bpf_ctrl_rc_to_errno(struct nfp_app_bpf *bpf, in nfp_bpf_ctrl_rc_to_errno() argument 74 cmsg_warn(bpf, "FW responded with invalid status: %u\n", rc); in nfp_bpf_ctrl_rc_to_errno() [all …]
|
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-6.12.1/drivers/hid/bpf/progs/ |
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 …]
|
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-6.12.1/samples/bpf/ |
D | Makefile | 50 LIBBPF_SRC = $(TOOLS_PATH)/lib/bpf 56 CGROUP_HELPERS := ../../tools/testing/selftests/bpf/cgroup_helpers.o 57 TRACE_HELPERS := ../../tools/testing/selftests/bpf/trace_helpers.o 105 always-y += tracex1.bpf.o 106 always-y += tracex3.bpf.o 107 always-y += tracex4.bpf.o 108 always-y += tracex5.bpf.o 109 always-y += tracex6.bpf.o 110 always-y += tracex7.bpf.o 111 always-y += sock_flags.bpf.o [all …]
|
/linux-6.12.1/tools/testing/selftests/bpf/ |
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
|
D | test_flow_dissector.sh | 27 $bpftool prog loadall $BPF_FILE /sys/fs/bpf/flow \ 31 /sys/fs/bpf/flow/_dissect flow_dissector; then 36 $bpftool prog attach pinned /sys/fs/bpf/flow/_dissect \ 40 /sys/fs/bpf/flow/_dissect flow_dissector; then 46 /sys/fs/bpf/flow/_dissect flow_dissector; then 51 rm -rf /sys/fs/bpf/flow 91 if /bin/mount | grep /sys/fs/bpf > /dev/null; then 96 /bin/mount bpffs /sys/fs/bpf -t bpf
|
D | Makefile | 11 BPFDIR := $(LIBDIR)/bpf 13 BPFTOOLDIR := $(TOOLSDIR)/bpf/bpftool 27 BPF_GCC ?= $(shell command -v bpf-gcc;) 80 ifneq ($(shell $(CLANG) --target=bpf -mcpu=help 2>&1 | grep 'v4'),) 124 TEST_GEN_FILES = test_lwt_ip_encap.bpf.o test_tc_edt.bpf.o 331 $(Q)$(MAKE) $(submake_extras) -C $(TOOLSDIR)/bpf/runqslower \ 402 $(APIDIR)/linux/bpf.h \ 411 $(APIDIR)/linux/bpf.h \ 434 $(TOOLSDIR)/bpf/resolve_btfids/main.c \ 440 $(Q)$(MAKE) $(submake_extras) -C $(TOOLSDIR)/bpf/resolve_btfids \ [all …]
|
/linux-6.12.1/tools/bpf/bpftool/Documentation/ |
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-6.12.1/drivers/hid/bpf/ |
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() 45 if (!hdev->bpf.device_data) in dispatch_hid_bpf_device_event() 48 memset(ctx_kern.data, 0, hdev->bpf.allocated_data); in dispatch_hid_bpf_device_event() 52 list_for_each_entry_rcu(e, &hdev->bpf.prog_list, list) { in dispatch_hid_bpf_device_event() 99 idx = srcu_read_lock(&hdev->bpf.srcu); in dispatch_hid_bpf_raw_requests() 100 list_for_each_entry_srcu(e, &hdev->bpf.prog_list, list, in dispatch_hid_bpf_raw_requests() 101 srcu_read_lock_held(&hdev->bpf.srcu)) { in dispatch_hid_bpf_raw_requests() 112 srcu_read_unlock(&hdev->bpf.srcu, idx); in dispatch_hid_bpf_raw_requests() 133 idx = srcu_read_lock(&hdev->bpf.srcu); in dispatch_hid_bpf_output_report() [all …]
|
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-6.12.1/drivers/net/netdevsim/ |
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-6.12.1/samples/hid/ |
D | Makefile | 13 LIBBPF_SRC = $(TOOLS_PATH)/lib/bpf 84 BTF_LLC_PROBE := $(shell $(LLC) -march=bpf -mattr=help 2>&1 | grep dwarfris) 88 $(CLANG) --target=bpf -O2 -g -c -x c - -o ./llvm_btf_verify.o; \ 120 BPFTOOLDIR := $(TOOLS_PATH)/bpf/bpftool 146 @if ! (${LLC} -march=bpf -mattr=help > /dev/null 2>&1); then \ 198 $(obj)/%.bpf.o: $(src)/%.bpf.c $(EXTRA_BPF_HEADERS_SRC) $(obj)/vmlinux.h 200 $(Q)$(CLANG) -g -O2 --target=bpf -D__TARGET_ARCH_$(SRCARCH) \ 202 -I$(srctree)/samples/bpf -I$(srctree)/tools/include \ 204 -c $(filter %.bpf.c,$^) -o $@ 209 hid_mouse.skel.h-deps := hid_mouse.bpf.o [all …]
|
/linux-6.12.1/net/core/ |
D | lwt_bpf.c | 120 struct bpf_lwt *bpf; in bpf_input() local 123 bpf = bpf_lwt_lwtunnel(dst->lwtstate); in bpf_input() 124 if (bpf->in.prog) { in bpf_input() 125 ret = run_lwt_bpf(skb, &bpf->in, dst, NO_REDIRECT); in bpf_input() 143 struct bpf_lwt *bpf; in bpf_output() local 146 bpf = bpf_lwt_lwtunnel(dst->lwtstate); in bpf_output() 147 if (bpf->out.prog) { in bpf_output() 148 ret = run_lwt_bpf(skb, &bpf->out, dst, NO_REDIRECT); in bpf_output() 155 bpf->out.name); in bpf_output() 272 struct bpf_lwt *bpf; in bpf_xmit() local [all …]
|
/linux-6.12.1/kernel/bpf/ |
D | net_namespace.c | 61 run_array = rcu_replace_pointer(net->bpf.run_array[type], NULL, in netns_bpf_run_array_detach() 72 list_for_each_entry(pos, &net->bpf.links[type], node) { in link_index() 85 list_for_each(pos, &net->bpf.links[type]) in link_count() 96 list_for_each_entry(pos, &net->bpf.links[type], node) { in fill_prog_array() 134 old_array = rcu_dereference_protected(net->bpf.run_array[type], in bpf_netns_link_release() 142 rcu_assign_pointer(net->bpf.run_array[type], new_array); in bpf_netns_link_release() 189 run_array = rcu_dereference_protected(net->bpf.run_array[type], in bpf_netns_link_update_prog() 255 run_array = rcu_dereference_protected(net->bpf.run_array[type], in __netns_bpf_prog_query() 316 if (!list_empty(&net->bpf.links[type])) { in netns_bpf_prog_attach() 332 attached = net->bpf.progs[type]; in netns_bpf_prog_attach() [all …]
|
D | cgroup.c | 99 ret = bpf_prog_run_array_cg(&cgrp->bpf, in __cgroup_bpf_run_lsm_sock() 121 ret = bpf_prog_run_array_cg(&cgrp->bpf, in __cgroup_bpf_run_lsm_socket() 140 ret = bpf_prog_run_array_cg(&cgrp->bpf, in __cgroup_bpf_run_lsm_current() 212 percpu_ref_kill(&cgrp->bpf.refcnt); in cgroup_bpf_offline() 295 bpf.release_work); in cgroup_bpf_release() 297 struct list_head *storages = &cgrp->bpf.storages; in cgroup_bpf_release() 304 for (atype = 0; atype < ARRAY_SIZE(cgrp->bpf.progs); atype++) { in cgroup_bpf_release() 305 struct hlist_head *progs = &cgrp->bpf.progs[atype]; in cgroup_bpf_release() 325 cgrp->bpf.effective[atype], in cgroup_bpf_release() 340 percpu_ref_exit(&cgrp->bpf.refcnt); in cgroup_bpf_release() [all …]
|
/linux-6.12.1/samples/seccomp/ |
D | Makefile | 2 userprogs-always-y += bpf-fancy dropper bpf-direct user-trap 4 bpf-fancy-objs := bpf-fancy.o bpf-helper.o
|
/linux-6.12.1/tools/sched_ext/ |
D | Makefile | 45 BPFDIR := $(LIBDIR)/bpf 47 BPFTOOLDIR := $(TOOLSDIR)/bpf/bpftool 120 -I$(CURDIR)/include -I$(CURDIR)/include/bpf-compat \ 137 $(APIDIR)/linux/bpf.h \ 162 $(SCXOBJ_DIR)/%.bpf.o: %.bpf.c $(INCLUDE_DIR)/vmlinux.h include/scx/*.h \ 165 $(Q)$(CLANG) $(BPF_CFLAGS) -target bpf -c $< -o $@ 167 $(INCLUDE_DIR)/%.bpf.skel.h: $(SCXOBJ_DIR)/%.bpf.o $(INCLUDE_DIR)/vmlinux.h $(BPFTOOL) 174 $(Q)$(BPFTOOL) gen skeleton $(<:.o=.linked3.o) name $(subst .bpf.skel.h,,$(sched)) > $@ 175 …$(Q)$(BPFTOOL) gen subskeleton $(<:.o=.linked3.o) name $(subst .bpf.skel.h,,$(sched)) > $(@:.skel.… 183 $(filter-out %.bpf.c,%.c) \ [all …]
|
/linux-6.12.1/Documentation/userspace-api/ebpf/ |
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-6.12.1/Documentation/translations/zh_CN/userspace-api/ebpf/ |
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-6.12.1/Documentation/bpf/ |
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 …]
|
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-6.12.1/tools/testing/selftests/sched_ext/ |
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-6.12.1/kernel/bpf/preload/iterators/ |
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) \
|