diff mbox

[ovs-dev,ovn-ipv6,02/26] ovn-controller: Log OpenFlow errors at "info" level.

Message ID 1468306616-125783-3-git-send-email-jpettit@ovn.org
State Accepted
Headers show

Commit Message

Justin Pettit July 12, 2016, 6:56 a.m. UTC
Otherwise, errors are logged at "debug" level.  Errors when pushing
flows can then seemingly be silently lost.

Signed-off-by: Justin Pettit <jpettit@ovn.org>
---
 ovn/controller/ofctrl.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Justin Pettit July 12, 2016, 8:54 p.m. UTC | #1
> On Jul 12, 2016, at 1:28 PM, Ben Pfaff <blp@ovn.org> wrote:
> 
> On Mon, Jul 11, 2016 at 11:56:32PM -0700, Justin Pettit wrote:
>> Otherwise, errors are logged at "debug" level.  Errors when pushing
>> flows can then seemingly be silently lost.
>> 
>> Signed-off-by: Justin Pettit <jpettit@ovn.org>
> 
> It'd be a little cleaner like this:

Whoops.  You're right; that is better.

Thanks,

--Justin
diff mbox

Patch

diff --git a/ovn/controller/ofctrl.c b/ovn/controller/ofctrl.c
index f47e7e1..a67dde5 100644
--- a/ovn/controller/ofctrl.c
+++ b/ovn/controller/ofctrl.c
@@ -478,6 +478,12 @@  ofctrl_recv(const struct ofp_header *oh, enum ofptype type)
 {
     if (type == OFPTYPE_ECHO_REQUEST) {
         queue_msg(make_echo_reply(oh));
+    } else if (type == OFPTYPE_ERROR) {
+        static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(30, 300);
+
+        char *s = ofp_to_string(oh, ntohs(oh->length), 2);
+        VLOG_INFO_RL(&rl, "OpenFlow error: %s", s);
+        free(s);
     } else if (type != OFPTYPE_ECHO_REPLY &&
                type != OFPTYPE_BARRIER_REPLY &&
                type != OFPTYPE_PACKET_IN &&