switchdev_port_attr_set(9)
π 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 frextackβ 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_lockmust be held, and you must not be in an atomic section β unless theSWITCHDEV_F_DEFERflag 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 π
switchdev_deferred_process(9)switchdev_port_obj_add(9)switchdev_port_obj_del(9)switchdev_port_obj_act_is_deferred(9)register_switchdev_notifier(9)unregister_switchdev_notifier(9)call_switchdev_notifiers(9)
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
- 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