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 /include/net/tcp.h | |
| 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 'include/net/tcp.h')
| -rw-r--r-- | include/net/tcp.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/include/net/tcp.h b/include/net/tcp.h index 94ea09faedf4..ae6c95b01012 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h @@ -964,10 +964,12 @@ struct tcp_skb_cb { __u8 sacked; /* State flags for SACK. */ __u8 ip_dsfield; /* IPv4 tos or IPv6 dsfield */ - __u8 txstamp_ack:1, /* Record TX timestamp for ack? */ +#define TSTAMP_ACK_SK 0x1 +#define TSTAMP_ACK_BPF 0x2 + __u8 txstamp_ack:2, /* Record TX timestamp for ack? */ eor:1, /* Is skb MSG_EOR marked? */ has_rxtstamp:1, /* SKB has a RX timestamp */ - unused:5; + unused:4; __u32 ack_seq; /* Sequence number ACK'd */ union { struct { |
