egress_pkey_check(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… egress_pkey_check(9) β€” like, the full glow-up

okay so first things first, we're in the Kernel API Manual today bestie, and this page is literally called egress_pkey_check(9). yes it's a real function. yes it checks a P_KEY. no we're not skipping any of it. periodt. πŸŽ€


✨ NAME ✨

egress_pkey_check β€” checks the P_KEY of a packet, that's it, that's the whole vibe πŸ¦‹


🌸 SYNOPSIS 🌸

int egress_pkey_check (struct hfi1_pportdata *ppd , u32 slid , u16 pkey
, u8 sc5 , int8_t s_pkey_index );

look at all those args, she's got range ngl πŸ’…


🧚 ARGUMENTS 🧚

  • ppd β€” the physical IB port data. like, the port's whole personality file, we're handing it over πŸ’–
  • slid β€” the SLID for the packet. yes. that. that's the one. 🫢
  • pkey β€” the PKEY for the header. main character of this entire function tbh πŸ‘‘
  • sc5 β€” the SC for the packet. lowercase, five, yes ma'am 🌸
  • s_pkey_index β€” okay so this one is specifically for look-up optimization, and only for kernel contexts. if it comes in as a negative value, that means it's the user contexts calling this function. so like, negative index = user context said hi πŸ™ˆ

πŸ’€ DESCRIPTION πŸ’€

it checks if the header's pkey is valid. that's the function. that's what she does. valid pkey? we love to see it. πŸ”₯


⭐ RETURN ⭐

  • 0 on success πŸŽ‰ (slay)
  • otherwise, 1 😭 (not slay, but informative)

🌈 SEE ALSO 🌈

kernel file ./drivers/infiniband/hw/hfi1/verbs.c β€” and the whole friend group:

go read all of them, iykyk πŸ’œ


ngl there's no weird bug note or danger warning on this one, she's a chill little validity checker. still, respect the return codes, bestie 🫢

okay and finally, the cute sign-off: this lil page lives in ./drivers/infiniband/hw/hfi1, dated October 2026, and honestly? iconic. don't forget the path, it's part of the lore πŸ§šβœ¨πŸ’–

πŸ“¦ where this page comes from