UNION PKT_HDR(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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