egress_pkey_check(9)
π 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 β
0on success π (slay)- otherwise,
1π (not slay, but informative)
π SEE ALSO π
kernel file ./drivers/infiniband/hw/hfi1/verbs.c β and the whole friend group:
hfi1_ib_rcv(9)update_tx_opstats(9)hfi1_verbs_send(9)hfi1_fill_device_attr(9)hfi1_get_npkeys(9)hfi1_register_ib_device(9)
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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms