ice_pkg_enum_section(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… ice_pkg_enum_section(9) β€” the kernel API manual, but make it group chat

okay so this is ice_pkg_enum_section(9) from the Kernel API Manual, and it's genuinely one of the more chill ones β€” think of it as the little iterator bestie who walks the ice segment and hands you every section of a type you asked for, one at a time. No cap, that's the whole vibe.


✨ NAME ✨

ice_pkg_enum_section β€” and yes, the description line in the original is literally empty. A mysterious queen with nothing to say. We respect it. πŸŽ€


🌸 SYNOPSIS 🌸

void * ice_pkg_enum_section (struct ice_seg *ice_seg , struct
       ice_pkg_enum *state , u32 sect_type );

Returns void *, takes a segment, a state blob, and a section type. That's the whole signature, copied exactly, don't come for me. 🫢


πŸ¦‹ ARGUMENTS πŸ¦‹

  • ice_seg β€” pointer to the ice segment (or NULL on subsequent calls). First call: you give it the actual segment. After that: NULL, because we're continuing, not restarting.
  • state β€” pointer to the enum state. This little guy is what remembers where you are in the walk. Keep it alive between calls, bestie, it's carrying the whole operation.
  • sect_type β€” section type to enumerate. This is you telling it which kind of section you're hunting for. 🎯

πŸ’– DESCRIPTION πŸ’–

This function will enumerate all the sections of a particular type in the ice segment. Like, all of them, one per call, no skipping. πŸŽ€

The first call is made with the ice_seg parameter non-NULL β€” that's how the enumerator knows "okay, we're starting fresh." On subsequent calls, ice_seg is set to NULL, which continues the enumeration. Yes, this is the classic "you've got to be in it to win it, but then you have to leave" pattern. The state parameter is holding the receipts the whole time. πŸ’…

When the function returns a NULL pointer, then the end of the matching sections has been reached. So NULL isn't an error, it's the finish line. 🏁 Iconic behaviour, honestly.

lowkey the most important thing: first call = real segment pointer, every call after = NULL for ice_seg. Get that backwards and you're starting the walk over and over like a main character with no plot. 😭

πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./drivers/net/ethernet/intel/ice/ice_ddp.c β€” that's where the actual source lives, go read it, it's giving lore.

And now the full see-also family, in the exact order they were handed to me, because we don't drop members of the squad:

That's the whole friend group. Seventy-ish manpages. Slept on exactly none of them. πŸ”₯


so yeah β€” first call with the segment, NULL after, and NULL returned means you're done. gg, go enumerate something. πŸ¦‹

sign-off time πŸ’Œ: this page comes from the source path ./drivers/net/ethernet/intel/ice and it's dated October 2026. cute little timestamp, we love a documented moment. πŸŽ€

πŸ“¦ where this page comes from