History

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

Daniel Borkmann says: ==================== pull-request: bpf-next 2020-02-21 The following pull-request contains BPF updates for your *net-next* tree. We've added 25 non-merge commits during the last 4 day(s) which contain a total of 33 files changed, 2433 insertions(+), 161 deletions(-). The main changes are: 1) Allow for adding TCP listen sockets into sock_map/hash so they can be used with reuseport BPF programs, from Jakub Sitnicki. 2) Add a new bpf_program__set_attach_target() helper for adding libbpf support to specify the tracepoint/function dynamically, from Eelco Chaudron. 3) Add bpf_read_branch_records() BPF helper which helps use cases like profile guided optimizations, from Daniel Xu. 4) Enable bpf_perf_event_read_value() in all tracing programs, from Song Liu. 5) Relax BTF mandatory check if only used for libbpf itself e.g. to process BTF defined maps, from Andrii Nakryiko. 6) Move BPF selftests -mcpu compilation attribute from 'probe' to 'v3' as it has been observed that former fails in envs with low memlock, from Yonghong Song. ====================

David S. Miller committed 6 years ago

Commit b105e8e2 parents e65ee2f eb1e14733 files · +2433 −161Browse files

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

Unified · Split

include/uapi/linux/bpf.h+24−1
@@ -2890,6 +2890,25 @@ union bpf_attr { · 2889 unmodified lines
2890 * Obtain the 64bit jiffies2890 * Obtain the 64bit jiffies
2891 * Return2891 * Return
2892 * The 64 bit jiffies2892 * The 64 bit jiffies
2893 *
2894 * int bpf_read_branch_records(struct bpf_perf_event_data *ctx, void *buf, u32 size, u64 flags)
2895 * Description
2896 * For an eBPF program attached to a perf event, retrieve the
2897 * branch records (struct perf_branch_entry) associated to *ctx*
2898 * and store it in the buffer pointed by *buf* up to size
2899 * *size* bytes.
2900 * Return
2901 * On success, number of bytes written to *buf*. On error, a
2902 * negative value.
2903 *
2904 * The *flags* can be set to **BPF_F_GET_BRANCH_RECORDS_SIZE** to
2905 * instead return the number of bytes required to store all the
2906 * branch entries. If this flag is set, *buf* may be NULL.
2907 *
2908 * **-EINVAL** if arguments invalid or **size** not a multiple
2909 * of sizeof(struct perf_branch_entry).
2910 *
2911 * **-ENOENT** if architecture does not support branch records.
2893 */2912 */
2894#define __BPF_FUNC_MAPPER(FN) \2913#define __BPF_FUNC_MAPPER(FN) \
2895 FN(unspec), \2914 FN(unspec), \
@@ -3010,7 +3029,8 @@ union bpf_attr { · 114 unmodified lines
3010 FN(probe_read_kernel_str), \3029 FN(probe_read_kernel_str), \
3011 FN(tcp_send_ack), \3030 FN(tcp_send_ack), \
3012 FN(send_signal_thread), \3031 FN(send_signal_thread), \
3013 FN(jiffies64),3032 FN(jiffies64), \
3033 FN(read_branch_records),
3014 3034
3015/* integer value in 'imm' field of BPF_CALL instruction selects which helper3035/* integer value in 'imm' field of BPF_CALL instruction selects which helper
3016 * function eBPF program intends to call3036 * function eBPF program intends to call
@@ -3089,6 +3109,9 @@ enum bpf_func_id { · 72 unmodified lines
3089/* BPF_FUNC_sk_storage_get flags */3109/* BPF_FUNC_sk_storage_get flags */
3090#define BPF_SK_STORAGE_GET_F_CREATE (1ULL << 0)3110#define BPF_SK_STORAGE_GET_F_CREATE (1ULL << 0)
3091 3111
3112/* BPF_FUNC_read_branch_records flags. */
3113#define BPF_F_GET_BRANCH_RECORDS_SIZE (1ULL << 0)
3114
3092/* Mode for BPF_FUNC_skb_adjust_room helper. */3115/* Mode for BPF_FUNC_skb_adjust_room helper. */
3093enum bpf_adj_room_mode {3116enum bpf_adj_room_mode {
3094 BPF_ADJ_ROOM_NET,3117 BPF_ADJ_ROOM_NET,