UNION PKT_HDR(9)
π union pkt_hdr(9) β bestie, it's the Packet Input Header π
okay so this is from the Kernel API Manual, and literally the whole vibe is: one union, two ways to look at it, zero chill. it's giving "choose your own adventure but make it endian." let's get into it β¨
πΈ NAME πΈ
union pkt_hdr β the Packet Input Header. that's it, that's the name, she's iconic, she's a union, periodt.
π¦ SYNOPSIS π¦
here's the whole thing, verbatim, no cap β do not touch a single character:
union pkt_hdr {
__be64 bev[2];
u64 value[2];
struct {
#if defined(__BIG_ENDIAN_BITFIELD);
u64 opcode : 8;
u64 arg : 8;
u64 ctxc : 2;
u64 unca : 1;
u64 raz_44 : 1;
u64 info : 3;
u64 destport : 9;
u64 unc : 8;
u64 raz_19_23 : 5;
u64 grp : 3;
u64 raz_15 : 1;
u64 ctxl : 7;
u64 uddl : 8;
#else;
u64 uddl : 8;
u64 ctxl : 7;
u64 raz_15 : 1;
u64 grp : 3;
u64 raz_19_23 : 5;
u64 unc : 8;
u64 destport : 9;
u64 info : 3;
u64 raz_44 : 1;
u64 unca : 1;
u64 ctxc : 2;
u64 arg : 8;
u64 opcode : 8;
#endif;
__be64 ctxp;
} s;
};
likeβ¦ look at her. the #if defined(__BIG_ENDIAN_BITFIELD); branch lists the bitfields one way, the #else; branch lists them exactly backwards β same fields, same widths, just flipped so the layout lines up on both endiannesses. the way that s is a struct inside a union and it all just works π
and yeah, bev[2], value[2], and that inner struct { β¦ } s; all share the same space β that's the union gig, no biggie, only slightly chaotic π«Ά
π Members π
(this section is literally empty in the original β she said "no thoughts, head empty" and honestly? respect. nothing listed here, moving on.) π
π₯ SEE ALSO π₯
the whole friend group, all from the kernel file ./drivers/crypto/cavium/nitrox/nitrox_req.h β go say hi:
struct gphdr(9)union se_req_ctrl(9)struct se_crypto_request(9)struct crypto_keys(9)struct auth_keys(9)struct flexi_crypto_context(9)struct nitrox_aead_rctx(9)struct nitrox_rfc4106_rctx(9)union pkt_instr_hdr(9)union slc_store_info(9)struct nps_pkt_instr(9)struct aqmq_command_s(9)struct ctx_hdr(9)struct nitrox_softreq(9)create_single_sg(9)create_multi_sg(9)
like the whole nitrox squad is in the group chat, iykyk π
quick vibe check bestie: this page lives under ./drivers/crypto/cavium/nitrox, and the date on the tin is October 2026. that's the whole footer, so consider it shouted out β¨
anyway 10/10 union, would bitfield again. slay π πβ
π¦ 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