Reduce default burst limit to rate limit / 4.
authorBen Pfaff <blp@nicira.com>
Tue, 12 Aug 2008 23:15:42 +0000 (16:15 -0700)
committerBen Pfaff <blp@nicira.com>
Tue, 12 Aug 2008 23:15:42 +0000 (16:15 -0700)
With the previous default burst limit of rate limit * 2, we would queue
up 2 seconds worth of packet_in messages.  This is not only much more
than actually needed, it causes an actual problem: the datapath only
retains buffered packets for up to 1 second, by default, so that flow
setups sent in response have no packet to work with.

secchan/secchan.c

index e54fb2f..64a1f23 100644 (file)
@@ -1219,13 +1219,10 @@ parse_options(int argc, char *argv[], struct settings *s)
             VLOG_WARN("Rate limit set to unusually low value %d",
                       s->rate_limit);
         }
-
         if (!s->burst_limit) {
-            s->burst_limit = s->rate_limit * 2;
-        } else if (s->burst_limit < s->rate_limit) {
-            VLOG_WARN("Burst limit (%d) set lower than rate limit (%d)",
-                      s->burst_limit, s->rate_limit);
+            s->burst_limit = s->rate_limit / 4;
         }
+        s->burst_limit = MAX(s->burst_limit, 1);
         s->burst_limit = MIN(s->burst_limit, INT_MAX / 1000);
     }
 }