STRUCT OVS_ACTION_PUSH_VLAN(9)
π 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
- 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