From 2ffade6cf26f80cec6e8f3d952721872a28afc78 Mon Sep 17 00:00:00 2001 From: Raja Sivaramakrishnan Date: Thu, 23 Jun 2016 15:16:56 -0700 Subject: [PATCH] Merge following change from 3.0 commit 792717186faf520a4d09f022846cccfecf290652 Author: Raja Sivaramakrishnan Date: Thu May 19 00:15:35 2016 -0700 Wait for slave interfaces to come up before vrouter-dpdk starts up, especially if the vrouter physical interface is a vlan interface. Change-Id: Idb313d6a6a081c74cf3764121922139d913eb997 Partial-bug: 1573255 Change-Id: Icfaf3a33d79c5ed67b306ec7fe86cfb4d59d3ea2 --- common/control_files/vrouter-functions.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/common/control_files/vrouter-functions.sh b/common/control_files/vrouter-functions.sh index 89ce7f35b..a779e2b75 100755 --- a/common/control_files/vrouter-functions.sh +++ b/common/control_files/vrouter-functions.sh @@ -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 @@ -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"