dpsw_vlan_add(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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. A const 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:


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