[ovs-dev] [PATCH] ofp-print: Don't print priority for flow stats requests.

Ethan Jackson ethan at nicira.com
Fri Feb 25 01:10:30 UTC 2011


Looks Good.

On Thu, Feb 24, 2011 at 4:58 PM, Ben Pfaff <blp at nicira.com> wrote:
> A flow stats or aggregate stats request does not have a priority, but we
> were printing one anyway.
>
> Reported-by: Justin Pettit <jpettit at nicira.com>
> ---
>  lib/ofp-print.c    |    4 ++++
>  tests/ofp-print.at |    8 ++++----
>  2 files changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/lib/ofp-print.c b/lib/ofp-print.c
> index bf9bf82..d4f33da 100644
> --- a/lib/ofp-print.c
> +++ b/lib/ofp-print.c
> @@ -1074,6 +1074,10 @@ ofp_print_flow_stats_request(struct ds *string, const struct ofp_header *oh)
>         ofp_print_port_name(string, fsr.out_port);
>     }
>
> +    /* A flow stats request doesn't include a priority, but cls_rule_format()
> +     * will print one unless it is OFP_DEFAULT_PRIORITY. */
> +    fsr.match.priority = OFP_DEFAULT_PRIORITY;
> +
>     ds_put_char(string, ' ');
>     cls_rule_format(&fsr.match, string);
>  }
> diff --git a/tests/ofp-print.at b/tests/ofp-print.at
> index 5b3c849..af5249b 100644
> --- a/tests/ofp-print.at
> +++ b/tests/ofp-print.at
> @@ -411,7 +411,7 @@ ff fe 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \
>  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \
>  00 00 00 00 ff 00 ff ff \
>  "], [0], [dnl
> -OFPST_FLOW request (xid=0x4): priority=0
> +OFPST_FLOW request (xid=0x4): @&t@
>  ])
>  AT_CLEANUP
>
> @@ -460,7 +460,7 @@ ff fe 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \
>  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \
>  00 00 00 00 ff 00 ff ff \
>  "], [0], [dnl
> -OFPST_AGGREGATE request (xid=0x4): priority=0
> +OFPST_AGGREGATE request (xid=0x4): @&t@
>  ])
>  AT_CLEANUP
>
> @@ -716,7 +716,7 @@ AT_CHECK([ovs-ofctl ofp-print "\
>  01 10 00 20 00 00 00 04 ff ff 00 00 00 00 23 20 \
>  00 00 00 00 00 00 00 00 ff ff 00 00 ff 00 00 00 \
>  "], [0], [dnl
> -NXST_FLOW request (xid=0x4): priority=0
> +NXST_FLOW request (xid=0x4): @&t@
>  ])
>  AT_CLEANUP
>
> @@ -876,7 +876,7 @@ AT_CHECK([ovs-ofctl ofp-print "\
>  01 10 00 20 00 00 00 04 ff ff 00 00 00 00 23 20 \
>  00 00 00 01 00 00 00 00 ff ff 00 00 ff 00 00 00 \
>  "], [0], [dnl
> -NXST_AGGREGATE request (xid=0x4): priority=0
> +NXST_AGGREGATE request (xid=0x4): @&t@
>  ])
>  AT_CLEANUP
>
> --
> 1.7.1
>
>
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev_openvswitch.org
>




More information about the dev mailing list