cxgb4vf_change_mac(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ cxgb4vf_change_mac(9) ✨

okay so bestie, we're in the Kernel API Manual today and this page is literally all about cxgb4vf_change_mac β€” yes that's the whole function name, and no I can't make it shorter, it's giving very much "named by someone who was running out of vowels" πŸ’€ but it's fine, we love her, she's iconic.


πŸ’– NAME πŸ’–

cxgb4vf_change_mac β€” Update match filter for a MAC address. that's it, that's the vibe πŸŽ€


🌸 SYNOPSIS 🌸

int cxgb4vf_change_mac (struct port_info *pi , unsigned int viid , int
*tcam_idx , const u8 *addr , bool persistent );
not the line break mid-parameter 😭 that's just how it's printed, don't come for me, keep it exactly like that fr fr.

πŸ¦‹ ARGUMENTS πŸ¦‹

  • pi β€” the port_info. the whole port situation, the main character of this call tbh πŸ‘‘
  • viid β€” the VI id. you know, the VI id. if you know you know πŸ’…
  • tcam_idx β€” the TCAM index of the existing filter for the old value of the MAC address, or -1. so like, -1 means "no existing filter, we're going somewhere new" πŸ¦‹
  • addr β€” the new MAC address value. the glow-up address ✨
  • persistent β€” whether a new MAC allocation should be persistent. like, are we keeping this or is it just a phase πŸ™ˆ

⭐ DESCRIPTION ⭐

okay so here's what she actually does, and it's honestly so clean πŸ‘

She modifies an MPS filter and sets it to the new MAC address if tcam_idx >= 0. so you had a filter, you found it, you're changing it. slay πŸ”₯

Or β€” and this is the fun branch β€” she adds the MAC address to a new filter if tcam_idx < 0. brand new filter, brand new her 🌈

And in that latter case, the address is added persistently if persist is true. (yes, it says persist in the description and persistent in the arguments β€” that's literally what the page says, I'm not editing anything, we don't do that here 😭)

Then there's this one detail that is highkey important ngl: addresses are programmed to the hash region if TCAM runs out of entries. so like, TCAM said "no entries left bestie" and the address just goes to hash region instead. iconic fallback behaviour, no notes 🫢


🧚 SEE ALSO 🧚

Kernel file ./drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c β€” go read the source, it's free and it's educational πŸ’œ

all four of them, listed in that exact order, because I would never do you like that and drop one πŸ’–


and that's the page!! πŸŽ€ little sign-off for you: this one came from ./drivers/net/ethernet/chelsio... and it's dated October 2026 β€” stamp it, frame it, put it on the fridge, she's done πŸ¦‹βœ¨πŸ₯°

πŸ“¦ where this page comes from