At a high level, I don't think this patch is tracking the right thing.
 We don't actually care how many times the bfd state changes.  What we
actually care about is how many times the result of bfd_forwarding()
changes.  That's because bfd_forwarding() is the function which
actually changes how traffic bounces around.

> diff --git a/lib/bfd.c b/lib/bfd.c
> index 740f4fc..f34b895 100644
> --- a/lib/bfd.c
> +++ b/lib/bfd.c
> @@ -206,6 +206,8 @@ struct bfd {
>                                    /* detect interval. */
>      uint64_t decay_rx_packets;    /* Packets received by 'netdev'. */
>      long long int decay_detect_time; /* Decay detection time. */
> +
> +    uint64_t flap_count;          /* Counts the flapping. */

This comment could be better.  Perhaps "Counts bfd forwarding flaps"?

> +    flap_count = xasprintf("%"PRIu64, bfd->flap_count);
> +    smap_add(smap, "flap_count", flap_count);
> +    free(flap_count);

Could you use smap_add_format() instead?

> +        /* If there is a flap, increments the counter. */
> +        if (bfd->state == STATE_DOWN || state == STATE_DOWN) {

Ethan
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to