STRUCT LMAC(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

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