History

Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next

Daniel Borkmann says: ==================== pull-request: bpf-next 2019-10-27 The following pull-request contains BPF updates for your *net-next* tree. We've added 52 non-merge commits during the last 11 day(s) which contain a total of 65 files changed, 2604 insertions(+), 1100 deletions(-). The main changes are: 1) Revolutionize BPF tracing by using in-kernel BTF to type check BPF assembly code. The work here teaches BPF verifier to recognize kfree_skb()'s first argument as 'struct sk_buff *' in tracepoints such that verifier allows direct use of bpf_skb_event_output() helper used in tc BPF et al (w/o probing memory access) that dumps skb data into perf ring buffer. Also add direct loads to probe memory in order to speed up/replace bpf_probe_read() calls, from Alexei Starovoitov. 2) Big batch of changes to improve libbpf and BPF kselftests. Besides others: generalization of libbpf's CO-RE relocation support to now also include field existence relocations, revamp the BPF kselftest Makefile to add test runner concept allowing to exercise various ways to build BPF programs, and teach bpf_object__open() and friends to automatically derive BPF program type/expected attach type from section names to ease their use, from Andrii Nakryiko. 3) Fix deadlock in stackmap's build-id lookup on rq_lock(), from Song Liu. 4) Allow to read BTF as raw data from bpftool. Most notable use case is to dump /sys/kernel/btf/vmlinux through this, from Jiri Olsa. 5) Use bpf_redirect_map() helper in libbpf's AF_XDP helper prog which manages to improve "rx_drop" performance by ~4%., from Björn Töpel. 6) Fix to restore the flow dissector after reattach BPF test and also fix error handling in bpf_helper_defs.h generation, from Jakub Sitnicki. 7) Improve verifier's BTF ctx access for use outside of raw_tp, from Martin KaFai Lau. 8) Improve documentation for AF_XDP with new sections and to reflect latest features, from Magnus Karlsson. 9) Add back 'version' section parsing to libbpf for old kernels, from John Fastabend. 10) Fix strncat bounds error in libbpf's libbpf_prog_type_by_name(), from KP Singh. 11) Turn on -mattr=+alu32 in LLVM by default for BPF kselftests in order to improve insn coverage for built BPF progs, from Yonghong Song. 12) Misc minor cleanups and fixes, from various others. ====================

David S. Miller committed 7 years ago

Commit 5b7fe932 parents b951248 027cbaa65 files · +2604 −1100Browse files

Showing the changes to include/uapi/linux (1 of 65 files). Show all

Unified · Split

include/uapi/linux/bpf.h+27−1
@@ -420,6 +420,7 @@ union bpf_attr { · 419 unmodified lines
420 __u32 line_info_rec_size; /* userspace bpf_line_info size */420 __u32 line_info_rec_size; /* userspace bpf_line_info size */
421 __aligned_u64 line_info; /* line info */421 __aligned_u64 line_info; /* line info */
422 __u32 line_info_cnt; /* number of bpf_line_info records */422 __u32 line_info_cnt; /* number of bpf_line_info records */
423 __u32 attach_btf_id; /* in-kernel BTF type id to attach to */
423 };424 };
424 425
425 struct { /* anonymous struct used by BPF_OBJ_* commands */426 struct { /* anonymous struct used by BPF_OBJ_* commands */
@@ -2750,6 +2751,30 @@ union bpf_attr { · 2324 unmodified lines
2750 * **-EOPNOTSUPP** kernel configuration does not enable SYN cookies2751 * **-EOPNOTSUPP** kernel configuration does not enable SYN cookies
2751 *2752 *
2752 * **-EPROTONOSUPPORT** IP packet version is not 4 or 62753 * **-EPROTONOSUPPORT** IP packet version is not 4 or 6
2754 *
2755 * int bpf_skb_output(void *ctx, struct bpf_map *map, u64 flags, void *data, u64 size)
2756 * Description
2757 * Write raw *data* blob into a special BPF perf event held by
2758 * *map* of type **BPF_MAP_TYPE_PERF_EVENT_ARRAY**. This perf
2759 * event must have the following attributes: **PERF_SAMPLE_RAW**
2760 * as **sample_type**, **PERF_TYPE_SOFTWARE** as **type**, and
2761 * **PERF_COUNT_SW_BPF_OUTPUT** as **config**.
2762 *
2763 * The *flags* are used to indicate the index in *map* for which
2764 * the value must be put, masked with **BPF_F_INDEX_MASK**.
2765 * Alternatively, *flags* can be set to **BPF_F_CURRENT_CPU**
2766 * to indicate that the index of the current CPU core should be
2767 * used.
2768 *
2769 * The value to write, of *size*, is passed through eBPF stack and
2770 * pointed by *data*.
2771 *
2772 * *ctx* is a pointer to in-kernel struct sk_buff.
2773 *
2774 * This helper is similar to **bpf_perf_event_output**\ () but
2775 * restricted to raw_tracepoint bpf programs.
2776 * Return
2777 * 0 on success, or a negative error in case of failure.
2753 */2778 */
2754#define __BPF_FUNC_MAPPER(FN) \2779#define __BPF_FUNC_MAPPER(FN) \
2755 FN(unspec), \2780 FN(unspec), \
@@ -2862,7 +2887,8 @@ union bpf_attr { · 106 unmodified lines
2862 FN(sk_storage_get), \2887 FN(sk_storage_get), \
2863 FN(sk_storage_delete), \2888 FN(sk_storage_delete), \
2864 FN(send_signal), \2889 FN(send_signal), \
2865 FN(tcp_gen_syncookie),2890 FN(tcp_gen_syncookie), \
2891 FN(skb_output),
2866 2892
2867/* integer value in 'imm' field of BPF_CALL instruction selects which helper2893/* integer value in 'imm' field of BPF_CALL instruction selects which helper
2868 * function eBPF program intends to call2894 * function eBPF program intends to call