History

openvswitch: Allow matching on conntrack mark

Allow matching and setting the ct_mark field. As with ct_state and ct_zone, these fields are populated when the CT action is executed. To write to this field, a value and mask can be specified as a nested attribute under the CT action. This data is stored with the conntrack entry, and is executed after the lookup occurs for the CT action. The conntrack entry itself must be committed using the COMMIT flag in the CT action flags for this change to persist.

Joe Stringer committed 11 years ago

Commit 182e3041 parent 7f8a4366 files · +83 −4Browse files

Showing the changes to include/uapi (1 of 6 files). Show all

Unified · Split

include/uapi/linux/openvswitch.h+5−0
@@ -325,6 +325,7 @@ enum ovs_key_attr { · 324 unmodified lines
325325 * the accepted length of the array. */
326326 OVS_KEY_ATTR_CT_STATE, /* u8 bitmask of OVS_CS_F_* */
327327 OVS_KEY_ATTR_CT_ZONE, /* u16 connection tracking zone. */
328+ OVS_KEY_ATTR_CT_MARK, /* u32 connection tracking mark */
328329
329330 #ifdef __KERNEL__
330331 OVS_KEY_ATTR_TUNNEL_INFO, /* struct ip_tunnel_info */
@@ -613,11 +614,15 @@ struct ovs_action_hash { · 282 unmodified lines
613614 * enum ovs_ct_attr - Attributes for %OVS_ACTION_ATTR_CT action.
614615 * @OVS_CT_ATTR_FLAGS: u32 connection tracking flags.
615616 * @OVS_CT_ATTR_ZONE: u16 connection tracking zone.
617+ * @OVS_CT_ATTR_MARK: u32 value followed by u32 mask. For each bit set in the
618+ * mask, the corresponding bit in the value is copied to the connection
619+ * tracking mark field in the connection.
616620 */
617621 enum ovs_ct_attr {
618622 OVS_CT_ATTR_UNSPEC,
619623 OVS_CT_ATTR_FLAGS, /* u8 bitmask of OVS_CT_F_*. */
620624 OVS_CT_ATTR_ZONE, /* u16 zone id. */
625+ OVS_CT_ATTR_MARK, /* mark to associate with this connection. */
621626 __OVS_CT_ATTR_MAX
622627 };
623628