skb_tx_timestamp(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– skb_tx_timestamp(9) πŸ’–

okay so this is a page from the Kernel API Manual, and honestly? it's a tiny one but it matters, bestie. it's the driver hook for transmit timestamping. yes, that's the whole vibe. read on 🫢


✨ SYNOPSIS ✨

void skb_tx_timestamp (struct sk_buff *skb );

literally that's it. one function, one arg, no return value. iconic minimalism πŸ’…


πŸŽ€ ARGUMENTS πŸŽ€

  • skb β€” a socket buffer. that's the whole description. a socket buffer. a lil packet guy. the sk_buff in question, the main character of this function's whole life 🌸

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so here's the tea, and you need to hear it fr fr:

Ethernet MAC Drivers should call this function in their hard_xmit function immediately before giving the sk_buff to the MAC hardware. immediately. not "soon", not "after I finish this one thing" β€” immediately, bestie. the packet goes in, the timestamp hook fires, then the hardware gets it. that's the order. πŸ”₯

and specifically β€” like, pay attention, this is the part where people mess up β€” one should make absolutely sure that this function is called before TX completion of this packet can trigger. because if you don't? the packet could potentially already be freed by then. 😭

πŸ’€ bestie. the packet could already be freed. that's a use-after-free waiting to happen. do not be that driver. call it before TX completion can fire, no cap. this is genuinely the one thing this whole manpage is yelling at you about.

so to recap the timeline in your head: hard_xmit β†’ call skb_tx_timestamp() β†’ give sk_buff to MAC hardware. the timestamp hook has to be in there before the completion path can possibly trigger. otherwise you're reaching for memory that already got yeeted. πŸ™ˆ


🌈 SEE ALSO 🌈

the crossover episode is huge, buckle up. also peep the kernel file ./include/linux/skbuff.h β€” that's the source of truth 🧚

like I said. huge crossover. go read the ones about timestamps if you want the full lore, they're literally the sibling episodes πŸ’œ


and that's the whole page, bestie! this one lives in ./include/linux, dated October 2026, and it's filed under skb_tx_timestamp(9) in the Kernel API Manual β€” go timestamp responsibly, call it before TX completion, and don't get your packet freed out from under you πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from