[ovs-dev] [PATCH 2/3] tunnel: Log sanely in tnl_port_receive().
Yifeng Sun
pkusunyifeng at gmail.com
Thu Dec 28 22:32:01 UTC 2017
Looks good, thanks.
Reviewed-by: Yifeng Sun <pkusunyifeng at gmail.com>
On Thu, Dec 28, 2017 at 12:34 PM, Ben Pfaff <blp at ovn.org> wrote:
> When this function was introduced in 2012, it modified its 'flow' argument
> and logged the changes (at debug level). However, since 2013 it has no
> longer modified its 'flow' argument, but the logging was still oriented
> around the idea that it did. This commit fixes up the logging to make
> sense again.
>
> This doesn't fix an actual bug that causes problems, but it does fix a
> conceptual error.
>
> Fixes: 2301f7ebc15e ("tunnel: Make tnl_port_receive() parameter 'const'.")
> Signed-off-by: Ben Pfaff <blp at ovn.org>
> ---
> ofproto/tunnel.c | 16 +++-------------
> 1 file changed, 3 insertions(+), 13 deletions(-)
>
> diff --git a/ofproto/tunnel.c b/ofproto/tunnel.c
> index 9896d715a6f7..f6d266a00607 100644
> --- a/ofproto/tunnel.c
> +++ b/ofproto/tunnel.c
> @@ -301,7 +301,6 @@ tnl_port_del(const struct ofport_dpif *ofport,
> odp_port_t odp_port)
> const struct ofport_dpif *
> tnl_port_receive(const struct flow *flow) OVS_EXCLUDED(rwlock)
> {
> - char *pre_flow_str = NULL;
> const struct ofport_dpif *ofport;
> struct tnl_port *tnl_port;
>
> @@ -318,20 +317,11 @@ tnl_port_receive(const struct flow *flow)
> OVS_EXCLUDED(rwlock)
> }
>
> if (!VLOG_DROP_DBG(&dbg_rl)) {
> - pre_flow_str = flow_to_string(flow, NULL);
> - }
> -
> - if (pre_flow_str) {
> - char *post_flow_str = flow_to_string(flow, NULL);
> + char *flow_str = flow_to_string(flow, NULL);
> char *tnl_str = tnl_port_fmt(tnl_port);
> - VLOG_DBG("flow received\n"
> - "%s"
> - " pre: %s\n"
> - "post: %s",
> - tnl_str, pre_flow_str, post_flow_str);
> + VLOG_DBG("tunnel port %s receive from flow %s", tnl_str,
> flow_str);
> free(tnl_str);
> - free(pre_flow_str);
> - free(post_flow_str);
> + free(flow_str);
> }
>
> out:
> --
> 2.10.2
>
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>
More information about the dev
mailing list