STRUCT LMAC(9)
π struct lmac β per lmac locks and properties π
okay bestie, this is a page from the Kernel API Manual and it's genuinely iconic β it's all about struct lmac, which is the little bundle of locks, flags and link tea that every LMAC port carries around. Think of it as the main character's group chat: one wait queue, one mutex, a bunch of bitmaps, and a whole lot of "please don't touch that while I'm talking". π«Ά
β¨ NAME β¨
struct lmac β per lmac locks and properties. that's it, that's the whole vibe. locks + properties, together, slaying. π
πΈ SYNOPSIS πΈ
struct lmac {
wait_queue_head_t wq_cmd_cmplt;
struct mutex cmd_lock;
u64 resp;
struct cgx_link_user_info link_info;
struct rsrc_bmap mac_to_index_bmap;
struct rsrc_bmap rx_fc_pfvf_bmap;
struct rsrc_bmap tx_fc_pfvf_bmap;
struct cgx_event_cb event_cb;
spinlock_t event_cb_lock;
struct cgx *cgx;
u8 mcast_filters_count;
u8 lmac_id;
u8 lmac_type;
bool cmd_pend;
char *name;
};
like... look at her. every field is doing a job and none of them are being extra about it. π
π¦ Members π¦
wq_cmd_cmpltβ the waitq that keeps your process blocked until the cmd is done. literally "sit down and wait, bestie, the command hasn't finished yet." πcmd_lockβ the lock that serializes the command interface. one at a time, no cutting the line. πrespβ the command response. it's giving "the answer we've all been waiting for". β¨link_infoβ all the link-related information. the whole link lore lives here. π₯mac_to_index_bmapβ Mac address to CGX table index mapping. yep, it's a bmap that maps a Mac address over to a CGX table index. she's literally a matchmaker. π₯°rx_fc_pfvf_bmapβ Receive flow control enabled netdev mapping. so which netdev has rx flow control on? this bmap knows. πtx_fc_pfvf_bmapβ Transmit flow control enabled netdev mapping. the tx twin!! same energy, opposite direction. πevent_cbβ the callback for linkchange events. when the link changes, she gets the call. main character energy fr fr. π₯event_cb_lockβ the lock for serializing callback with unregister. so nobody fires a callback into the void while someone's unregistering β not on her watch. πcgxβ the parent cgx port. like, mother is always in the building. π«Άmcast_filters_countβ the Number of multicast filters installed. she's keeping count, always. πlmac_idβ the lmac port id. your little name tag at the port party. πlmac_typeβ the lmac type, like SGMII/XAUI. so she knows what kind of girl she is. πcmd_pendβ a flag set before a new command is started, and cleared after the command response is received. lowkey the most honest field in here: "am I still waiting or not?" β yes/no, no cap. βnameβ the lmac port name. everyone deserves a name bestie. π
π SEE ALSO π
Kernel file ./drivers/net/ethernet/marvell/octeontx2/af/lmac_common.h β go read the header, that's where the real source of truth lives. iykyk. π§
okay that's the whole page!! ngl it's short but she ate π
β anyway this was pulled from the Kernel API Manual and if you see someone crediting the source as ./drivers/net/ethernet/marvell... with a date of October 2026, that's the footer, babes, and yes, we're acknowledging it. 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