diff options
| author | Jason Xing <[email protected]> | 2025-02-20 07:29:37 +0000 |
|---|---|---|
| committer | Martin KaFai Lau <[email protected]> | 2025-02-20 22:29:43 +0000 |
| commit | b3b81e6b009dd8f85cd3b9c65eb492249c2649a8 (patch) | |
| tree | ab5f6727c4276805bf7dc4b773c2b2636a4e66d0 /net/ipv4/tcp.c | |
| parent | bpf: Add BPF_SOCK_OPS_TSTAMP_SND_HW_CB callback (diff) | |
| download | kernel-b3b81e6b009dd8f85cd3b9c65eb492249c2649a8.tar.gz kernel-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 <[email protected]>
Signed-off-by: Martin KaFai Lau <[email protected]>
Reviewed-by: Willem de Bruijn <[email protected]>
Link: https://patch.msgid.link/[email protected]
Diffstat (limited to 'net/ipv4/tcp.c')
| -rw-r--r-- | net/ipv4/tcp.c | 2 |
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; } |
