Skip to content

Commit

Permalink
feat: reduce wait time by counting the flow num.
Browse files Browse the repository at this point in the history
(cherry picked from commit c24f678)
  • Loading branch information
oilbeater committed Aug 30, 2022
1 parent c8e36b5 commit c18cae4
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions dist/images/start-ovs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ HW_OFFLOAD=${HW_OFFLOAD:-false}
ENABLE_SSL=${ENABLE_SSL:-false}
OVN_DB_IPS=${OVN_DB_IPS:-}
TUNNEL_TYPE=${TUNNEL_TYPE:-geneve}
FLOW_WAIT=${FLOW_WAIT:-5}
FLOW_LIMIT=${FLOW_LIMIT:-10}

# Check required kernel module
modinfo openvswitch
Expand Down Expand Up @@ -170,7 +170,16 @@ fi

# Wait ovn-controller finish init flow compute and update it to vswitchd,
# then update flow-restore-wait to indicate vswitchd to process flows
sleep ${FLOW_WAIT}
set +e
flow_num=$(ovs-ofctl dump-flows br-int | wc -l)
while [ $flow_num -le $FLOW_LIMIT ]
do
echo "$flow_num flows now, waiting for ovs-vswitchd flow ready"
sleep 1
flow_num=$(ovs-ofctl dump-flows br-int | wc -l)
done
set -e

ovs-vsctl --no-wait set open_vswitch . other_config:flow-restore-wait="false"

chmod 600 /etc/openvswitch/*
Expand Down

0 comments on commit c18cae4

Please sign in to comment.