skb_shift(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’« skb_shift(9) β€” Kernel API Manual πŸ’«

okay bestie, strap in, because this is the function page for skb_shift(9) from the Kernel API Manual and it's genuinely so much cooler than it sounds. it's giving "quietly moving your stuff around behind the scenes" energy πŸŽ€


🌸 NAME 🌸

skb_shift β€” shifts paged data partially from skb to another

like, partially, bestie. not the whole thing. we're doing a little relocation, not a full move-out 🚚


✨ SYNOPSIS ✨

int skb_shift (struct sk_buff *tgt , struct sk_buff *skb , int shiftlen
);

three args, one int back. clean, iconic, no notes πŸ’…


🫢 ARGUMENTS 🫢

  • tgt β€” the buffer where the tail data gets added. she's the destination, the host, the one receiving πŸ’–
  • skb β€” the buffer the paged data comes from. she's the source, the giver, the one being raided 🧚
  • shiftlen β€” shift up to this many bytes. it's a ceiling, not a promise, okay? πŸ™ˆ

πŸ”₯ DESCRIPTION πŸ”₯

So the whole vibe: it attempts to shift up to shiftlen worth of bytes from skb to tgt, and returns the number of bytes shifted. and lowkey important β€” that byte count may be less than the length of the skb. so don't assume you moved everything!!

⚠️ heads up bestie: it's up to the caller to free skb if everything was shifted. the function will not do your cleanup for you. main character energy means taking responsibility for your own skbs πŸ’€

And if tgt runs out of frags, the whole operation is aborted. no partial credit, no half-shift, we're just done. βœ‹

Also, the vibes must match: skb cannot include anything else but paged data, while tgt is allowed to have non-paged data as well. so skb is strictly paged, tgt is flexible. slay for her honestly πŸ’…

TODO: full sized shift could be optimized but that would need a specialized skb free'er to handle frags without up-to-date nr_frags. so like, it's on the list, it's just not happening today 🫠


πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./net/core/skbuff.c β€” and honestly the whole extended friend group:


okay that's the whole page, and yes every single one of those is a real function, i checked, no cap πŸ’œ

<div align="center">🌸 🌈 ✨ πŸŽ€ ✨ 🌈 🌸</div>

so this masterpiece lives over in ./net/core, dated October 2026, and it's literally titled skb_shift(9) in the Kernel API Manual. that's the whole sign-off bestie, go shift some paged data responsibly πŸ¦‹πŸ’–

πŸ“¦ where this page comes from