aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/net/ipv4/tcp.c
diff options
context:
space:
mode:
authorJason Xing <kerneljasonxing@gmail.com>2025-02-20 15:29:37 +0800
committerMartin KaFai Lau <martin.lau@kernel.org>2025-02-20 14:29:43 -0800
commitb3b81e6b009dd8f85cd3b9c65eb492249c2649a8 (patch)
treeab5f6727c4276805bf7dc4b773c2b2636a4e66d0 /net/ipv4/tcp.c
parentbpf: Add BPF_SOCK_OPS_TSTAMP_SND_HW_CB callback (diff)
downloadwireguard-linux-b3b81e6b009dd8f85cd3b9c65eb492249c2649a8.tar.xz
wireguard-linux-b3b81e6b009dd8f85cd3b9c65eb492249c2649a8.zip
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
Diffstat (limited to 'net/ipv4/tcp.c')
-rw-r--r--net/ipv4/tcp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 992d5c9b2487..2171e2f045bb 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -492,7 +492,7 @@ static void tcp_tx_timestamp(struct sock *sk, struct sockcm_cookie *sockc)
sock_tx_timestamp(sk, sockc, &shinfo->tx_flags);
if (tsflags & SOF_TIMESTAMPING_TX_ACK)
- tcb->txstamp_ack = 1;
+ tcb->txstamp_ack |= TSTAMP_ACK_SK;
if (tsflags & SOF_TIMESTAMPING_TX_RECORD_MASK)
shinfo->tskey = TCP_SKB_CB(skb)->seq + skb->len - 1;
}