Hello,
I have discovered that RSTP and BFD do not work together. When BFD is
enabled on a link, it first assumes that the link is down and informs this
to RSTP. RSTP then puts that link to DISABLED state (similar as if carrier
was lost).
BFD tries to send its messages over the link, but as RSTP considers port is
DISABLED and therefore not forwarding, no messages are allowed through.
This means BFD will never get its forwarding state to true even the link
itself was working. Therefore RSTP port will remain in DISABLED state
forever.
Seems that the problem is in ofproto-dpif-xlate.c. On openvswitch-2.5.1 I
have overcome the problem with following patch:
diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c
index 9537131..c5bbc98 100644
--- a/ofproto/ofproto-dpif-xlate.c
+++ b/ofproto/ofproto-dpif-xlate.c
@@ -2949,8 +2949,10 @@ compose_output_action__(struct xlate_ctx *ctx,
ofp_port_t ofp_port,
}
return;
}
- } else if (!xport_stp_forward_state(xport) ||
- !xport_rstp_forward_state(xport)) {
+ } else if ((!xport_stp_forward_state(xport) ||
+ !xport_rstp_forward_state(xport)) &&
+ /* BFD messages can be sent when RSTP port is not
forwarding */
+ !(xport->bfd && bfd_should_process_flow(xport->bfd,
flow, wc))) {
if (ctx->xbridge->stp != NULL) {
xlate_report(ctx, "STP not in forwarding state, "
"skipping output");
I also created a new test case to verify this problem and solution. Test
case fails with current OVS code and passes with the patch above:
diff --git a/tests/bfd.at b/tests/bfd.at
index 925af77..307e9ee 100644
--- a/tests/bfd.at
+++ b/tests/bfd.at
@@ -794,3 +794,33 @@ BFD_VSCTL_LIST_IFACE([p1], ["s/^.*flap_count=\(.*\),
forwarding.*$/\1/p"], ["1"]
OVS_VSWITCHD_STOP
AT_CLEANUP
+
+AT_SETUP([bfd - check that BFD works together with RSTP])
+# Create br0 with interfaces p1
+# and br1 with interfaces p2
+# with p1 and p2 connected via unix domain socket
+OVS_VSWITCHD_START(
+ [set bridge br0 rstp_enable=true -- \
+ add-br br1 -- \
+ set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \
+ set bridge br1 datapath-type=dummy -- \
+ set bridge br1 rstp_enable=true -- \
+])
+
+AT_CHECK([ovs-vsctl add-port br0 p1 -- \
+ set interface p1 type=dummy options:pstream=punix:$OVS_RUNDIR/p0.sock
bfd:enable=true -- \
+])
+
+AT_CHECK([ovs-vsctl add-port br1 p2 -- \
+ set interface p2 type=dummy options:stream=unix:$OVS_RUNDIR/p0.sock
bfd:enable=true -- \
+])
+
+ovs-appctl time/stop
+ovs-appctl time/warp 4100 100
+
+# Forwarding should be true
+BFD_CHECK([p1], [true], [false], [none], [up], [No Diagnostic], [none],
[up], [No Diagnostic])
+BFD_CHECK([p2], [true], [false], [none], [up], [No Diagnostic], [none],
[up], [No Diagnostic])
+
+OVS_VSWITCHD_STOP
+AT_CLEANUP
BR, Mika
_______________________________________________
discuss mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-discuss