Home
last modified time | relevance | path

Searched refs:bpf (Results 1 – 25 of 344) sorted by relevance

12345678910>>...14

/openbmc/linux/drivers/net/ethernet/netronome/nfp/bpf/
H A Dmain.c223 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 …]
H A Dcmsg.c34 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 …]
H A Doffload.c139 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 …]
/openbmc/linux/samples/bpf/
H A DMakefile107 always-y += tracex1.bpf.o
108 always-y += tracex2.bpf.o
109 always-y += tracex3.bpf.o
110 always-y += tracex4.bpf.o
111 always-y += tracex5.bpf.o
112 always-y += tracex6.bpf.o
113 always-y += tracex7.bpf.o
352 $(obj)/xdp_router_ipv4.bpf.o: $(obj)/xdp_sample.bpf.o
354 $(obj)/%.bpf.o: $(src)/%.bpf.c $(obj)/vmlinux.h $(src)/xdp_sample.bpf.h $(src)/xdp_sample_shared.h
365 xdp_router_ipv4.skel.h-deps := xdp_router_ipv4.bpf.o xdp_sample.bpf.o
[all …]
/openbmc/linux/tools/testing/selftests/bpf/
H A Dtest_bpftool_build.sh23 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
H A DMakefile11 BPFDIR := $(LIBDIR)/bpf
13 BPFTOOLDIR := $(TOOLSDIR)/bpf/bpftool
27 BPF_GCC ?= $(shell command -v bpf-gcc;)
66 TEST_GEN_FILES = test_lwt_ip_encap.bpf.o test_tc_edt.bpf.o
426 test_static_linked.skel.h-deps := test_static_linked1.bpf.o test_static_linked2.bpf.o
427 linked_funcs.skel.h-deps := linked_funcs1.bpf.o linked_funcs2.bpf.o
428 linked_vars.skel.h-deps := linked_vars1.bpf.o linked_vars2.bpf.o
429 linked_maps.skel.h-deps := linked_maps1.bpf.o linked_maps2.bpf.o
432 …_subskeleton.skel.h-deps := test_subskeleton_lib2.bpf.o test_subskeleton_lib.bpf.o test_subskeleto…
433 test_subskeleton_lib.skel.h-deps := test_subskeleton_lib2.bpf.o test_subskeleton_lib.bpf.o
[all …]
H A Dtest_flow_dissector.sh27 $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
/openbmc/linux/tools/bpf/bpftool/Documentation/
H A Dbpftool-iter.rst35 A bpf iterator combines a kernel iterating of
37 and a bpf program called for each kernel data object
41 The *pin* command creates a bpf iterator from *OBJ*,
47 Map element bpf iterator requires an additional parameter
48 *MAP* so bpf program can iterate over map elements for
49 that map. User can have a bpf program in kernel to run
53 User can then *cat PATH* to see the bpf iterator output.
64 **# bpftool iter pin bpf_iter_netlink.o /sys/fs/bpf/my_netlink**
68 Create a file-based bpf iterator from bpf_iter_netlink.o and pin it
69 to /sys/fs/bpf/my_netlink
[all …]
H A Dbpftool-net.rst7 tool for inspection of networking related bpf prog attachments
38 List bpf program attachments in the kernel networking subsystem.
52 bpf programs, users should consult other tools, e.g., iproute2.
55 all tcx, then tc class/qdisc bpf program attachments, then flow_dissector
57 ordered based on ifindex number. If multiple bpf programs attached
59 all bpf programs attached to tcx, then tc classes, then all bpf programs
60 attached to non clsact qdiscs, and finally all bpf programs attached
64 Attach bpf program *PROG* to network interface *NAME* with
65 type specified by *ATTACH_TYPE*. Previously attached bpf program
76 Detach bpf program attached to network interface *NAME* with
[all …]
/openbmc/openbmc/poky/meta/recipes-kernel/systemtap/systemtap/
H A D0001-bpf-translate.cxx-fix-build-against-upcoming-gcc-14-.patch4 Subject: [PATCH] bpf-translate.cxx: fix build against upcoming `gcc-14`
10bpf-translate.cxx: In function 'bpf::BPF_Section* bpf::output_probe(BPF_Output&, program&, const s…
11bpf-translate.cxx:5044:39: error: 'void* calloc(size_t, size_t)' sizes specified with 'sizeof' in …
14bpf-translate.cxx:5044:39: note: earlier argument should specify number of elements, later size of…
19 bpf-translate.cxx | 4 ++--
22 diff --git a/bpf-translate.cxx b/bpf-translate.cxx
24 --- a/bpf-translate.cxx
25 +++ b/bpf-translate.cxx
/openbmc/linux/samples/hid/
H A DMakefile13 LIBBPF_SRC = $(TOOLS_PATH)/lib/bpf
121 BPFTOOLDIR := $(TOOLS_PATH)/bpf/bpftool
199 $(obj)/%.bpf.o: $(src)/%.bpf.c $(EXTRA_BPF_HEADERS_SRC) $(obj)/vmlinux.h
205 -c $(filter %.bpf.c,$^) -o $@
210 hid_mouse.skel.h-deps := hid_mouse.bpf.o hid_bpf_attach.bpf.o
211 hid_surface_dial.skel.h-deps := hid_surface_dial.bpf.o hid_bpf_attach.bpf.o
213 LINKED_BPF_SRCS := $(patsubst %.bpf.o,%.bpf.c,$(foreach skel,$(LINKED_SKELS),$($(skel)-deps)))
216 BPF_OBJS_LINKED := $(patsubst %.bpf.c,$(obj)/%.bpf.o, $(BPF_SRCS_LINKED))
236 -I$(obj) -I$(srctree)/tools/testing/selftests/bpf/ \
246 $(OPT) -O2 -mtriple=bpf-pc-linux | $(LLVM_DIS) | \
[all …]
/openbmc/linux/drivers/net/netdevsim/
H A Dbpf.c207 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()
319 state = bpf->prog->aux->offload->dev_priv; in nsim_setup_prog_hw_checks()
554 switch (bpf->command) { in nsim_bpf()
556 err = nsim_setup_prog_checks(ns, bpf); in nsim_bpf()
562 err = nsim_setup_prog_hw_checks(ns, bpf); in nsim_bpf()
571 return nsim_bpf_map_alloc(ns, bpf->offmap); in nsim_bpf()
[all …]
/openbmc/qemu/tools/ebpf/
H A DMakefile.ebpf1 OBJS = rss.bpf.o
6 EXTRA_CFLAGS ?= -O2 -g -target bpf
14 rm -f rss.bpf.skeleton.h
22 bpftool gen skeleton rss.bpf.o > rss.bpf.skeleton.h
23 cp rss.bpf.skeleton.h ../../ebpf/
/openbmc/linux/samples/seccomp/
H A DMakefile2 userprogs-always-y += bpf-fancy dropper bpf-direct user-trap
4 bpf-fancy-objs := bpf-fancy.o bpf-helper.o
/openbmc/openbmc/meta-openembedded/meta-oe/recipes-kernel/kernel-selftest/
H A Dkernel-selftest.bb17 # now we just test bpf and vm
22 # bpf needs working clang compiler anyway
23 PACKAGECONFIG:append:toolchain-clang:x86-64 = " bpf"
24 PACKAGECONFIG:remove:x86 = "bpf"
25 PACKAGECONFIG:remove:arm = "bpf vm"
30 PACKAGECONFIG:remove:qemumips = "bpf vm"
33 PACKAGECONFIG:remove:riscv64 = "bpf vm"
34 PACKAGECONFIG:remove:riscv32 = "bpf vm"
50 ${@bb.utils.filter('PACKAGECONFIG', 'bpf firmware vm', d)} \
116 if [ -e ${D}/usr/kernel-selftest/bpf/test_offload.py ]; then
[all …]
/openbmc/linux/net/core/
H A Dlwt_bpf.c118 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()
270 struct bpf_lwt *bpf; in bpf_xmit() local
273 if (bpf->xmit.prog) { in bpf_xmit()
321 bpf_lwt_prog_destroy(&bpf->in); in bpf_destroy_state()
376 struct bpf_lwt *bpf; in bpf_build_state() local
395 bpf = bpf_lwt_lwtunnel(newts); in bpf_build_state()
[all …]
/openbmc/linux/kernel/bpf/
H A Dnet_namespace.c85 list_for_each(pos, &net->bpf.links[type]) in link_count()
316 if (!list_empty(&net->bpf.links[type])) { in netns_bpf_prog_attach()
332 attached = net->bpf.progs[type]; in netns_bpf_prog_attach()
353 net->bpf.progs[type] = prog; in netns_bpf_prog_attach()
371 if (!list_empty(&net->bpf.links[type])) in __netns_bpf_prog_detach()
374 attached = net->bpf.progs[type]; in __netns_bpf_prog_detach()
378 net->bpf.progs[type] = NULL; in __netns_bpf_prog_detach()
437 if (net->bpf.progs[type]) { in netns_bpf_link_attach()
534 INIT_LIST_HEAD(&net->bpf.links[type]); in netns_bpf_pernet_init()
551 if (net->bpf.progs[type]) in netns_bpf_pernet_pre_exit()
[all …]
H A Dcgroup.c278 bpf.release_work); in cgroup_bpf_release()
308 cgrp->bpf.effective[atype], in cgroup_bpf_release()
529 desc->bpf.inactive = NULL; in update_effective_progs()
535 desc->bpf.inactive = NULL; in update_effective_progs()
548 desc->bpf.inactive = NULL; in update_effective_progs()
764 head = &cg->bpf.progs[atype]; in replace_effective_prog()
776 desc->bpf.effective[atype], in replace_effective_prog()
916 head = &cg->bpf.progs[atype]; in purge_effective_progs()
930 desc->bpf.effective[atype], in purge_effective_progs()
970 flags = cgrp->bpf.flags[atype]; in __cgroup_bpf_detach()
[all …]
/openbmc/linux/Documentation/userspace-api/ebpf/
H A Dsyscall.rst10 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
/openbmc/linux/Documentation/translations/zh_CN/userspace-api/ebpf/
H A Dsyscall.rst18 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
/openbmc/linux/kernel/bpf/preload/iterators/
H A DMakefile10 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) \
/openbmc/linux/tools/bpf/runqslower/
H A DMakefile9 LIBBPF_SRC := $(abspath ../../lib/bpf)
57 $(OUTPUT)/runqslower.bpf.o | libbpf_hdrs
59 $(OUTPUT)/runqslower.bpf.o: $(OUTPUT)/vmlinux.h runqslower.h | libbpf_hdrs
61 $(OUTPUT)/%.skel.h: $(OUTPUT)/%.bpf.o | $(BPFTOOL)
64 $(OUTPUT)/%.bpf.o: %.bpf.c $(BPFOBJ) | $(OUTPUT)
65 $(QUIET_GEN)$(CLANG) -g -O2 --target=bpf $(INCLUDES) \
/openbmc/linux/Documentation/bpf/
H A Dprog_lsm.rst23 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 …]
H A Dbpf_devel_QA.rst27 bpf@vger.kernel.org
62 kernel-patches/bpf's bpf-next_base or bpf_base branch, respectively
78 bpf@vger.kernel.org
108 the 'bpf' delegate).
116 * https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf.git/
117 * https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/
119 The bpf tree itself is for fixes only, whereas bpf-next for features,
155 maintainers know whether it is targeted at bpf or bpf-next.
173 If it is clear that patches should go into bpf or bpf-next tree,
225 accumulate too many patches in bpf or bpf-next.
[all …]
/openbmc/linux/drivers/hid/bpf/
H A Dhid_bpf_dispatch.c56 .allocated_size = hdev->bpf.allocated_data, in dispatch_hid_bpf_device_event()
59 .data = hdev->bpf.device_data, in dispatch_hid_bpf_device_event()
67 if (!hdev->bpf.device_data) in dispatch_hid_bpf_device_event()
70 memset(ctx_kern.data, 0, hdev->bpf.allocated_data); in dispatch_hid_bpf_device_event()
230 if (hdev->bpf.device_data) in hid_bpf_allocate_event_data()
233 return __hid_bpf_allocate_data(hdev, &hdev->bpf.device_data, &hdev->bpf.allocated_data); in hid_bpf_allocate_event_data()
512 kfree(hdev->bpf.device_data); in hid_bpf_disconnect_device()
513 hdev->bpf.device_data = NULL; in hid_bpf_disconnect_device()
514 hdev->bpf.allocated_data = 0; in hid_bpf_disconnect_device()
524 hdev->bpf.destroyed = true; in hid_bpf_destroy_device()
[all …]

12345678910>>...14