From: Ethan Jackson Date: Wed, 17 Sep 2014 20:22:14 +0000 (-0700) Subject: ofproto: Warn about excessive rule counts in OpenFlow tables. X-Git-Tag: v2.4.0~1391 X-Git-Url: http://git.cascardo.eti.br/?a=commitdiff_plain;h=1a9bb326d8411ec97adc0f34020efca09caf14c4;p=cascardo%2Fovs.git ofproto: Warn about excessive rule counts in OpenFlow tables. 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 Acked-by: Ben Pfaff --- diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c index 7b1d47825..754d290c1 100644 --- a/ofproto/ofproto.c +++ b/ofproto/ofproto.c @@ -1522,6 +1522,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); CLS_FOR_EACH (rule, cr, &table->cls) { if (rule->idle_timeout || rule->hard_timeout) {