ice_set_key(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… ice_set_key β€” Kernel API Manual, but make it make sense

okay so bestie, we're in the kernel today, and the function we're stanning is ice_set_key. Manual name is ice_set_key(9) β€” it lives in the 9th section of the kernel API manual, so you already know it's driver-dev territory. Let's go. 🫢


✨ NAME ✨

ice_set_key β€” generate a variable sized key with multiples of 16-bits

That's the whole pitch. You're building a key, it can be any size you want, and it wants its sizes in multiples of 16 bits. Iconic little constraint, honestly. πŸ’…


🌸 SYNOPSIS 🌸

int ice_set_key (u8 *key , u16 size , u8 *val , u8 *upd , u8 *dc , u8
*nm , u16 off , u16 len );

Return type is int, and the signature is a whole friend group of parameters. Keep reading, I gotchu. πŸ‘‘


πŸŽ€ ARGUMENTS πŸŽ€

  • key β€” pointer to where the key will be stored. This is the destination, bestie β€” the finished key's home address. 🏠
  • size β€” the size of the complete key in bytes (must be even). Don't try to be quirky with an odd number, it's not that kind of party.
  • val β€” array of 8-bit values that makes up the value portion of the key. The actual content, the main character energy. ✨
  • upd β€” array of 8-bit masks that determine what key portion to update. Basically the "which bits are we touching" list.
  • dc β€” array of 8-bit masks that make up the don't care mask. Bits here are the ones we said "not my problem" to. πŸ™ˆ
  • nm β€” array of 8-bit masks that make up the never match mask. The friend group that's never getting let in. 🚫
  • off β€” the offset of the first byte in the key to update. Where the action starts.
  • len β€” the number of bytes in the key update. How far the action goes. πŸ“

πŸ¦‹ DESCRIPTION πŸ¦‹

So the way that this works is: ice_set_key generates a key from a value, a don't care mask and a never match mask. Three ingredients, one key. It's giving recipe, lowkey. πŸ“

And here's the cute part β€” upd, dc, and nm are optional parameters. You can pass NULL for any of them and the function just fills in the defaults for you, no arguments, no notes:

  • upd == NULL β†’ upd mask is all 1's (update all bits)
  • dc == NULL β†’ dc mask is all 0's (no don't care bits)
  • nm == NULL β†’ nm mask is all 0's (no never match bits)

Literally so forgiving. Not me being obsessed with a null check. 😭

ngl, size still has to be even β€” that rule does not bend for anybody. Periodt.

πŸ”₯ SEE ALSO πŸ”₯

okay bestie you asked for the related-pages section and it is unhinged in size, I'm warning you now. First up, the source itself:

  • Kernel file ./drivers/net/ethernet/intel/ice/ice_flex_pipe.c

and then the entire extended universe of (9) functions, all of them, no skips, no summarising, let's get into it:

yeah. all of that. iykyk. 🌈


⭐ the sign-off ⭐

This little page comes from ./drivers/net/ethernet/intel/ice and it's dated October 2026 β€” so when you're flipping through the manual, that's the version stamp you're looking at. Slay, go build your keys, and remember: even sizes only. bye bestie πŸ’–πŸ§š

πŸ“¦ where this page comes from