Home
last modified time | relevance | path

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

12345678910>>...14

/openbmc/linux/drivers/net/ethernet/netronome/nfp/bpf/
H A Dmain.c27 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 Dcmsg.c18 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 …]
H A Doffload.c9 #define pr_fmt(fmt) "NFP net bpf: " fmt
11 #include <linux/bpf.h>
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_pro in nfp_map_ptrs_record()
332 nfp_bpf_map_alloc(struct nfp_app_bpf * bpf,struct bpf_offloaded_map * offmap) nfp_bpf_map_alloc() argument
410 nfp_bpf_map_free(struct nfp_app_bpf * bpf,struct bpf_offloaded_map * offmap) nfp_bpf_map_free() argument
425 nfp_ndo_bpf(struct nfp_app * app,struct nfp_net * nn,struct netdev_bpf * bpf) nfp_ndo_bpf() argument
445 nfp_bpf_event_output(struct nfp_app_bpf * bpf,const void * data,unsigned int len) nfp_bpf_event_output() argument
[all...]
H A Dmain.h21 #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,
/openbmc/linux/samples/bpf/
H A DMakefile51 LIBBPF_SRC = $(TOOLS_PATH)/lib/bpf
57 CGROUP_HELPERS := ../../tools/testing/selftests/bpf/cgroup_helpers.o
58 TRACE_HELPERS := ../../tools/testing/selftests/bpf/trace_helpers.o
107 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
[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;)
42 ifneq ($(shell $(CLANG) --target=bpf -mcpu=help 2>&1 | grep 'v4'),)
75 TEST_GEN_FILES = test_lwt_ip_encap.bpf.o test_tc_edt.bpf.o
245 $(Q)$(MAKE) $(submake_extras) -C $(TOOLSDIR)/bpf/runqslower \
319 $(APIDIR)/linux/bpf.h \
328 $(APIDIR)/linux/bpf.h \
347 $(TOOLSDIR)/bpf/resolve_btfids/main.c \
353 $(Q)$(MAKE) $(submake_extras) -C $(TOOLSDIR)/bpf/resolve_btfids \
[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/samples/hid/
H A DMakefile13 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 hid_bpf_attach.bpf.o
[all …]
/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/linux/drivers/net/netdevsim/
H A Dbpf.c180 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 …]
/openbmc/linux/net/core/
H A Dlwt_bpf.c118 struct bpf_lwt *bpf; in bpf_input() local
121 bpf = bpf_lwt_lwtunnel(dst->lwtstate); in bpf_input()
122 if (bpf->in.prog) { in bpf_input()
123 ret = run_lwt_bpf(skb, &bpf->in, dst, NO_REDIRECT); in bpf_input()
141 struct bpf_lwt *bpf; in bpf_output() local
144 bpf = bpf_lwt_lwtunnel(dst->lwtstate); in bpf_output()
145 if (bpf->out.prog) { in bpf_output()
146 ret = run_lwt_bpf(skb, &bpf->out, dst, NO_REDIRECT); in bpf_output()
153 bpf->out.name); in bpf_output()
270 struct bpf_lwt *bpf; in bpf_xmit() local
[all …]
/openbmc/openbmc/meta-openembedded/meta-oe/recipes-kernel/kernel-selftest/
H A Dkernel-selftest.bb18 # now we just test bpf and vm
20 # bpf was added in 4.10 with: https://github.com/torvalds/linux/commit/5aa5bd14c5f8660c64ceedf14a54…
23 # bpf needs working clang compiler anyway
24 PACKAGECONFIG:append:toolchain-clang:x86-64 = " bpf"
25 PACKAGECONFIG:remove:x86 = "bpf"
26 PACKAGECONFIG:remove:arm = "bpf vm"
31 PACKAGECONFIG:remove:qemumips = "bpf vm"
34 PACKAGECONFIG:remove:riscv64 = "bpf vm"
35 PACKAGECONFIG:remove:riscv32 = "bpf vm"
37 PACKAGECONFIG[bpf] = ",,elfutils elfutils-native libcap libcap-ng rsync-native python3-docutils-nat…
[all …]
/openbmc/linux/kernel/bpf/
H A Dnet_namespace.c61 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 …]
H A Dcgroup.c99 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 …]
/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/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/Documentation/bpf/
H A Dbpf_devel_QA.rst23 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 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 …]
/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)
58 $(OUTPUT)/runqslower.bpf.o | libbpf_hdrs
60 $(OUTPUT)/runqslower.bpf.o: $(OUTPUT)/vmlinux.h runqslower.h | libbpf_hdrs
62 $(OUTPUT)/%.skel.h: $(OUTPUT)/%.bpf.o | $(BPFTOOL)
65 $(OUTPUT)/%.bpf.o: %.bpf.c $(BPFOBJ) | $(OUTPUT)
66 $(QUIET_GEN)$(CLANG) -g -O2 --target=bpf $(INCLUDES) \
/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()
499 prog_list = rcu_dereference(hdev->bpf.progs[HID_BPF_PROG_TYPE_DEVICE_EVENT]); in hid_bpf_connect_device()
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()
[all …]
/openbmc/linux/arch/um/drivers/
H A Dvector_user.c754 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()
758 int err = setsockopt(fd, SOL_SOCKET, SO_ATTACH_FILTER, bpf, sizeof(struct sock_fprog)); in uml_vector_attach_bpf()
765 int uml_vector_detach_bpf(int fd, void *bpf) in uml_vector_detach_bpf() argument
767 struct sock_fprog *prog = bpf; in uml_vector_detach_bpf()
769 int err = setsockopt(fd, SOL_SOCKET, SO_DETACH_FILTER, bpf, sizeof(struct sock_fprog)); 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()
[all …]

12345678910>>...14