]> git.proxmox.com Git - ovs.git/commitdiff
ofproto-dpif-xlate: Support BFD, CFM, carrier, and LACP for port liveness.
authorBen Pfaff <blp@nicira.com>
Thu, 16 Oct 2014 22:00:03 +0000 (15:00 -0700)
committerBen Pfaff <blp@nicira.com>
Thu, 16 Oct 2014 22:28:56 +0000 (15:28 -0700)
This is simpler and shorter than handling each of these by itself.

CC: Niels van Adrichem <N.L.M.vanAdrichem@tudelft.nl>
Suggested-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Alex Wang <alexw@nicira.com>
ofproto/ofproto-dpif-xlate.c

index 48576addcbb3531f7a671eb815895e2b40707106..d3ad62acbc0d3149f9ba5c2fc61b504628a549cb 100644 (file)
@@ -1246,21 +1246,8 @@ ofp_port_to_odp_port(const struct xbridge *xbridge, ofp_port_t ofp_port)
 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 ||
-        xport->state & OFPUTIL_PS_LINK_DOWN) {
-        return false;
-    }
-
-    bfd = xport->bfd;
-    if (bfd && !bfd_forwarding(bfd)) {
-        return false;
-    }
-
-    return true;
+    struct xport *xport = get_ofp_port(ctx->xbridge, ofp_port);
+    return xport && xport->may_enable;
 }
 
 static struct ofputil_bucket *