Use new method to describe table entries in OpenFlow wire protocol.
[openvswitch] / datapath / table.h
index 12543352b80549eb0545a9c3372bb9dbfa1a3ad8..c47e1e60c803814cfe7dd70e47b43024d6f9a6d1 100644 (file)
@@ -12,9 +12,12 @@ struct datapath;
 
 /* Table statistics. */
 struct sw_table_stats {
-       const char *name;       /* Human-readable name. */
-       unsigned long int n_flows; /* Number of active flows. */
-       unsigned long int max_flows; /* Flow capacity. */
+       const char *name;            /* Human-readable name. */
+       uint32_t wildcards;          /* Bitmap of OFPFW_* wildcards that are
+                                       supported by the table. */
+       unsigned int n_flows;        /* Number of active flows. */
+       unsigned int max_flows;      /* Flow capacity. */
+       unsigned long int n_matched; /* Number of packets that have hit. */
 };
 
 /* Position within an iteration of a sw_table.
@@ -31,6 +34,11 @@ struct sw_table_position {
  * rcu_read_lock.  destroy must be fully serialized.
  */
 struct sw_table {
+       /* Keep track of the number of packets that matched this table.  To
+        * make this 100% accurate, it should be atomic.  However, we're
+        * primarily concerned about speed. */
+       unsigned long int n_matched;
+
        /* Searches 'table' for a flow matching 'key', which must not have any
         * wildcard fields.  Returns the flow if successful, a null pointer
         * otherwise. */