From 10ab94fef2fc44902c1b16e06e4f4edcc3da7583 Mon Sep 17 00:00:00 2001 From: Niels van Adrichem Date: Wed, 15 Oct 2014 13:54:52 +0000 Subject: [PATCH] ofproto-dpif-xlate: Use bfd forwarding status in fast-failover groups. Integration of each interface' status as confirmed by BFD into the FastFailover Group table. When BFD is configured and function bfd_forwarding() reports false, odp_port_is_alive also reports false in order to have a watched interface report false and omit to another backup. Test-suite has been succesfully run, as well as testing with ICMP echo requests and replies that traffic was succesfully rerouted over the backup path. More extensive load-consumption tests with a function that only checked whether (bfd->state == STATE_UP) have been succesfully performed, but was later changed to use the larger function bfd_forwarding() as it captures all possible exceptions and is properly mutually excluded. Signed-off-by: Niels van Adrichem Signed-off-by: Ben Pfaff --- ofproto/ofproto-dpif-xlate.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c index 07a1f29b971..48576addcbb 100644 --- a/ofproto/ofproto-dpif-xlate.c +++ b/ofproto/ofproto-dpif-xlate.c @@ -1247,6 +1247,7 @@ static bool odp_port_is_alive(const struct xlate_ctx *ctx, ofp_port_t ofp_port) { struct xport *xport; + struct bfd *bfd; xport = get_ofp_port(ctx->xbridge, ofp_port); if (!xport || xport->config & OFPUTIL_PC_PORT_DOWN || @@ -1254,6 +1255,11 @@ odp_port_is_alive(const struct xlate_ctx *ctx, ofp_port_t ofp_port) return false; } + bfd = xport->bfd; + if (bfd && !bfd_forwarding(bfd)) { + return false; + } + return true; }