Make hwtable_dummy compile again.
authorBen Pfaff <blp@nicira.com>
Thu, 14 Aug 2008 23:22:00 +0000 (16:22 -0700)
committerBen Pfaff <blp@nicira.com>
Thu, 14 Aug 2008 23:22:00 +0000 (16:22 -0700)
Bug #109.

datapath/hwtable_dummy/hwtable_dummy.c

index fc797caf3913f3aa82b986f6b38e3f6691a9a5d2..d6699b9d118b25f6e2717eae22825c86d692d664 100644 (file)
@@ -131,18 +131,19 @@ static int table_dummy_timeout(struct datapath *dp, struct sw_table *swt)
        struct sw_flow *flow;
        int del_count = 0;
        uint64_t packet_count = 0;
-       int i = 0;
+       uint64_t byte_count = 0;
+       int reason;
 
        mutex_lock(&dp_mutex);
        list_for_each_entry (flow, &td->flows, node) {
-               /* xxx Retrieve the packet count associated with this entry
-                * xxx and store it in "packet_count".
+               /* xxx Retrieve the packet and byte counts associated with this
+                * entry xxx and store them in "packet_count" and "byte_count".
                 */
 
-               if ((packet_count > flow->packet_count)
-                    && (flow->max_idle != OFP_FLOW_PERMANENT)) {
+               if (packet_count != flow->packet_count) {
                        flow->packet_count = packet_count;
-                       flow->timeout = jiffies + HZ * flow->max_idle;
+                       flow->byte_count = byte_count;
+                       flow->used = jiffies;
                }
 
                reason = flow_timeout(flow);
@@ -154,7 +155,6 @@ static int table_dummy_timeout(struct datapath *dp, struct sw_table *swt)
                        }
                        del_count += do_delete(swt, flow);
                }
-               i++;
        }
        mutex_unlock(&dp_mutex);