The ultimate goal is to find a place to store the start time per-packet basis for different protocols. It's almost unacceptable to add a new field for latency tracker (BPF Timestamping V2) for every nornal skb because the space is so precious nowadays. So what left we can do is to try to find a field to reuse. The principles are 1) it should be a safe place to store the start time, 2) it can traverse across netns (candidates like skb->tstamp are not appropriate due to the clearance by skb_scrub_packet() in the container scenario), 3) it works in dual directions. Detailed comparisons and reasons can be found on slides 53-60[1]. As we discussed at Netconf 2026 in Rome, we eventually chose to reuse hwtstamp with considering the above reasons. Now this reused field has three meanings. The two uses between 'hwtstamp' and 'start time' are deliberately ordered: a real hardware time stamp always wins. The start time is only generated when the hwtstamp slot is still empty. When hardware timestamping is present, that means we have a better value from real hardware than the software one, so choose the hardware timestamp as the start time in the rx path. [1]: https://netdevconf.info/0x1A/sessions/bof/network-observability-bof.html Signed-off-by: Jason Xing --- include/linux/skbuff.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 55ae1653a1cf..c5347be72ff9 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -447,6 +447,12 @@ static inline bool skb_frag_must_loop(struct page *p) * struct skb_shared_hwtstamps - hardware time stamps * @hwtstamp: hardware time stamp transformed into duration * since arbitrary point in time + * @start_time: Start time stamped when SK_BPF_CB_TIMESTAMPING_V2 + * is enabled; shares storage with @hwtstamp. A real + * hardware time stamp always takes precedence: the start + * time is only recorded when @hwtstamp is still empty + * (no hardware time stamp available), so the two are + * never needed at the same time on a given skb. * @netdev_data: address/cookie of network device driver used as * reference to actual hardware time stamp * @@ -462,6 +468,7 @@ static inline bool skb_frag_must_loop(struct page *p) struct skb_shared_hwtstamps { union { ktime_t hwtstamp; + ktime_t start_time; void *netdev_data; }; }; -- 2.43.7