ENUM OVS_ACTION_ATTR(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸŽ€ 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 nested OVS_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 nested OVS_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 nested OVS_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, using struct 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 either ETH_P_MPLS_UC or ETH_P_MPLS_MC to 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 be ETH_P_MPLS if 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 nested OVS_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 the OVS_KEY_ATTR_TUNNEL attribute.
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 the tun_flags field of OVS_ACTION_ATTR_ADD_MPLS argument.
  • OVS_ACTION_ATTR_DEC_TTL β€” Decrement TTL or hop limit of the packet. Execute nested OVS_DEC_TTL_ATTR_* actions if the value is less or equal to 1. (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 the OVS_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