STRUCT NPC_SUBBANK(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct npc_subbank(9) β€” a Kernel API Manual moment πŸŽ€

okay so bestie, welcome to the Kernel API Manual page for struct npc_subbank β€” yes that's the manual name, and yes it's giving "you're about to read a struct definition and enjoy it." Let's go ✨


🌸 NAME 🌸

struct npc_subbank β€” literally just the subbank fields. That's the whole vibe. No cap.


✨ SYNOPSIS ✨

struct npc_subbank {
    u16 b0t, b0b, b1t, b1b;
    enum npc_subbank_flag flags;
    struct mutex lock;
    unsigned long b0map[BITS_TO_LONGS( MAX_SUBBANK_DEPTH)];
    unsigned long b1map[BITS_TO_LONGS( MAX_SUBBANK_DEPTH)];
    u16 idx;
    u16 arr_idx;
    u16 free_cnt;
    u8 key_type;
 };

look at her. iconic. absolutely no notes πŸ”₯


🫢 Members 🫢

okay, member-by-member, and I'm gonna be so real with you about each one:

  • b0t β€” subbanks top index for bank0. the top, bestie, the ceiling of bank0 πŸ‘‘
  • b0b β€” subbanks bottom index for bank0. the floor, the basement, the b0b energy 🧚
  • b1t β€” subbanks top index for bank1. same deal, but make it bank1 ⭐
  • b1b β€” subbanks bottom index for bank1. the bottom of bank1, respectfully πŸ’œ
  • flags β€” the subbank flags. the whole personality of this subbank lives here πŸŽ€
  • lock β€” a mutex lock guarding the flags and the rsrc modification. do NOT skip the lock, I'm serious 😭
  • b0map β€” the bitmap map for bank0 indexes πŸ¦‹
  • b1map β€” the bitmap map for bank1 indexes 🌈
  • idx β€” the subbank index. her one true number πŸ’…
  • arr_idx β€” index into the free array or the used array. which one? that's between her and the code πŸ™ˆ
  • free_cnt β€” number of free slots in the subbank. keep an eye on it, she likes to go down πŸ“‰
  • key_type β€” X4 or X2 subbank. that's the whole range, that's the whole choice ✨

πŸ’– Description πŸ’–

okay so here's the lore: the MCAM resource gets divided horizontally into multiple subbanks, and the resource allocation from each one of those subbanks is managed by this data structure. that's it, that's the plot πŸ’€ literally every subbank out here being managed by this exact struct. main character energy fr fr.


🌟 SEE ALSO 🌟

go read these next, bestie, they're all in:

  • the kernel file ./drivers/net/ethernet/marvell/octeontx2/af/cn20k/npc.h
  • enum npc_subbank_flag(9)
  • enum npc_dft_rule_id(9)
  • struct npc_defrag_show_node(9)
  • struct npc_priv_t(9)

iykyk πŸ’…


πŸ“ friendly reminder: the manpage header says struct npc_subbank(9) and the manual is Kernel API Manual β€” now you can say you've been formally introduced 🫢

and that's the whole page, bestie!! this lil' rewrite comes straight out of ./drivers/net/ethernet/marvell... (yes the path literally ends in an ellipsis, we don't question the source 😭) and it's dated October 2026, so mark your calendar and stan responsibly. periodt. πŸ‘‘βœ¨

πŸ“¦ where this page comes from