Skip to content

Commit

Permalink
ovn-controller: Fix log conditions for unexpected openflow messages.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
hzhou8 authored and blp committed May 31, 2017
1 parent c368a46 commit 4284574
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
6 changes: 1 addition & 5 deletions ovn/controller/ofctrl.c
Expand Up @@ -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");
}
Expand Down
2 changes: 1 addition & 1 deletion ovn/controller/pinctrl.c
Expand Up @@ -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);

Expand Down

0 comments on commit 4284574

Please sign in to comment.