__skb_gso_segment(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… __skb_gso_segment(9) πŸ’…

okay bestie, welcome to the Kernel API Manual ✨ this one is short but it's giving load-bearing and you're gonna want to actually read it, fr fr 🫢


🌸 NAME 🌸

__skb_gso_segment β€” perform segmentation on skb πŸŽ€


✨ SYNOPSIS ✨

struct sk_buff * __skb_gso_segment (struct sk_buff *skb ,
       netdev_features_t features , bool tx_path );

like, that's the whole vibe. three args, one return, no cap πŸ’…


πŸ¦‹ ARGUMENTS πŸ¦‹

  • skb β€” the buffer you want to segment πŸ“ this is the main character, literally
  • features β€” the features for the output path (see dev->features). yes, that's where you look, iykyk ✨
  • tx_path β€” whether it is called in TX path 🌈 so like, are we in the TX path or not, that's the question

πŸ’– DESCRIPTION πŸ’–

so basically this function segments the given skb and returns a list of segments. slay. πŸŽ€ that's it, that's the job.

okay but here's the part you cannot skip πŸ™ˆ it may return NULL if the skb requires no segmentation. and like β€” that's only possible when GSO is used for verifying header integrity. so if you see NULL waltzing back at you, don't panic, that's allowed, that's the contract, periodt πŸ’€

also important and very easy to miss ngl: segmentation preserves SKB_GSO_CB_OFFSET bytes of previous skb cb. SKB_GSO_CB_OFFSET β€” that exact macro, that exact number of bytes, don't be out here guessing 😭

⚠️ warning bestie: keep SKB_GSO_CB_OFFSET and the cb preservation in mind before you go touching our beloved skb->cb β€” the semantics here are load-bearing and the kernel is not forgiving πŸ™ˆ

πŸ”₯ SEE ALSO πŸ”₯

kernel file ./net/core/gso.c + all her iconic friends πŸ’…

go read them, they ate πŸ‘‘


🫢 and that's the page! huge thanks to the fine people over in ./net/core who shipped this one, dated October 2026 πŸ’– mwah, go segment something responsibly bestie 🌸✨

πŸ“¦ where this page comes from