summaryrefslogtreecommitdiff
path: root/ovn
diff options
context:
space:
mode:
authorHan Zhou <zhouhan@gmail.com>2017-05-17 16:13:55 -0700
committerBen Pfaff <blp@ovn.org>2017-05-31 15:07:42 -0700
commit42845746a4d3ac68048ae9dd82b1b8595eb501b8 (patch)
treefa06e0226e0a77e4976be492bbf974ee8b47c191 /ovn
parentc368a46275840ab13a526bd4fb153184bf3f4000 (diff)
downloadopenvswitch-42845746a4d3ac68048ae9dd82b1b8595eb501b8.tar.gz
ovn-controller: Fix log conditions for unexpected openflow messages.
Currently in pinctrl.c and ofctrl.c there are similar logic to log ignored messages, which is somehow inaccurate and confusing. For example, OFPTYPE_PACKET_IN is handled only in pinctrl.c but in ofctrl.c it is listed as expected input and not logged as "ignored" messages, while it is in fact unexpected and ignored there. This patch clearup the unnecessary "if" conditions and logs all messages that are not expected/handled honestly, so that there will be logs for debugging if such abnormal case really happens. Signed-off-by: Han Zhou <zhouhan@gmail.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'ovn')
-rw-r--r--ovn/controller/ofctrl.c6
-rw-r--r--ovn/controller/pinctrl.c2
2 files changed, 2 insertions, 6 deletions
diff --git a/ovn/controller/ofctrl.c b/ovn/controller/ofctrl.c
index dc1ed4020..6b8e76def 100644
--- a/ovn/controller/ofctrl.c
+++ b/ovn/controller/ofctrl.c
@@ -587,11 +587,7 @@ ofctrl_recv(const struct ofp_header *oh, enum ofptype type)
} else if (type == OFPTYPE_ERROR) {
static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(30, 300);
log_openflow_rl(&rl, VLL_INFO, oh, "OpenFlow error");
- } else if (type != OFPTYPE_ECHO_REPLY &&
- type != OFPTYPE_BARRIER_REPLY &&
- type != OFPTYPE_PACKET_IN &&
- type != OFPTYPE_PORT_STATUS &&
- type != OFPTYPE_FLOW_REMOVED) {
+ } else {
static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(30, 300);
log_openflow_rl(&rl, VLL_DBG, oh, "OpenFlow packet ignored");
}
diff --git a/ovn/controller/pinctrl.c b/ovn/controller/pinctrl.c
index a77f85f2f..1a9e36988 100644
--- a/ovn/controller/pinctrl.c
+++ b/ovn/controller/pinctrl.c
@@ -1000,7 +1000,7 @@ pinctrl_recv(const struct ofp_header *oh, enum ofptype type,
set_switch_config(swconn, &config);
} else if (type == OFPTYPE_PACKET_IN) {
process_packet_in(oh, ctx);
- } else if (type != OFPTYPE_ECHO_REPLY && type != OFPTYPE_BARRIER_REPLY) {
+ } else {
if (VLOG_IS_DBG_ENABLED()) {
static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(30, 300);