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/core/skbuff.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/core/skbuff.c')
| -rw-r--r-- | net/core/skbuff.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 77b8866f94c5..dd33c12f00ca 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -5550,7 +5550,7 @@ static bool skb_tstamp_tx_report_so_timestamping(struct sk_buff *skb, return skb_shinfo(skb)->tx_flags & (hwtstamps ? SKBTX_HW_TSTAMP_NOBPF : SKBTX_SW_TSTAMP); case SCM_TSTAMP_ACK: - return TCP_SKB_CB(skb)->txstamp_ack; + return TCP_SKB_CB(skb)->txstamp_ack & TSTAMP_ACK_SK; } return false; @@ -5575,6 +5575,9 @@ static void skb_tstamp_tx_report_bpf_timestamping(struct sk_buff *skb, op = BPF_SOCK_OPS_TSTAMP_SND_SW_CB; } break; + case SCM_TSTAMP_ACK: + op = BPF_SOCK_OPS_TSTAMP_ACK_CB; + break; default: return; } |
