This patch introduces new fields in openvswitch.h for mega flow. It
is prerequisite for both kernel and user space mega flow changes.

Signed-off-by: Andy Zhou <[email protected]>
---
 include/linux/openvswitch.h |   33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/include/linux/openvswitch.h b/include/linux/openvswitch.h
index e890fd8..6048e9b 100644
--- a/include/linux/openvswitch.h
+++ b/include/linux/openvswitch.h
@@ -264,6 +264,32 @@ struct ovs_flow_stats {
        __u64 n_bytes;           /* Number of matched bytes. */
 };
 
+/**
+ * enum ovs_mask_attr - attributes for %OVS_KEY_ATTR_MASK.
+ * @OVS_MASK_ATTR_TYPE: The %OVS_KEY_ATTR_* whose value is matched with a mask.
+ * Attributes that nested attributes may not be masked; specify masks on the
+ * inner attributes instead.
+ * @OVS_MASK_ATTR_MASK: The mask.  The payload for this attribute must be the
+ * correct length for the attribute whose type is given in %OVS_MASK_ATTR_TYPE.
+ * A 1-bit indicates that the bit is matched, a 0-bit indicates that the bit is
+ * wildcarded.
+ * @OVS_MASK_ATTR_VALUE: The value.  The payload must be the same length as
+ * %OVS_MASK_ATTR_MASK.  Bits corresponding to 1-bits in %OVS_MASK_ATTR_MASK
+ * give the value to match.  Bits corresponding to 0-bits in
+ * %OVS_MASK_ATTR_MASK must be zero.
+ *
+ * All attributes are required.
+ */
+enum ovs_mask_attr {
+        OVS_MASK_ATTR_UNSPEC,
+        OVS_MASK_ATTR_TYPE,     /* u16 OVS_KEY_ATTR_* being masked. */
+        OVS_MASK_ATTR_MASK,     /* Bitwise mask for attribute being masked. */
+        OVS_MASK_ATTR_VALUE,    /* Value of attribute being masked. */
+        __OVS_MASK_ATTR_MAX
+};
+
+#define OVS_MASK_ATTR_MAX (__OVS_MASK_ATTR_MAX - 1)
+
 enum ovs_key_attr {
        OVS_KEY_ATTR_UNSPEC,
        OVS_KEY_ATTR_ENCAP,     /* Nested set of encapsulated attributes. */
@@ -287,6 +313,8 @@ enum ovs_key_attr {
        OVS_KEY_ATTR_IPV4_TUNNEL,  /* struct ovs_key_ipv4_tunnel */
 #endif
 
+       OVS_KEY_ATTR_MEGA = 60, /* Indicate a mega flow key */
+       OVS_KEY_ATTR_MASK = 61, /* Nested OVS_MASK_ATTR_* attributes */
        OVS_KEY_ATTR_MPLS = 62, /* array of struct ovs_key_mpls.
                                 * The implementation may restrict
                                 * the accepted length of the array. */
@@ -410,6 +438,10 @@ struct ovs_key_nd {
  * @OVS_FLOW_ATTR_CLEAR: If present in a %OVS_FLOW_CMD_SET request, clears the
  * last-used time, accumulated TCP flags, and statistics for this flow.
  * Otherwise ignored in requests.  Never present in notifications.
+ * @OVS_FLOW_ATTR_MATCH: Nested %OVS_ACTION_ATTR_* attributes specifying
+ * the actions to take for packets that match the wildcarded key. This
+ * attribute is mutually exclusive with OVS_FLOW_ATTR_KEY. However one of the
+ * two is required in any kernel<->user OVS_FLOW_CMD_* messages.
  *
  * These attributes follow the &struct ovs_header within the Generic Netlink
  * payload for %OVS_FLOW_* commands.
@@ -422,6 +454,7 @@ enum ovs_flow_attr {
        OVS_FLOW_ATTR_TCP_FLAGS, /* 8-bit OR'd TCP flags. */
        OVS_FLOW_ATTR_USED,      /* u64 msecs last used in monotonic time. */
        OVS_FLOW_ATTR_CLEAR,     /* Flag to clear stats, tcp_flags, used. */
+       OVS_FLOW_ATTR_MATCH,     /* Sequence of OVS_KEY_ATTR_* attributes. */
        __OVS_FLOW_ATTR_MAX
 };
 
-- 
1.7.9.5

_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev

Reply via email to