Home
last modified time | relevance | path

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

1234567891011

/Linux-v6.1/drivers/net/ethernet/netronome/nfp/bpf/
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 …]
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 …]
Doffload.c31 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 …]
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,
/Linux-v6.1/tools/testing/selftests/bpf/
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
DMakefile11 BPFDIR := $(LIBDIR)/bpf
13 BPFTOOLDIR := $(TOOLSDIR)/bpf/bpftool
23 BPF_GCC ?= $(shell command -v bpf-gcc;)
49 TEST_GEN_FILES = test_lwt_ip_encap.bpf.o test_tc_edt.bpf.o
209 $(Q)$(MAKE) $(submake_extras) -C $(TOOLSDIR)/bpf/runqslower \
268 $(APIDIR)/linux/bpf.h \
276 $(APIDIR)/linux/bpf.h \
294 $(TOOLSDIR)/bpf/resolve_btfids/main.c \
300 $(Q)$(MAKE) $(submake_extras) -C $(TOOLSDIR)/bpf/resolve_btfids \
342 $(Q)$(CLANG) $3 -O2 -target bpf -c $1 -mcpu=v3 -o $2
[all …]
Dtest_flow_dissector.sh25 $bpftool prog loadall ./bpf_flow.o /sys/fs/bpf/flow \
29 /sys/fs/bpf/flow/_dissect flow_dissector; then
34 $bpftool prog attach pinned /sys/fs/bpf/flow/_dissect \
38 /sys/fs/bpf/flow/_dissect flow_dissector; then
44 /sys/fs/bpf/flow/_dissect flow_dissector; then
49 rm -rf /sys/fs/bpf/flow
89 if /bin/mount | grep /sys/fs/bpf > /dev/null; then
94 /bin/mount bpffs /sys/fs/bpf -t bpf
/Linux-v6.1/samples/bpf/
DMakefile61 LIBBPF_SRC = $(TOOLS_PATH)/lib/bpf
67 CGROUP_HELPERS := ../../tools/testing/selftests/bpf/cgroup_helpers.o
68 TRACE_HELPERS := ../../tools/testing/selftests/bpf/trace_helpers.o
198 TPROGS_CFLAGS += -I$(srctree)/tools/testing/selftests/bpf/
247 BTF_LLC_PROBE := $(shell $(LLC) -march=bpf -mattr=help 2>&1 | grep dwarfris)
251 $(CLANG) -target bpf -O2 -g -c -x c - -o ./llvm_btf_verify.o; \
283 BPFTOOLDIR := $(TOOLS_PATH)/bpf/bpftool
315 @if ! (${LLC} -march=bpf -mattr=help > /dev/null 2>&1); then \
347 -I$(src)/../../tools/testing/selftests/bpf
386 $(obj)/xdp_redirect_cpu.bpf.o: $(obj)/xdp_sample.bpf.o
[all …]
/Linux-v6.1/drivers/net/netdevsim/
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 …]
/Linux-v6.1/tools/bpf/bpftool/Documentation/
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 …]
Dbpftool-net.rst7 tool for inspection of netdev/tc related bpf prog attachments
38 List bpf program attachments in the kernel networking subsystem.
49 bpf programs, users should consult other tools, e.g., iproute2.
52 all tc class/qdisc bpf program attachments. Both xdp programs and
53 tc programs are ordered based on ifindex number. If multiple bpf
55 the order will be first all bpf programs attached to tc classes, then
56 all bpf programs attached to non clsact qdiscs, and finally all
57 bpf programs attached to root and clsact qdisc.
60 Attach bpf program *PROG* to network interface *NAME* with
61 type specified by *ATTACH_TYPE*. Previously attached bpf program
[all …]
/Linux-v6.1/net/core/
Dlwt_bpf.c119 struct bpf_lwt *bpf; in bpf_input() local
122 bpf = bpf_lwt_lwtunnel(dst->lwtstate); in bpf_input()
123 if (bpf->in.prog) { in bpf_input()
124 ret = run_lwt_bpf(skb, &bpf->in, dst, NO_REDIRECT); in bpf_input()
142 struct bpf_lwt *bpf; in bpf_output() local
145 bpf = bpf_lwt_lwtunnel(dst->lwtstate); in bpf_output()
146 if (bpf->out.prog) { in bpf_output()
147 ret = run_lwt_bpf(skb, &bpf->out, dst, NO_REDIRECT); in bpf_output()
154 bpf->out.name); in bpf_output()
271 struct bpf_lwt *bpf; in bpf_xmit() local
[all …]
/Linux-v6.1/kernel/bpf/
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 …]
Dcgroup.c82 ret = bpf_prog_run_array_cg(&cgrp->bpf, in __cgroup_bpf_run_lsm_sock()
104 ret = bpf_prog_run_array_cg(&cgrp->bpf, in __cgroup_bpf_run_lsm_socket()
123 ret = bpf_prog_run_array_cg(&cgrp->bpf, in __cgroup_bpf_run_lsm_current()
195 percpu_ref_kill(&cgrp->bpf.refcnt); in cgroup_bpf_offline()
278 bpf.release_work); in cgroup_bpf_release()
280 struct list_head *storages = &cgrp->bpf.storages; in cgroup_bpf_release()
287 for (atype = 0; atype < ARRAY_SIZE(cgrp->bpf.progs); atype++) { in cgroup_bpf_release()
288 struct hlist_head *progs = &cgrp->bpf.progs[atype]; in cgroup_bpf_release()
308 cgrp->bpf.effective[atype], in cgroup_bpf_release()
323 percpu_ref_exit(&cgrp->bpf.refcnt); in cgroup_bpf_release()
[all …]
/Linux-v6.1/samples/seccomp/
DMakefile2 userprogs-always-y += bpf-fancy dropper bpf-direct user-trap
4 bpf-fancy-objs := bpf-fancy.o bpf-helper.o
/Linux-v6.1/Documentation/userspace-api/ebpf/
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
/Linux-v6.1/Documentation/bpf/
Dbpf_devel_QA.rst23 loader development happens through the bpf kernel mailing list,
27 bpf@vger.kernel.org
49 A: Please submit your BPF patches to the bpf kernel mailing list:
51 bpf@vger.kernel.org
65 Those patches which target BPF, are assigned to a 'bpf' delegate for
81 the 'bpf' delegate).
89 * https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf.git/
90 * https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/
92 The bpf tree itself is for fixes only, whereas bpf-next for features,
94 analogous to net and net-next trees for networking. Both bpf and
[all …]
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 …]
/Linux-v6.1/kernel/bpf/preload/iterators/
DMakefile10 BPFTOOL_SRC := $(TOOLS_PATH)/bpf/bpftool
15 LIBBPF_SRC := $(TOOLS_PATH)/lib/bpf
44 iterators.lskel.h: $(OUTPUT)/iterators.bpf.o | $(BPFTOOL)
49 $(OUTPUT)/iterators.bpf.o: iterators.bpf.c $(BPFOBJ) | $(OUTPUT)
51 $(Q)$(CLANG) -g -O2 -target bpf $(INCLUDES) \
/Linux-v6.1/tools/bpf/runqslower/
DMakefile9 LIBBPF_SRC := $(abspath ../../lib/bpf)
55 $(OUTPUT)/runqslower.bpf.o | libbpf_hdrs
57 $(OUTPUT)/runqslower.bpf.o: $(OUTPUT)/vmlinux.h runqslower.h | libbpf_hdrs
59 $(OUTPUT)/%.skel.h: $(OUTPUT)/%.bpf.o | $(BPFTOOL)
62 $(OUTPUT)/%.bpf.o: %.bpf.c $(BPFOBJ) | $(OUTPUT)
63 $(QUIET_GEN)$(CLANG) -g -O2 -target bpf $(INCLUDES) \
/Linux-v6.1/arch/um/drivers/
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 …]
/Linux-v6.1/tools/bpf/bpftool/
DMakefile16 BPF_DIR = $(srctree)/tools/lib/bpf
28 LIBBPF_HDRS_DIR := $(LIBBPF_INCLUDE)/bpf
34 LIBBPF_BOOTSTRAP_HDRS_DIR := $(LIBBPF_BOOTSTRAP_INCLUDE)/bpf
79 -I$(srctree)/kernel/bpf/ \
98 clang-bpf-co-re
100 libcap clang-bpf-co-re
174 ifeq ($(feature-clang-bpf-co-re),1)
185 $(OUTPUT)%.bpf.o: skeleton/%.bpf.c $(OUTPUT)vmlinux.h $(LIBBPF_BOOTSTRAP)
190 -g -O2 -Wall -target bpf -c $< -o $@
193 $(OUTPUT)%.skel.h: $(OUTPUT)%.bpf.o $(BPFTOOL_BOOTSTRAP)
[all …]
/Linux-v6.1/tools/lib/bpf/
DMakefile145 @(test -f ../../include/uapi/linux/bpf.h -a -f ../../../include/uapi/linux/bpf.h && ( \
146 (diff -B ../../include/uapi/linux/bpf.h ../../../include/uapi/linux/bpf.h >/dev/null) || \
159 $(BPF_HELPER_DEFS): $(srctree)/tools/include/uapi/linux/bpf.h
161 --file $(srctree)/tools/include/uapi/linux/bpf.h > $(BPF_HELPER_DEFS)
240 SRC_HDRS := bpf.h libbpf.h btf.h libbpf_common.h libbpf_legacy.h \
242 skel_internal.h libbpf_version.h usdt.bpf.h
245 INSTALL_PFX := $(DESTDIR)$(prefix)/include/bpf
251 $(call do_install,$<,$(prefix)/include/bpf,644)
255 $(call do_install,$<,$(prefix)/include/bpf,644)
/Linux-v6.1/tools/perf/
DMANIFEST8 tools/lib/bpf
25 tools/bpf/bpftool
26 kernel/bpf/disasm.c
27 kernel/bpf/disasm.h
/Linux-v6.1/tools/perf/tests/shell/
Dstat_bpf_counters_cgrp.sh15 if ! perf stat -a --bpf-counters --for-each-cgroup / true > /dev/null 2>&1; then
18 perf --no-pager stat -a --bpf-counters --for-each-cgroup / true || true
53 …output=$(perf stat -a --bpf-counters --for-each-cgroup ${test_cgroups} -e cpu-clock -x, sleep 1 2…
67 …output=$(perf stat -C 1 --bpf-counters --for-each-cgroup ${test_cgroups} -e cpu-clock -x, taskset …

1234567891011