diff --git a/xCAT-server/share/xcat/ib/scripts/configiba.1port b/xCAT-server/share/xcat/ib/scripts/configiba.1port index 400b70ec6..bb1b5331b 100644 --- a/xCAT-server/share/xcat/ib/scripts/configiba.1port +++ b/xCAT-server/share/xcat/ib/scripts/configiba.1port @@ -12,12 +12,21 @@ use Socket; my $PLTFRM = `uname`; chomp $PLTFRM; +my $OS_name; +my $ib_driver; +if ( $ENV{OSVER} && ($ENV{OSVER} =~ /rhe(\D+)(\d+)(\.\d+)?/) ) { + if ( $2 > 5 ) { + $ib_driver = "rdma" + } else { + $ib_driver = "openibd" + } +} + my $HOST = `hostname -s`; chomp $HOST; my @nums = (0..1); my @nics; -my $OS_name; foreach my $num ( @nums ) { # Take primary node name, add -ib$num and then reverse resolve to get what ip should be my $nic = "ib$num"; @@ -107,11 +116,15 @@ foreach my $num ( @nums ) { if ( $PLTFRM eq "Linux" ) { - if ( -f "/etc/infiniband/openib.conf" ) + if ( -f "/etc/rdma/rdma.conf" ) + { + updatefile("/etc/rdma/rdma.conf", "SDP_LOAD=yes", "SDP_LOAD=no"); + } elsif ( -f "/etc/infiniband/openib.conf" ) { updatefile("/etc/infiniband/openib.conf", "SDP_LOAD=yes", "SDP_LOAD=no"); } + if ( $OS_name eq 'suse') { updatefile("/etc/modprobe.conf", "options ib_ehca nr_ports"); @@ -120,9 +133,9 @@ if ( $PLTFRM eq "Linux" ) { runcmd("echo 'options ib_ehca lock_hcalls=0' >> /etc/modprobe.conf"); } - my $openibd_cmd = "/sbin/chkconfig --level 2345 openibd on"; + my $openibd_cmd = "/sbin/chkconfig --level 2345 $ib_driver on"; runcmd($openibd_cmd); - my $openibd_start_cmd = "/sbin/service openibd restart"; + my $openibd_start_cmd = "/sbin/service $ib_driver restart"; runcmd($openibd_start_cmd); runcmd("sysctl -p"); diff --git a/xCAT-server/share/xcat/ib/scripts/configiba.2ports b/xCAT-server/share/xcat/ib/scripts/configiba.2ports index 2699ba3a3..ff8fd0754 100644 --- a/xCAT-server/share/xcat/ib/scripts/configiba.2ports +++ b/xCAT-server/share/xcat/ib/scripts/configiba.2ports @@ -12,6 +12,16 @@ use Socket; my $PLTFRM = `uname`; chomp $PLTFRM; +my $OS_name; +my $ib_driver; +if ( $ENV{OSVER} && ($ENV{OSVER} =~ /rhe(\D+)(\d+)(\.\d+)?/) ) { + if ( $2 > 5 ) { + $ib_driver = "rdma" + } else { + $ib_driver = "openibd" + } +} + my $HOST = `hostname -s`; chomp $HOST; @@ -38,8 +48,7 @@ foreach my $num ( @nums ) { my $gateway = "$first.$second.255.254"; if ( $PLTFRM eq "Linux" ) { - # Issue openibd for Linux at boot time - my $OS_name; + # Issue rdma for Linux at boot time if ( -f '/etc/redhat-release' ) { $OS_name = "redhat"; @@ -108,21 +117,26 @@ foreach my $num ( @nums ) { if ( $PLTFRM eq "Linux" ) { - if ( -f "/etc/infiniband/openib.conf" ) + if ( -f "/etc/rdma/rdma.conf" ) + { + updatefile("/etc/rdma/rdma.conf", "SDP_LOAD=yes", "SDP_LOAD=no"); + } elsif ( -f "/etc/infiniband/openib.conf" ) { updatefile("/etc/infiniband/openib.conf", "SDP_LOAD=yes", "SDP_LOAD=no"); } + if ( -f "/etc/modprobe.conf" ) { updatefile("/etc/modprobe.conf", "options ib_ehca nr_ports=1"); updatefile("/etc/modprobe.conf", "options ib_ehca lock_hcalls=0"); } + runcmd("echo 'options ib_ehca lock_hcalls=0' >> /etc/modprobe.conf"); - my $openibd_cmd = "/sbin/chkconfig --level 2345 openibd on"; - runcmd($openibd_cmd); - my $openibd_start_cmd = "/sbin/service openibd restart"; - runcmd($openibd_start_cmd); + my $rdma_cmd = "/sbin/chkconfig --level 2345 $ib_driver on"; + runcmd($rdma_cmd); + my $rdma_start_cmd = "/sbin/service $ib_driver restart"; + runcmd($rdma_start_cmd); runcmd("sysctl -p");