ofproto: Warn about excessive rule counts in OpenFlow tables.
authorEthan Jackson <ethan@nicira.com>
Wed, 17 Sep 2014 20:22:14 +0000 (13:22 -0700)
committerEthan Jackson <ethan@nicira.com>
Thu, 18 Sep 2014 01:26:41 +0000 (18:26 -0700)
Frequently we've run into controller bugs which result in hundreds of
thousands, or even millions of rules being installed in an OpenFlow
table.  This isn't something trouble-shooters naturally think of to
check for, so it's nice to have a low rate warning message to hint at
the potential problem.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
ofproto/ofproto.c

index 4cb0520..7563cfd 100644 (file)
@@ -1478,6 +1478,14 @@ ofproto_run(struct ofproto *p)
                 continue;
             }
 
+            if (classifier_count(&table->cls) > 100000) {
+                static struct vlog_rate_limit count_rl =
+                    VLOG_RATE_LIMIT_INIT(1, 1);
+                VLOG_WARN_RL(&count_rl, "Table %"PRIuSIZE" has an excessive"
+                             " number of rules: %d", i,
+                             classifier_count(&table->cls));
+            }
+
             ovs_mutex_lock(&ofproto_mutex);
             fat_rwlock_rdlock(&table->cls.rwlock);
             cls_cursor_init(&cursor, &table->cls, NULL);