STRUCT OVS_ACTION_PUSH_VLAN(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct ovs_action_push_vlan(9) β€” the Kernel API Manual glow-up ✨

okay so bestie, welcome to the glow-up of the struct ovs_action_push_vlan(9) page from the Kernel API Manual, and honestly? this one is a little legend. it's the struct that carries the argument for the %OVS_ACTION_ATTR_PUSH_VLAN action. like, it's giving "small but powerful" and we're obsessed πŸŽ€


✨ NAME ✨

struct ovs_action_push_vlan β€” the argument that goes with the %OVS_ACTION_ATTR_PUSH_VLAN action πŸ’–


πŸ¦‹ SYNOPSIS πŸ¦‹

here's the whole vibe, exactly as written, no notes:

struct ovs_action_push_vlan {
    __be16 vlan_tpid;
    __be16 vlan_tci;
 };

🌸 Members 🌸

  • vlan_tpid β€” the Tag Protocol Identifier (TPID) you're pushing. it's literally the "hey what kind of tag is this" field 🏷️
  • vlan_tci β€” the Tag Control Identifier (TCI) you're pushing. and listen, the CFI bit must be set here β€” but plot twist: it will not be set in the 802.1Q header that actually gets pushed. so set it in the struct, don't expect to see it in the header. iykyk πŸ™ˆ

πŸ”₯ Description πŸ”₯

so vlan_tpid is typically gonna be ETH_P_8021Q or ETH_P_8021AD β€” those are the main character values, fr fr.

but here's the rule, and it's a real one: the only acceptable TPID values are the ones that the kernel module also parses as 802.1Q or 802.1AD headers. why? because otherwise, OVS_ACTION_ATTR_PUSH_VLAN followed by OVS_ACTION_ATTR_POP_VLAN could have surprising results πŸ’€ and we do not do surprising results in this house. push/pop should cancel out cute and clean, periodt.

no cap: pick a TPID the kernel understands, or the push/pop combo might not behave the way you expect.

πŸ‘‘ SEE ALSO πŸ‘‘

go read these next, bestie, they're all in the kernel file ./include/uapi/linux/openvswitch.h:

  • struct ovs_header(9)
  • enum ovs_datapath_attr(9)
  • enum ovs_packet_attr(9)
  • enum ovs_vport_type(9)
  • enum ovs_vport_attr(9)
  • enum ovs_vport_upcall_attr(9)
  • enum ovs_frag_type(9)
  • enum ovs_flow_attr(9)
  • enum ovs_sample_attr(9)
  • enum ovs_userspace_attr(9)
  • struct ovs_action_push_mpls(9)
  • struct ovs_action_add_mpls(9)
  • enum ovs_ct_attr(9)
  • enum ovs_nat_attr(9)
  • struct ovs_action_push_eth(9)
  • enum ovs_check_pkt_len_attr(9)
  • enum ovs_psample_attr(9)
  • enum ovs_action_attr(9)

that's the whole page, slay πŸ’œ this one lives in ./include/uapi/linux and it's dated October 2026 β€” so yeah, a little time-travel moment, but the facts are the facts. take care of your TPIDs, set that CFI bit, and go be the main character of your own datapath 🌈🫢

πŸ“¦ where this page comes from