(Apparently I've been sitting on this since yesterday, sorry.)
On Thu, Aug 11, 2016 at 05:51:39PM +0530, Numan Siddique wrote:
> When ovn-controller reconnects to the ovs-vswitchd, it deletes all the
> OF flows in the switch. It doesn't install the flows again, leaving
> the datapath broken unless ovn-controller is restarted or ovn-northd
> updates the SB DB.
>
> The reason for this is
> - lflow_reset_processing() is not called after the reconnection
> - the hmap "installed_flows" is not cleared, because of which
> ofctrl_put skips adding the flows to the switch.
>
> This patch fixes the issue and also adds a test case to test
> this scenario.
>
> Signed-off-by: Numan Siddique <[email protected]>
> ---
> ovn/controller/ofctrl.c | 7 ++++
> tests/ovn.at | 95
> +++++++++++++++++++++++++++++++++++++++++++++++++
> 2 files changed, 102 insertions(+)
>
> v1 -> v2
> --------
> * Enhanced the test case to restart vswitchd and restore the flows
Thanks for the patch!
I folded in the following incremental so that the test is not so
sensitive to timing (also it will execute faster in the common case).
I applied this to master, thanks again!
--8<--------------------------cut here-------------------------->8--
diff --git a/tests/ovn.at b/tests/ovn.at
index 8f2b50c..cc40b26 100644
--- a/tests/ovn.at
+++ b/tests/ovn.at
@@ -4388,19 +4388,19 @@ restart_vswitchd () {
# Save the flows, restart vswitchd and restore the flows
restart_vswitchd true
-sleep 2
-total_flows_after_restart=`as hv1 ovs-ofctl dump-flows br-int | wc -l`
-echo "Total flows after vswitchd restart = " $total_flows_after_restart
-
-AT_CHECK([test "${total_flows}" = "${total_flows_after_restart}"])
+OVS_WAIT_UNTIL([
+ total_flows_after_restart=`as hv1 ovs-ofctl dump-flows br-int | wc -l`
+ echo "Total flows after vswitchd restart = " $total_flows_after_restart
+ test "${total_flows}" = "${total_flows_after_restart}"
+])
# Restart vswitchd without restoring
restart_vswitchd false
-sleep 2
-total_flows_after_restart=`as hv1 ovs-ofctl dump-flows br-int | wc -l`
-echo "Total flows after vswitchd restart = " $total_flows_after_restart
-
-AT_CHECK([test "${total_flows}" = "${total_flows_after_restart}"])
+OVS_WAIT_UNTIL([
+ total_flows_after_restart=`as hv1 ovs-ofctl dump-flows br-int | wc -l`
+ echo "Total flows after vswitchd restart = " $total_flows_after_restart
+ test "${total_flows}" = "${total_flows_after_restart}"
+])
OVN_CLEANUP([hv1])
AT_CLEANUP
_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev