dpsw_vlan_add(9)
π dpsw_vlan_add(9) β the Kernel API Manual, bestie edition π
Okay so welcome to dpsw_vlan_add(9), part of the Kernel API Manual fam. This is the little function that slides a brand-new VLAN into your DPSW object, and honestly? Iconic behaviour. Let's get into it π
β¨ SYNOPSIS β¨
int dpsw_vlan_add (struct fsl_mc_io *mc_io , u32 cmd_flags , u16 token ,
u16 vlan_id , const struct dpsw_vlan_cfg *cfg );
That's the whole vibe right there β five args, one int coming back at you π«Ά
πΈ ARGUMENTS πΈ
mc_ioβ Pointer to MC portal's I/O object. Like, your whole connection to the management complex. Don't lose it πcmd_flagsβ Command flags; one or more of'MC_CMD_FLAG_'. You pick the flags, queen.tokenβ Token of DPSW object. That's your lil handshake proving you're allowed to touch this switch.vlan_idβ VLAN Identifier. The star of the show fr fr.cfgβ VLAN configuration. Aconst struct dpsw_vlan_cfg *, obviously.
π¦ DESCRIPTION π¦
So here's the tea, bestie: only VLAN ID and FDB ID are required parameters here. Everything else? Optional garnish πΏ
The 12 bit VLAN ID is defined in IEEE802.1Q β that's just how the spec do. And listen, adding a duplicate VLAN ID is not allowed. Not me trying twice and getting told no π Periodt.
Also good to know: FDB ID can be shared across multiple VLANs. You get shared learning by calling dpsw_vlan_add for multiple VLAN IDs with the same fdb_id. That's the group-chat of VLANs all reading the same messages, highkey efficient π₯
β RETURN β
Completion status. '0' on Success; Error code otherwise. Zero is the slay. Anything else? Read the error code and cry a little π
π SEE ALSO π
Kernel file ./drivers/net/ethernet/freescale/dpaa2/dpsw.c β go read it, iykyk π
And here's the whole extended friend group, no cap, every single one:
dpsw_open(9),dpsw_close(9),dpsw_enable(9),dpsw_disable(9),dpsw_reset(9)dpsw_set_irq_enable(9),dpsw_set_irq_mask(9),dpsw_get_irq_status(9),dpsw_clear_irq_status(9),dpsw_get_attributes(9)dpsw_if_set_link_cfg(9),dpsw_if_get_link_state(9),dpsw_if_set_tci(9),dpsw_if_get_tci(9),dpsw_if_set_stp(9),dpsw_if_get_counter(9),dpsw_if_enable(9),dpsw_if_disable(9),dpsw_if_get_attributes(9),dpsw_if_set_max_frame_length(9)dpsw_vlan_add_if(9),dpsw_vlan_add_if_untagged(9),dpsw_vlan_remove_if(9),dpsw_vlan_remove_if_untagged(9),dpsw_vlan_remove(9)dpsw_fdb_add(9),dpsw_fdb_remove(9),dpsw_fdb_add_unicast(9),dpsw_fdb_dump(9),dpsw_fdb_remove_unicast(9),dpsw_fdb_add_multicast(9),dpsw_fdb_remove_multicast(9)dpsw_ctrl_if_get_attributes(9),dpsw_ctrl_if_set_pools(9),dpsw_ctrl_if_set_queue(9),dpsw_get_api_version(9),dpsw_if_get_port_mac_addr(9),dpsw_ctrl_if_enable(9),dpsw_ctrl_if_disable(9)dpsw_set_egress_flood(9),dpsw_if_set_learning_mode(9)dpsw_acl_add(9),dpsw_acl_remove(9),dpsw_acl_add_if(9),dpsw_acl_remove_if(9),dpsw_acl_prepare_entry_cfg(9),dpsw_acl_add_entry(9),dpsw_acl_remove_entry(9)dpsw_set_reflection_if(9),dpsw_if_add_reflection(9),dpsw_if_remove_reflection(9),dpsw_lag_set(9),dpsw_if_set_lag_state(9)
One tiny heads-up before you go β this page came out in October 2026, sourced from ./drivers/net/ethernet/freesca... (the path got cut off in the original, not my fault bestie π).
Okay that's the whole page!! Go add some VLANs, you're gonna eat π β¨π
π¦ 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