[ovs-dev] [RFC 8/9] revalidator: Only revalidate high-throughput flows.

Joe Stringer joestringer at nicira.com
Fri Mar 7 01:20:31 UTC 2014


Previously we would revalidate all flows if the "need_revalidate" flag
was raised. This patch modifies the logic to delete low throughput flows
rather than revalidate them. High-throughput flows are unaffected by
this change. This patch identifies the flows based on the number of bytes
seen since the last dump.

This change is targeted at situations where:
* Flow dump duration is around 1 second.
* Revalidation is triggered by bridge reconfiguration or learning.

After the need_revalidate flag is set, next time a new flow dump session
starts, revalidators will begin revalidating the flows. This full
revalidation is more expensive, which significantly increases the flow
dump duration. At the end of this dump session, the datapath flow
management algorithms kick in for the next dump:

* If flow dump duration becomes too long, the flow limit is decreased.
* The number of flows in the datapath then exceeds the flow_limit.
* As the flow_limit is exceeded, max_idle is temporarily set to 100ms.
* Revalidators delete all flows that haven't seen traffic recently.

The effect of this is that many low-throughput flows are deleted after
revalidation, even if they are valid. The revalidation is unnecessary
for flows that would be deleted anyway, so this patch skips the
revalidation step for those flows.

Initial testing shows a modest improvement in TCP_CRR performance (~10%)
when the switch is constantly revalidating.

XXX: This patch breaks tests which rely on asking the datapath for flow
information. Most likely cause is that the flows are revalidated and
determined to be low-throughput (and are therefore deleted) before the
tests get a chance to check them.

Signed-off-by: Joe Stringer <joestringer at nicira.com>
---
 ofproto/ofproto-dpif-upcall.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/ofproto/ofproto-dpif-upcall.c b/ofproto/ofproto-dpif-upcall.c
index d8644de..f72c3fd 100644
--- a/ofproto/ofproto-dpif-upcall.c
+++ b/ofproto/ofproto-dpif-upcall.c
@@ -42,6 +42,7 @@
 #define FLOW_MISS_MAX_BATCH 50
 #define REVALIDATE_MAX_BATCH 50
 #define MAX_IDLE 1500
+#define REVALIDATION_THRESHOLD 8192 /* bytes */
 
 VLOG_DEFINE_THIS_MODULE(ofproto_dpif_upcall);
 
@@ -1542,6 +1543,7 @@ revalidate_udumps(struct revalidator *revalidator, struct list *udumps)
     n_ops = 0;
     LIST_FOR_EACH_SAFE (udump, next_udump, list_node, udumps) {
         long long int used, now;
+        unsigned threshold;
         struct udpif_key *ukey;
 
         now = time_msec();
@@ -1566,7 +1568,10 @@ revalidate_udumps(struct revalidator *revalidator, struct list *udumps)
         }
         ukey->mark = true;
 
-        if (!revalidate_ukey(udpif, udump, ukey)) {
+        /* Only perform revalidation if the flow has high throughput. */
+        threshold = REVALIDATION_THRESHOLD;
+        if ((udump->need_revalidate && udump->stats.n_bytes < threshold)
+            || !revalidate_ukey(udpif, udump, ukey)) {
             dpif_flow_del(udpif->dpif, udump->key, udump->key_len, NULL);
             ukey_delete(revalidator, ukey);
         }
-- 
1.7.9.5




More information about the dev mailing list