[ovs-dev] [PATCH] dpif-netdev: Make a log message more detailed.

Andy Zhou azhou at nicira.com
Tue Feb 4 07:54:45 UTC 2014


Looks good to me.
Acked-by: Andy Zhou <azhou at nicira.com>


On Mon, Feb 3, 2014 at 12:55 PM, Ben Pfaff <blp at nicira.com> wrote:

> This would have helped me track down a bug I was hunting just now.
>
> Signed-off-by: Ben Pfaff <blp at nicira.com>
> ---
>  lib/dpif-netdev.c |    8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
> index cb64bdc..0268793 100644
> --- a/lib/dpif-netdev.c
> +++ b/lib/dpif-netdev.c
> @@ -1033,7 +1033,10 @@ dpif_netdev_mask_from_nlattrs(const struct nlattr
> *key, uint32_t key_len,
>                                struct flow *mask)
>  {
>      if (mask_key_len) {
> -        if (odp_flow_key_to_mask(mask_key, mask_key_len, mask, flow)) {
> +        enum odp_key_fitness fitness;
> +
> +        fitness = odp_flow_key_to_mask(mask_key, mask_key_len, mask,
> flow);
> +        if (fitness) {
>              /* This should not happen: it indicates that
>               * odp_flow_key_from_mask() and odp_flow_key_to_mask()
>               * disagree on the acceptable form of a mask.  Log the problem
> @@ -1046,7 +1049,8 @@ dpif_netdev_mask_from_nlattrs(const struct nlattr
> *key, uint32_t key_len,
>                  ds_init(&s);
>                  odp_flow_format(key, key_len, mask_key, mask_key_len,
> NULL, &s,
>                                  true);
> -                VLOG_ERR("internal error parsing flow mask %s",
> ds_cstr(&s));
> +                VLOG_ERR("internal error parsing flow mask %s (%s)",
> +                         ds_cstr(&s), odp_key_fitness_to_string(fitness));
>                  ds_destroy(&s);
>              }
>
> --
> 1.7.10.4
>
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openvswitch.org/pipermail/ovs-dev/attachments/20140203/3dac12b9/attachment-0003.html>


More information about the dev mailing list