log_success_msg "ovs-vswitchd is already running"
else
# Increase the limit on the number of open file descriptors.
- # On Linux, ovs-vswitchd needs about one file descriptor per
- # switch port, so this allows a very large number of switch
- # ports.
- ulimit -n 5000
+ # On Linux, ovs-vswitchd needs about three file descriptors
+ # per bridge and one file descriptor per bridge port, so this
+ # allows a very large number of bridges and ports.
+ ulimit -n 7500
# Start ovs-vswitchd.
set ovs-vswitchd unix:"$DB_SOCK"
action "Restoring ofport values" "${script_ofports}"
}
+flow_restore_wait () {
+ ovs_vsctl set open_vswitch . other_config:flow-restore-wait="true"
+}
+
+flow_restore_complete () {
+ ovs_vsctl --if-exists remove open_vswitch . other_config \
+ flow-restore-wait="true"
+}
+
restore_flows () {
[ -x "${script_flows}" ] && \
action "Restoring saved flows" "${script_flows}"
action "Removing openvswitch module" rmmod openvswitch
fi
+ # Start vswitchd by asking it to wait till flow restore is finished.
+ flow_restore_wait
start_forwarding
+ # Restore saved flows and inform vswitchd that we are done.
restore_flows
+ flow_restore_complete
add_managers
restore_interfaces
restore_ofports
stop_forwarding
+
+ # Start vswitchd by asking it to wait till flow restore is finished.
+ flow_restore_wait
start_forwarding
- # Restore the saved flows.
+ # Restore saved flows and inform vswitchd that we are done.
restore_flows
+ flow_restore_complete
add_managers
# Restore the interfaces if required. Return true even if restore fails.