learning-switch: Don't limit message queued by --with-flows.
authorBen Pfaff <blp@nicira.com>
Wed, 1 Jun 2011 17:53:53 +0000 (10:53 -0700)
committerBen Pfaff <blp@nicira.com>
Wed, 1 Jun 2011 17:53:53 +0000 (10:53 -0700)
queue_tx() intentionally limits the number of outstanding OpenFlow messages
queued to the switch.  This was unintentionally being applied to the
messages queued to the switch at startup by ovs-ofctl's --with-flows
command.  This patch should fix the problem, by calling rconn_send()
directly instead of through queue_tx().

Ahmed reported that with this patch there was still a problem when 30,000
flows were specified in the file.

Reported-by: Ahmed Bilal <numan252@gmail.com>
AUTHORS
lib/learning-switch.c

diff --git a/AUTHORS b/AUTHORS
index b7f6cf5cb7339d0eeb1639b1badecfca6c26c3ae..b6e73721ea9a1170de617aec7bab7b2c95ed984e 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -43,6 +43,7 @@ provided helpful bug reports or suggestions.
 
 Aaron M. Ucko           ucko@debian.org
 Aaron Rosen             arosen@clemson.edu
+Ahmed Bilal             numan252@gmail.com
 Alex Yip                alex@nicira.com
 Alexey I. Froloff       raorn@altlinux.org
 Bob Ball                bob.ball@citrix.com
index fc45b04349f035cd436e820d930efffeddb9bacc..269f0301d2ee6c6ad87c696622b57536f8d2f744 100644 (file)
@@ -138,7 +138,14 @@ lswitch_create(struct rconn *rconn, const struct lswitch_config *cfg)
         const struct ofpbuf *b;
 
         LIST_FOR_EACH (b, list_node, cfg->default_flows) {
-            queue_tx(sw, rconn, ofpbuf_clone(b));
+            struct ofpbuf *copy = ofpbuf_clone(b);
+            int error = rconn_send(rconn, copy, NULL);
+            if (error) {
+                VLOG_INFO_RL(&rl, "%s: failed to queue default flows (%s)",
+                             rconn_get_name(rconn), strerror(error));
+                ofpbuf_delete(copy);
+                break;
+            }
         }
     }