STRUCT NPC_SUBBANK(9)
π 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 saysstruct npc_subbank(9)and the manual isKernel 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
- 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