Skip to content

Commit

Permalink
Wait for slave interfaces to come up before vrouter-dpdk starts up,
Browse files Browse the repository at this point in the history
especially if the vrouter physical interface is a vlan interface.

Change-Id: Idb313d6a6a081c74cf3764121922139d913eb997
Partial-bug: 1573255
  • Loading branch information
srajag committed May 19, 2016
1 parent 30283ff commit 9d40589
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions common/control_files/vrouter-functions.sh
Expand Up @@ -399,9 +399,11 @@ _dpdk_vrouter_ini_update() {
## Wait till bond interface is up and all slaves attached
##
_dpdk_wait_for_bond_ready() {
bond_dir="/sys/class/net/${DPDK_PHY}/bonding"
#if DPDK_PHY is a vlan, remove the '.'
bond_name=$(echo ${DPDK_PHY} | cut -d. -f1)
bond_dir="/sys/class/net/${bond_name}/bonding"
for iface in $(ifquery --list); do
ifquery $iface | grep "bond-master" | grep ${DPDK_PHY}
ifquery $iface | grep "bond-master" | grep ${bond_name}
if [ $? -eq 0 ];
then
timeout=0
Expand Down Expand Up @@ -440,6 +442,9 @@ vrouter_dpdk_if_bind() {
loops=0
while [ ! -e /sys/class/net/${DPDK_PHY} ]; do
sleep 2
#if DPDK_PHY is a vlan on a bond, might need to bring it up explicitly
# after the slaves are added to the bond (especially if slaves are VFs)
ifup ${DPDK_PHY}
loops=$(($loops + 1))
if [ $loops -ge 60 ]; then
echo "$(date): Error binding physical interface ${DPDK_PHY}: device not found"
Expand Down

0 comments on commit 9d40589

Please sign in to comment.