datapath: collect mega flow mask stats
[sliver-openvswitch.git] / include / linux / openvswitch.h
index bd2f05f..f46d9d0 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
@@ -83,15 +83,18 @@ enum ovs_datapath_cmd {
  * not be sent.
  * @OVS_DP_ATTR_STATS: Statistics about packets that have passed through the
  * datapath.  Always present in notifications.
+ * @OVS_DP_ATTR_MEGAFLOW_STATS: Statistics about mega flow masks usage for the
+ * datapath. Always present in notifications.
  *
  * These attributes follow the &struct ovs_header within the Generic Netlink
  * payload for %OVS_DP_* commands.
  */
 enum ovs_datapath_attr {
        OVS_DP_ATTR_UNSPEC,
-       OVS_DP_ATTR_NAME,       /* name of dp_ifindex netdev */
-       OVS_DP_ATTR_UPCALL_PID, /* Netlink PID to receive upcalls */
-       OVS_DP_ATTR_STATS,      /* struct ovs_dp_stats */
+       OVS_DP_ATTR_NAME,               /* name of dp_ifindex netdev */
+       OVS_DP_ATTR_UPCALL_PID,         /* Netlink PID to receive upcalls */
+       OVS_DP_ATTR_STATS,              /* struct ovs_dp_stats */
+       OVS_DP_ATTR_MEGAFLOW_STATS,     /* struct ovs_dp_megaflow_stats */
        __OVS_DP_ATTR_MAX
 };
 
@@ -104,6 +107,14 @@ struct ovs_dp_stats {
        __u64 n_flows;           /* Number of flows present */
 };
 
+struct ovs_dp_megaflow_stats {
+       __u64 n_mask_hit;        /* Number of masks used for flow lookups. */
+       __u32 n_masks;           /* Number of masks for the datapath. */
+       __u32 pad0;              /* Pad for future expension. */
+       __u64 pad1;              /* Pad for future expension. */
+       __u64 pad2;              /* Pad for future expension. */
+};
+
 struct ovs_vport_stats {
        __u64   rx_packets;             /* total packets received       */
        __u64   tx_packets;             /* total packets transmitted    */
@@ -282,12 +293,15 @@ enum ovs_key_attr {
        OVS_KEY_ATTR_ND,        /* struct ovs_key_nd */
        OVS_KEY_ATTR_SKB_MARK,  /* u32 skb mark */
        OVS_KEY_ATTR_TUNNEL,    /* Nested set of ovs_tunnel attributes */
+       OVS_KEY_ATTR_SCTP,      /* struct ovs_key_sctp */
 
 #ifdef __KERNEL__
        OVS_KEY_ATTR_IPV4_TUNNEL,  /* struct ovs_key_ipv4_tunnel */
 #endif
 
-       OVS_KEY_ATTR_MPLS = 62, /* struct ovs_key_mpls */
+       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
 };
 
@@ -330,7 +344,7 @@ struct ovs_key_ethernet {
 };
 
 struct ovs_key_mpls {
-       __be32 mpls_top_lse;
+       __be32 mpls_lse;
 };
 
 struct ovs_key_ipv4 {
@@ -362,6 +376,11 @@ struct ovs_key_udp {
        __be16 udp_dst;
 };
 
+struct ovs_key_sctp {
+       __be16 sctp_src;
+       __be16 sctp_dst;
+};
+
 struct ovs_key_icmp {
        __u8 icmp_type;
        __u8 icmp_code;
@@ -408,6 +427,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.
@@ -420,6 +445,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
 };