From: Phil Cayton Date: Tue, 19 Aug 2014 19:11:31 +0000 (-0700) Subject: Changes to ofed-mic script to better handle IPoIB interfaces X-Git-Tag: vofed-3.12-1-rc1^0 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=df134bf16600ea38f39de6c995a52a9b05b9fecc;p=~emulex%2Ffor-vlad%2Fcompat-rdma.git Changes to ofed-mic script to better handle IPoIB interfaces List IPoIB interfaces brought up on card following card name and colon (:), ie mic0 : ib0 ib1 If IF on card fails to come up (ie ifup ib0 fails), print offending card and interface, keep trying other interfaces. If any IPoIB interfaces fail to come up don't assume card does not exist and try other hostnames. --- diff --git a/ofed_scripts/ofed-mic b/ofed_scripts/ofed-mic index 4ad6b08..0f6d487 100755 --- a/ofed_scripts/ofed-mic +++ b/ofed_scripts/ofed-mic @@ -91,31 +91,39 @@ start_mic() # load ibscif first with any options: $ssh $1 /sbin/modprobe ibscif $ibscif_opt && $ssh $1 /etc/init.d/ibmodules start &> /dev/null - - errors+=$? + [ $? != 0 ] && return 1 conf=/etc/mpss/ipoib.conf if [ -f "$conf" ]; then source "$conf" if [ "${ipoib_enabled}" == "yes" ] ; then - once=0 - echo -n -\ $ssh $1 modprobe ib_ipoib ${ipoib_parms} + [ $? != 0 ] && return 1 sleep 2 ipoib_list=`ls $sysfs/class/net | grep ib` for i in $ipoib_list ; do card_if=$2_$i IP=${!card_if} if [ ! -z "$IP" ] ; then + # print once after "micN" + [ -z "$once" ] && echo -ne ": " once=1 - echo -n $i\ - mode=`cat $sysfs/class/net/$i/mode` - $ssh $1 echo $mode \> /sys/class/net/$i/mode + $ssh $1 ifconfig $i $IP + # if fail to bring up IF, log and keep trying others + if [ $? != 0 ] ; then + errors+=1 + echo $card_if failed + continue + else + echo -ne "$i " + fi + + mode=`cat $sysfs/class/net/$i/mode` && + $ssh $1 echo $mode \> /sys/class/net/$i/mode errors+=$? fi done - if [ $once -eq 1 ] ; then echo -n -\ ; fi fi fi