switchdev_port_attr_set(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… switchdev_port_attr_set(9) πŸ’…

Okay bestie, welcome to the Kernel API Manual ✨ β€” this is the page for switchdev_port_attr_set, and yes it's a function, yes it's in the kernel, and yes we're gonna get through it together 🫢


🌸 NAME 🌸

switchdev_port_attr_set β€” set a port attribute, that's literally the whole job, no cap πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

int switchdev_port_attr_set (struct net_device *dev , const struct
       switchdev_attr *attr , struct netlink_ext_ack *extack );

That's the whole signature, keep it exactly like that, don't be weird about it πŸ¦‹


✨ ARGUMENTS ✨

  • dev β€” the port device. the actual thing we're poking at 🎯
  • attr β€” the attribute you wanna set. like, the whole point of calling this fr fr
  • extack β€” the netlink extended ack. it's here purely so error messages can propagate back up the chain so you actually find out why things went sideways 😭

πŸ”₯ DESCRIPTION πŸ”₯

Okay this is the part where you gotta pay attention, bestie, because it's a real rule and not a vibe:

rtnl_lock must be held, and you must not be in an atomic section β€” unless the SWITCHDEV_F_DEFER flag is set. that's the loophole, that's the exception, respect it πŸ’€

Highkey important, lowkey easy to forget. Don't be that person πŸ™ˆ


πŸ¦‹ SEE ALSO πŸ¦‹

Kernel file ./net/switchdev/switchdev.c β€” and also go look at these icons πŸ‘‘


That's the page!! πŸ’– This little gem lives in ./net/switchdev, dated October 2026, and the manual name is switchdev_port_attr_set(9) in case you forgot already 🧚 mwah, go set some attributes responsibly πŸ‘‘β­

πŸ“¦ where this page comes from