diff --git a/rdma.conf b/rdma.conf index 33749aa..7bed63d 100644 --- a/rdma.conf +++ b/rdma.conf @@ -13,7 +13,4 @@ RDS_LOAD=no # Note: recent kernels should do this for us, but in case they don't, we'll # leave this option FIXUP_MTRR_REGS=no -# Should we enable the NFSoRDMA service? -NFSoRDMA_LOAD=yes -NFSoRDMA_PORT=2050 diff --git a/rdma.nfs-rdma.init b/rdma.nfs-rdma.init deleted file mode 100644 index 19977fc..0000000 --- a/rdma.nfs-rdma.init +++ /dev/null @@ -1,199 +0,0 @@ -#!/bin/bash -# -# Bring up/down NFSoRDMA support -# -# chkconfig: - 31 59 -# description: Enables/Disables NFS over RDMA interfaces -# config: /etc/rdma/rdma.conf -# -### BEGIN INIT INFO -# Provides: nfs-rdma -# Default-Stop: 0 1 2 3 4 5 6 -# Required-Start: $network $rdma $nfs -# Short-Description: Enables/Disables NFS over RDMA interfaces -# Description: Enables/Disables NFS over RDMA interfaces -### END INIT INFO - -CONFIG=/etc/rdma/rdma.conf - -. /etc/rc.d/init.d/functions - -LOAD_ULP_MODULES="" -if [ -f $CONFIG ]; then - . $CONFIG - - if [ "${NFSoRDMA_LOAD}" == "yes" ]; then - LOAD_ULP_MODULES="svcrdma xprtrdma" - fi - if [ -n "${NFSoRDMA_PORT}" ]; then - PORT=${NFSoRDMA_PORT} - else - PORT=2050 - fi -fi - -UNLOAD_ULP_MODULES="xprtrdma svcrdma" - - -# If module $1 is loaded return - 0 else - 1 -is_module() -{ - /sbin/lsmod | grep -w "$1" > /dev/null 2>&1 - return $? -} - -load_modules() -{ - local RC=0 - - for module in $*; do - if ! is_module $module; then - /sbin/modprobe $module - res=$? - RC=$[ $RC + $res ] - if [ $res -ne 0 ]; then - echo - echo -n "Failed to load module $mod" - fi - fi - done - return $RC -} - -unload_module() -{ - local mod=$1 - # Unload module $1 - if is_module $mod; then - /sbin/rmmod $mod > /dev/null 2>&1 - if [ $? -ne 0 ]; then - echo - echo "Failed to unload $mod" - return 1 - fi - fi - return 0 -} - -start() -{ - local RC=0 - local loaded=0 - - echo -n "Enabling NFSoRDMA support:" - - load_modules $LOAD_ULP_MODULES - RC=$[ $RC + $? ] - - if [ $RC -gt 0 ]; then - for mod in $UNLOAD_ULP_MODULES; do - unload_module $mod - done - echo_failure - echo - return $RC - fi - - echo "rdma $PORT" > /proc/fs/nfsd/portlist - sleep 1 - entry=$(grep rdma /proc/fs/nfsd/portlist) - if [ -z "$entry" ]; then - for mod in $UNLOAD_ULP_MODULES; do - unload_module $mod - done - echo_failure - echo - return 1 - fi - - touch /var/lock/subsys/nfs-rdma - echo_success - echo - return $RC -} - -stop() -{ - echo -n "Disabling NFSoRDMA support:" - - if ! is_module svcrdma; then - # Nothing to do, make sure lock file is gone and return - rm -f /var/lock/subsys/nfs-rdma - echo_success - echo - return 0 - fi - - # Tell the nfs server to quit listening on the rdma port - port=$(grep rdma /proc/fs/nfsd/portlist) - if [ -n "$port" ]; then - echo "-$port" > /proc/fs/nfsd/portlist - # Small sleep to let nfsd process our request - sleep 1 - fi - - # Unload NFSoRDMA modules - for mod in $UNLOAD_ULP_MODULES - do - unload_module $mod - RC=$[ $RC + $? ] - done - - [ $RC -eq 0 ] && rm -f /var/lock/subsys/nfs-rdma - [ $RC -eq 0 ] && echo_success || echo_failure - echo - return $RC -} - -status() -{ - entry=$(grep rdma /proc/fs/nfsd/portlist) - - if [ -z "$entry" ]; then - if [ -f /var/lock/subsys/nfs-rdma ]; then - return 2 - else - return 3 - fi - else - return 0 - fi -} - -restart () -{ - stop - start -} - -condrestart () -{ - [ -e /var/lock/subsys/nfs-rdma ] && restart || return 0 -} - -usage () -{ - echo - echo "Usage: `basename $0` {start|stop|restart|condrestart|try-restart|force-reload|status}" - echo - return 2 -} - -case $1 in - start|stop|restart|condrestart|try-restart|force-reload) - [ `id -u` != "0" ] && exit 4 ;; -esac - -case $1 in - start) start; RC=$? ;; - stop) stop; RC=$? ;; - restart) restart; RC=$? ;; - reload) RC=3 ;; - condrestart) condrestart; RC=$? ;; - try-restart) condrestart; RC=$? ;; - force-reload) condrestart; RC=$? ;; - status) status; RC=$? ;; - *) usage; RC=$? ;; -esac - -exit $RC diff --git a/rdma.sbin b/rdma.sbin index 0d8a2fa..1b81cd2 100644 --- a/rdma.sbin +++ b/rdma.sbin @@ -7,7 +7,7 @@ # CONFIG=/etc/rdma/rdma.conf -FIXUP_MTRR=/usr/sbin/rdma-fixup-mtrr.awk +MTRR_SCRIPT=/usr/sbin/rdma-fixup-mtrr.awk LOAD_ULP_MODULES="" LOAD_CORE_USER_MODULES="ib_umad ib_uverbs ib_ucm rdma_ucm" @@ -44,7 +44,7 @@ fi is_module() { /sbin/lsmod | grep -w "$1" > /dev/null 2>&1 - return $? + return $? } load_modules() @@ -85,7 +85,7 @@ check_mtrr_registers() # return true, and we need to unload the ib_ipath module if it's already # loaded. The udevtrigger in load_hardware_modules will immediately # reload the ib_ipath module for us, so there shouldn't be a problem. - [ -f /proc/mtrr -a -f $MTRR_SCRIPT ] && + [ -f /proc/mtrr -a -f $MTRR_SCRIPT ] && awk -f $MTRR_SCRIPT /proc/mtrr 2>/dev/null && if is_module ib_ipath; then /sbin/rmmod ib_ipath @@ -194,7 +194,7 @@ load_modules $LOAD_CORE_USER_MODULES RC=$[ $RC + $? ] load_modules $LOAD_ULP_MODULES RC=$[ $RC + $? ] - + # Add node description to sysfs IBSYSDIR="/sys/class/infiniband" if [ -d ${IBSYSDIR} ]; then @@ -207,8 +207,8 @@ if [ -d ${IBSYSDIR} ]; then let hca_id++ done fi - + errata_58 errata_56 - + exit $RC diff --git a/rdma.spec b/rdma.spec index 8ec5e42..a79cf5c 100644 --- a/rdma.spec +++ b/rdma.spec @@ -6,7 +6,7 @@ Summary: Infiniband/iWARP Kernel Module Initializer Name: rdma Version: 2.0 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2+ Group: System Environment/Base Source0: rdma.conf @@ -90,6 +90,12 @@ fi %{_initrddir}/%{name} %changelog +* Mon Nov 26 2012 Doug Ledford - 2.0-2 +- Minor whitespace cleanups +- Correct the usage of MTRR_SCRIPT in rdma-init-kernel +- Remove no longer relevant sections of config related to NFSoRDMA + (now handled by nfs-utils-rdma) + * Mon Nov 26 2012 Doug Ledford - 2.0-1 - Update version to reflect addition of systemd support