ofproto-dpif: Actually log errors in facet_check_consistency()
authorSimon Horman <horms@verge.net.au>
Wed, 5 Jun 2013 13:28:47 +0000 (13:28 +0000)
committerEthan Jackson <ethan@nicira.com>
Thu, 6 Jun 2013 18:11:57 +0000 (11:11 -0700)
facet_check_consistency() goes to some effort to create informative
error messages, protected by a rate limit, but does not actually
log these messages.

This appears to be an unintended side effect of
4dff90977694784e67e9c08cc72dee28ebc343ae ("ofproto-dpif: Move
odp_actions from subfacet to facet.").  This patch restores the
logging behaviour present prior to the above commit.

This patch also reverses a changes made by the same commit to use
ds_put_cstr() instead of ds_put_char() in facet_check_consistency().

Cc: Justin Pettit <jpettit@nicira.com>
Cc: Ethan Jackson <ethan@nicira.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ethan Jackson <ethan@nicira.com>
ofproto/ofproto-dpif.c

index a9d2ddd..776be96 100644 (file)
@@ -4943,8 +4943,9 @@ facet_check_consistency(struct facet *facet)
             ds_put_format(&s, ") (should have been table=%"PRIu8",",
                           rule->up.table_id);
             cls_rule_format(&rule->up.cr, &s);
-            ds_put_cstr(&s, ")\n");
+            ds_put_char(&s, ')');
 
+            VLOG_WARN("%s", ds_cstr(&s));
             ds_destroy(&s);
         }
         return false;
@@ -4970,13 +4971,14 @@ facet_check_consistency(struct facet *facet)
             ds_put_cstr(&s, ") (correct actions: ");
             format_odp_actions(&s, xout.odp_actions.data,
                                xout.odp_actions.size);
-            ds_put_cstr(&s, ")");
+            ds_put_char(&s, ')');
         }
 
         if (facet->xout.slow != xout.slow) {
             ds_put_format(&s, " slow path incorrect. should be %d", xout.slow);
         }
 
+        VLOG_WARN("%s", ds_cstr(&s));
         ds_destroy(&s);
     }
     xlate_out_uninit(&xout);