]> www.infradead.org Git - users/jedix/linux-maple.git/commit
bpf: Add BPF_SOCK_OPS_TSTAMP_ACK_CB callback
authorJason Xing <kerneljasonxing@gmail.com>
Thu, 20 Feb 2025 07:29:37 +0000 (15:29 +0800)
committerMartin KaFai Lau <martin.lau@kernel.org>
Thu, 20 Feb 2025 22:29:43 +0000 (14:29 -0800)
commitb3b81e6b009dd8f85cd3b9c65eb492249c2649a8
treeab5f6727c4276805bf7dc4b773c2b2636a4e66d0
parent2deaf7f42b8c551e84da20483ca2d4a65c3623b3
bpf: Add BPF_SOCK_OPS_TSTAMP_ACK_CB callback

Support the ACK case for bpf timestamping.

Add a new sock_ops callback, BPF_SOCK_OPS_TSTAMP_ACK_CB. This
callback will occur at the same timestamping point as the user
space's SCM_TSTAMP_ACK. The BPF program can use it to get the
same SCM_TSTAMP_ACK timestamp without modifying the user-space
application.

This patch extends txstamp_ack to two bits: 1 stands for
SO_TIMESTAMPING mode, 2 bpf extension.

Signed-off-by: Jason Xing <kerneljasonxing@gmail.com>
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Link: https://patch.msgid.link/20250220072940.99994-10-kerneljasonxing@gmail.com
include/net/tcp.h
include/uapi/linux/bpf.h
net/core/skbuff.c
net/ipv4/tcp.c
tools/include/uapi/linux/bpf.h