aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorVadim Fedorenko <vfedorenko@novek.ru>2021-09-10 01:04:08 +0300
committerAndrii Nakryiko <andrii.nakryiko@gmail.com>2021-09-17 14:03:39 -0700
commit03f31a6aed6c483583ec430fedc407a0464093a0 (patch)
treea299d5f0c98943a01893d7dc5163bb3d4ee61e78 /include
parentf8983f7fb04745abe513fd2dad57157497a1221f (diff)
downloadlibbpf-03f31a6aed6c483583ec430fedc407a0464093a0.tar.gz
bpf: Add hardware timestamp field to __sk_buff
BPF programs may want to know hardware timestamps if NIC supports such timestamping. Expose this data as hwtstamp field of __sk_buff the same way as gso_segs/gso_size. This field could be accessed from the same programs as tstamp field, but it's read-only field. Explicit test to deny access to padding data is added to bpf_skb_is_valid_access. Also update BPF_PROG_TEST_RUN tests of the feature. Signed-off-by: Vadim Fedorenko <vfedorenko@novek.ru> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Acked-by: Martin KaFai Lau <kafai@fb.com> Link: https://lore.kernel.org/bpf/20210909220409.8804-2-vfedorenko@novek.ru
Diffstat (limited to 'include')
-rw-r--r--include/uapi/linux/bpf.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
index 791f31d..51cfd91 100644
--- a/include/uapi/linux/bpf.h
+++ b/include/uapi/linux/bpf.h
@@ -5284,6 +5284,8 @@ struct __sk_buff {
__u32 gso_segs;
__bpf_md_ptr(struct bpf_sock *, sk);
__u32 gso_size;
+ __u32 :32; /* Padding, future use. */
+ __u64 hwtstamp;
};
struct bpf_tunnel_key {