Skip to content

Commit

Permalink
Merge following change from 3.0
Browse files Browse the repository at this point in the history
commit 792717186faf520a4d09f022846cccfecf290652
Author: Raja Sivaramakrishnan <raja@juniper.net>
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
  • Loading branch information
srajag committed Jun 23, 2016
1 parent 378a321 commit 2ffade6
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 2ffade6

Please sign in to comment.