datapath: Mega flow implementation
[sliver-openvswitch.git] / include / linux / openvswitch.h
index 63d1cac..a119b14 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007-2011 Nicira, Inc.
+ * Copyright (c) 2007-2013 Nicira, Inc.
  *
  * This file is offered under your choice of two licenses: Apache 2.0 or GNU
  * GPL 2.0 or later.  The permission statements for each of these licenses is
@@ -41,6 +41,7 @@
 #define _LINUX_OPENVSWITCH_H 1
 
 #include <linux/types.h>
+#include <linux/if_ether.h>
 
 /**
  * struct ovs_header - header for OVS Generic Netlink messages.
@@ -234,14 +235,15 @@ enum ovs_vport_attr {
 
 #define OVS_VPORT_ATTR_MAX (__OVS_VPORT_ATTR_MAX - 1)
 
-/* OVS_VPORT_ATTR_OPTIONS attributes for patch vports. */
+/* OVS_VPORT_ATTR_OPTIONS attributes for tunnels.
+ */
 enum {
-       OVS_PATCH_ATTR_UNSPEC,
-       OVS_PATCH_ATTR_PEER,    /* name of peer vport, as a string */
-       __OVS_PATCH_ATTR_MAX
+       OVS_TUNNEL_ATTR_UNSPEC,
+       OVS_TUNNEL_ATTR_DST_PORT, /* 16-bit UDP port, used by L4 tunnels. */
+       __OVS_TUNNEL_ATTR_MAX
 };
 
-#define OVS_PATCH_ATTR_MAX (__OVS_PATCH_ATTR_MAX - 1)
+#define OVS_TUNNEL_ATTR_MAX (__OVS_TUNNEL_ATTR_MAX - 1)
 
 /* Flows. */
 
@@ -285,8 +287,9 @@ enum ovs_key_attr {
        OVS_KEY_ATTR_IPV4_TUNNEL,  /* struct ovs_key_ipv4_tunnel */
 #endif
 
-       OVS_KEY_ATTR_MPLS = 62, /* struct ovs_key_mpls */
-       OVS_KEY_ATTR_TUN_ID = 63,  /* be64 tunnel ID */
+       OVS_KEY_ATTR_MPLS = 62, /* array of struct ovs_key_mpls.
+                                * The implementation may restrict
+                                * the accepted length of the array. */
        __OVS_KEY_ATTR_MAX
 };
 
@@ -324,12 +327,12 @@ enum ovs_frag_type {
 #define OVS_FRAG_TYPE_MAX (__OVS_FRAG_TYPE_MAX - 1)
 
 struct ovs_key_ethernet {
-       __u8     eth_src[6];
-       __u8     eth_dst[6];
+       __u8     eth_src[ETH_ALEN];
+       __u8     eth_dst[ETH_ALEN];
 };
 
 struct ovs_key_mpls {
-       __be32 mpls_top_lse;
+       __be32 mpls_lse;
 };
 
 struct ovs_key_ipv4 {
@@ -375,14 +378,14 @@ struct ovs_key_arp {
        __be32 arp_sip;
        __be32 arp_tip;
        __be16 arp_op;
-       __u8   arp_sha[6];
-       __u8   arp_tha[6];
+       __u8   arp_sha[ETH_ALEN];
+       __u8   arp_tha[ETH_ALEN];
 };
 
 struct ovs_key_nd {
        __u32 nd_target[4];
-       __u8  nd_sll[6];
-       __u8  nd_tll[6];
+       __u8  nd_sll[ETH_ALEN];
+       __u8  nd_tll[ETH_ALEN];
 };
 
 /**
@@ -407,6 +410,12 @@ 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_MASK: Nested %OVS_KEY_ATTR_* attributes specifying the
+ * mask bits for wildcarded flow match. Mask bit value '1' specifies exact
+ * match with corresponding flow key bit, while mask bit value '0' specifies
+ * a wildcarded match. Omitting attribute is treated as wildcarding all
+ * corresponding fields. Optional for all requests. If not present,
+ * all flow key bits are exact match bits.
  *
  * These attributes follow the &struct ovs_header within the Generic Netlink
  * payload for %OVS_FLOW_* commands.
@@ -419,6 +428,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_MASK,      /* Sequence of OVS_KEY_ATTR_* attributes. */
        __OVS_FLOW_ATTR_MAX
 };