ENUM OVS_ACTION_ATTR(9)
π NAME π
enum ovs_action_attr β the action types, bestie. This whole page lives in the Kernel API Manual and it's literally the menu of every move the Open vSwitch datapath can pull on a packet π
β¨ SYNOPSIS β¨
Okay so here's the enum in all its glory β copy it exactly, no cap:
enum ovs_action_attr {
OVS_ACTION_ATTR_OUTPUT ,
OVS_ACTION_ATTR_USERSPACE ,
OVS_ACTION_ATTR_SET ,
OVS_ACTION_ATTR_PUSH_VLAN ,
OVS_ACTION_ATTR_POP_VLAN ,
OVS_ACTION_ATTR_SAMPLE ,
OVS_ACTION_ATTR_RECIRC ,
OVS_ACTION_ATTR_HASH ,
OVS_ACTION_ATTR_PUSH_MPLS ,
OVS_ACTION_ATTR_POP_MPLS ,
OVS_ACTION_ATTR_SET_MASKED ,
OVS_ACTION_ATTR_CT ,
OVS_ACTION_ATTR_TRUNC ,
OVS_ACTION_ATTR_PUSH_ETH ,
OVS_ACTION_ATTR_POP_ETH ,
OVS_ACTION_ATTR_CT_CLEAR ,
OVS_ACTION_ATTR_PUSH_NSH ,
OVS_ACTION_ATTR_POP_NSH ,
OVS_ACTION_ATTR_METER ,
OVS_ACTION_ATTR_CLONE ,
OVS_ACTION_ATTR_CHECK_PKT_LEN ,
OVS_ACTION_ATTR_ADD_MPLS ,
OVS_ACTION_ATTR_DEC_TTL ,
OVS_ACTION_ATTR_DROP ,
OVS_ACTION_ATTR_PSAMPLE ,
OVS_ACTION_ATTR_SET_TO_MASKED
};
π Constants π
Right, buckle up, because this is the good part. Every single one of these, explained with love π«Ά
OVS_ACTION_ATTR_OUTPUTβ Output packet to port. Simple, iconic, does what it says.OVS_ACTION_ATTR_USERSPACEβ Send packet to userspace according to nestedOVS_USERSPACE_ATTR_*attributes. It's giving "hey bestie in userspace, this one's for you" β¨OVS_ACTION_ATTR_SETβ Replaces the contents of an existing header. The single nestedOVS_KEY_ATTR_*attribute specifies a header to modify and its value. One header, one attribute, that's the rule.OVS_ACTION_ATTR_PUSH_VLANβ Push a new outermost 802.1Q or 802.1ad header onto the packet. New tag on top, main character energy πOVS_ACTION_ATTR_POP_VLANβ Pop the outermost 802.1Q or 802.1ad header from the packet. Bye tag πOVS_ACTION_ATTR_SAMPLEβ Probabilitically executes actions, as specified in the nestedOVS_SAMPLE_ATTR_*attributes. (Yes, probability-flavoured. Sometimes it runs, sometimes it doesn't β that's the vibe check.)OVS_ACTION_ATTR_RECIRCβ Recirculate the clone of the packet through the datapath with the new id (u32 recirc_id). Round two, let's go πOVS_ACTION_ATTR_HASHβ Compute the packet hash, usingstruct ovs_action_hash.OVS_ACTION_ATTR_PUSH_MPLSβ Push a new MPLS label stack entry onto the top of the packets MPLS label stack. Set the ethertype of the encapsulating frame to eitherETH_P_MPLS_UCorETH_P_MPLS_MCto indicate the new packet contents.OVS_ACTION_ATTR_POP_MPLSβ Pop an MPLS label stack entry off of the packet's MPLS label stack. Set the encapsulating frame's ethertype to indicate the new packet contents. This could potentially still beETH_P_MPLSif the resulting MPLS label stack is not empty. If there is no MPLS label stack, as determined by ethertype, no action is taken. (No stack? No problem, it just chills. fr fr no action.)OVS_ACTION_ATTR_SET_MASKEDβ Replaces the contents of an existing header. A nestedOVS_KEY_ATTR_*attribute specifies a header to modify, its value, and a mask. For every bit set in the mask, the corresponding bit value is copied from the value to the packet header field, rest of the bits are left unchanged. The non-masked value bits must be passed in as zeroes. Masking is not supported for theOVS_KEY_ATTR_TUNNELattribute.
Heads up: mask bits are a strict fit β non-masked value bits must be zeroes, and OVS_KEY_ATTR_TUNNEL is a hard no for masking π
OVS_ACTION_ATTR_CTβ Track the connection. Populate the conntrack-related entries in the flow key. Conntrack bestie has entered the chat π₯OVS_ACTION_ATTR_TRUNCβ Output packet to port with truncated packet size.OVS_ACTION_ATTR_PUSH_ETHβ Push a new outermost Ethernet header onto the packet.OVS_ACTION_ATTR_POP_ETHβ Pop the outermost Ethernet header off the packet.OVS_ACTION_ATTR_CT_CLEARβ Clear conntrack state from the packet. Fresh start, clean slate πΈOVS_ACTION_ATTR_PUSH_NSHβ push NSH header to the packet.OVS_ACTION_ATTR_POP_NSHβ pop the outermost NSH header off the packet.OVS_ACTION_ATTR_METERβ Run packet through a meter, which may drop the packet, or modify the packet (e.g., change the DSCP field). The meter is judging your packet and it may literally yeet it πOVS_ACTION_ATTR_CLONEβ make a copy of the packet and execute a list of actions without affecting the original packet and key. Clone era π The original stays untouched, the copy goes off and does its own thing.OVS_ACTION_ATTR_CHECK_PKT_LENβ Check the packet length and execute a set of actions if greater than the specified packet length, else execute another set of actions. Branching, but make it packet-sized.OVS_ACTION_ATTR_ADD_MPLSβ Push a new MPLS label stack entry at the start of the packet or at the start of the l3 header depending on the value of l3 tunnel flag in thetun_flagsfield ofOVS_ACTION_ATTR_ADD_MPLSargument.OVS_ACTION_ATTR_DEC_TTLβ Decrement TTL or hop limit of the packet. Execute nestedOVS_DEC_TTL_ATTR_*actions if the value is less or equal to1. (TTL got low? That's when the nested actions come out π)OVS_ACTION_ATTR_DROPβ Explicit drop action. Sometimes the slay is the yeet.OVS_ACTION_ATTR_PSAMPLEβ Send a sample of the packet to external observers via psample.OVS_ACTION_ATTR_SET_TO_MASKEDβ Kernel internal masked set action translated from theOVS_ACTION_ATTR_SET.
π Description π
Only a single header can be set with a single OVS_ACTION_ATTR_SET. Not all fields within a header are modifiable, e.g. the IPv4 protocol and fragment type may not be changed.
So like... one header per one OVS_ACTION_ATTR_SET, periodt. And some fields are locked β the IPv4 protocol and fragment type are not up for editing π«
π SEE ALSO π
Go binge the whole family π
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), struct ovs_action_push_vlan(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)
Okay that's the whole page bestie, go forth and push some headers π¦
Signing off from ./include/uapi/linux, dated October 2026 β this page is enum ovs_action_attr(9) and it ate, no crumbs πβ¨
π¦ 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