diff options
author | Pravin B Shelar <pshelar@nicira.com> | 2011-10-21 14:38:54 -0700 |
---|---|---|
committer | Pravin B Shelar <pshelar@nicira.com> | 2011-10-21 14:38:54 -0700 |
commit | 4edb9ae90e4092f5f56b9d914d2b88783c49860d (patch) | |
tree | b606f5a5eca862b62aa2f4458cb7f54b06c73c2d /include | |
parent | a0003c0c359bc3ffe8a6683dbd0121877a3ce700 (diff) |
datapath: Refactor actions in terms of match fields.
Almost all current actions can be expressed in the form of
push/pop/set <field>, where field is one of the match fields. We can
create three base actions and take a field. This has both a nice
symmetry and avoids inconsistencies where we can match on the vlan
TPID but not set it.
Following patch converts all actions to this new format.
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
Bug #7115
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/openvswitch.h | 38 |
1 files changed, 27 insertions, 11 deletions
diff --git a/include/linux/openvswitch.h b/include/linux/openvswitch.h index c077f620..acc27693 100644 --- a/include/linux/openvswitch.h +++ b/include/linux/openvswitch.h @@ -423,21 +423,37 @@ enum ovs_userspace_attr { #define OVS_USERSPACE_ATTR_MAX (__OVS_USERSPACE_ATTR_MAX - 1) -/* Action types. */ +/** + * enum ovs_action_attr - Action types. + * + * @OVS_ACTION_ATTR_OUTPUT: Output packet to port passed as NLA data. + * @OVS_ACTION_ATTR_USERSPACE: Nested %OVS_USERSPACE_ATTR_ attributes specifying + * PID. + * @OVS_ACTION_ATTR_PUSH: Nested %OVS_KEY_ATTR_* attribute specifying header to + * push to given packet. + * E.g. Push vlan tag action would be NLA of %OVS_ACTION_ATTR_PUSH type with + * nested attribute of type %OVS_KEY_ATTR_8021Q with struct ovs_key_8021q + * as NLA data. + * @OVS_ACTION_ATTR_POP: Pop header according to %OVS_KEY_ATTR_ sent as + * attribute data. + * @OVS_ACTION_ATTR_SET: Nested %OVS_KEY_ATTR_* attribute specifying the + * field to set to given packet. + * @OVS_ACTION_ATTR_SET_PRIORITY: A set skb->priority to 32-bit number passed + * as NLA data. + * @OVS_ACTION_ATTR_POP_PRIORITY: Restore skb->priority to original value. + * @OVS_ACTION_ATTR_SAMPLE: Execute set of actions according to probability + * %OVS_SAMPLE_ATTR_PROBABILITY. + * + * Only a single field can be set with a single %OVS_ACTION_ATTR_{SET,PUSH}. + */ + enum ovs_action_attr { OVS_ACTION_ATTR_UNSPEC, OVS_ACTION_ATTR_OUTPUT, /* Output to switch port. */ OVS_ACTION_ATTR_USERSPACE, /* Nested OVS_USERSPACE_ATTR_*. */ - OVS_ACTION_ATTR_PUSH_VLAN, /* Set the 802.1q TCI value. */ - OVS_ACTION_ATTR_POP_VLAN, /* Strip the 802.1q header. */ - OVS_ACTION_ATTR_SET_DL_SRC, /* Ethernet source address. */ - OVS_ACTION_ATTR_SET_DL_DST, /* Ethernet destination address. */ - OVS_ACTION_ATTR_SET_NW_SRC, /* IPv4 source address. */ - OVS_ACTION_ATTR_SET_NW_DST, /* IPv4 destination address. */ - OVS_ACTION_ATTR_SET_NW_TOS, /* IP ToS/DSCP field (6 bits). */ - OVS_ACTION_ATTR_SET_TP_SRC, /* TCP/UDP source port. */ - OVS_ACTION_ATTR_SET_TP_DST, /* TCP/UDP destination port. */ - OVS_ACTION_ATTR_SET_TUNNEL, /* Set the encapsulating tunnel ID. */ + OVS_ACTION_ATTR_PUSH, /* Push packet header. */ + OVS_ACTION_ATTR_POP, /* Pop packet header. */ + OVS_ACTION_ATTR_SET, /* Set packet field(s). */ OVS_ACTION_ATTR_SET_PRIORITY, /* Set skb->priority. */ OVS_ACTION_ATTR_POP_PRIORITY, /* Restore original skb->priority. */ OVS_ACTION_ATTR_SAMPLE, /* Nested OVS_SAMPLE_ATTR_*. */ |