From 03ccf3c095447a9c83cab6b7964fe68867bc3c31 Mon Sep 17 00:00:00 2001 From: jjhua Date: Fri, 23 Mar 2012 09:43:58 +0000 Subject: [PATCH] fixed 3499932 and 3499065: remove the original ib configuration; use the loop number instead of 0, 1, 2... git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@11961 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- .../share/xcat/ib/scripts/configiba.1port | 60 ++++++++++++------- .../share/xcat/ib/scripts/configiba.2ports | 20 +++++-- 2 files changed, 55 insertions(+), 25 deletions(-) diff --git a/xCAT-server/share/xcat/ib/scripts/configiba.1port b/xCAT-server/share/xcat/ib/scripts/configiba.1port index df2658841..8a3205cdc 100644 --- a/xCAT-server/share/xcat/ib/scripts/configiba.1port +++ b/xCAT-server/share/xcat/ib/scripts/configiba.1port @@ -39,7 +39,8 @@ then sed -i "s/SDP_LOAD=yes/SDP_LOAD=no/g" /etc/infiniband/openib.conf fi - if [ $OS_name == "suse" ] + #if [ $OS_name == "suse" ] + if [ -f "/etc/modprobe.conf" ] then sed -i "/options ib_ehca nr_ports/d" /etc/modprobe.conf sed -i "/options ib_ehca lock_hcalls/d" /etc/modprobe.conf @@ -53,10 +54,42 @@ then fi +if [ $PLTFRM == "Linux" ] +then + + ib_number=`lspci | grep -i InfiniBand | wc -l` + #loop_number=$[ $ib_number * 2 ] + loop_number=$ib_number + + if [ -f /etc/redhat-release ] + then + OS_name="redhat" + elif [ -f /etc/SuSE-release ] + then + OS_name="suse" + else + echo "Unsupported to config IB on this OS!" + exit + fi + + if [ $OS_name == 'suse' ] + then + dir="/etc/sysconfig/network" + else + dir="/etc/sysconfig/network-scripts" + fi + `rm -f $dir/ifcfg-ib*` +else + loop_number=`lsdev -Cc adapter |grep iba |wc -l` + +fi + + HOST=`hostname -s` -for num in 0 1 +#for num in 0 1 +for (( num=0; num<$loop_number; num++)) do # Take primary node name, add -ib$num and then reverse resolve to get what ip should be nic="ib$num" @@ -89,17 +122,7 @@ do if [ $PLTFRM == "Linux" ] then # Issue openibd for Linux at boot time - if [ -f /etc/redhat-release ] - then - OS_name="redhat" - elif [ -f /etc/SuSE-release ] - then - OS_name="suse" - else - echo "Unsupported to config IB on this OS!" - exit - fi - + if [ -f /etc/sysctl.conf ] then sed -i "/net.ipv4.conf.$nic.arp_filter=1/d" /etc/sysctl.conf @@ -109,13 +132,7 @@ do fi # Write the info to the ifcfg file - if [ $OS_name == 'suse' ] - then - dir="/etc/sysconfig/network" - else - dir="/etc/sysconfig/network-scripts" - fi - echo "DEVICE=$nic + echo "DEVICE=$nic BOOTPROTO=static IPADDR=$ip NETMASK=$netmask @@ -184,7 +201,8 @@ then sleep 10 - for num in 0 1 + #for num in 0 1 + for (( num=0; num<$loop_number; num++)) do sleep 5 #ifup ib$num diff --git a/xCAT-server/share/xcat/ib/scripts/configiba.2ports b/xCAT-server/share/xcat/ib/scripts/configiba.2ports index bbe13ac3a..1ee071a44 100644 --- a/xCAT-server/share/xcat/ib/scripts/configiba.2ports +++ b/xCAT-server/share/xcat/ib/scripts/configiba.2ports @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/sh -vx # IBM(c) 2008 EPL license http://www.eclipse.org/legal/epl-v10.html # Sample xCAT post script for configuring secondary adatper based on eth0 @@ -22,7 +22,6 @@ then exit fi fi - else ib_driver="openibd" fi @@ -49,10 +48,22 @@ then fi +if [ $PLTFRM == "Linux" ] +then + + ib_number=`lspci | grep -i InfiniBand | wc -l` + loop_number=$[ $ib_number * 2 ] + #loop_number=$[ $loop_number - 1 ] +else + loop_number=`lsdev -Cc adapter |grep iba |wc -l` + +fi + HOST=`hostname -s` -for num in 0 1 +#ifor num in 0 1 +for (( num=0; num<$loop_number; num++)) do # Take primary node name, add -ib$num and then reverse resolve to get what ip should be nic="ib$num" @@ -166,7 +177,8 @@ then /sbin/service $ib_driver restart - for num in 0 1 + #for num in 0 1 + for (( num=0; num<$loop_number; num++)) do sleep 5