]> git.openfabrics.org - ~emulex/compat-rdma_3.12.git/commitdiff
Updated ofed_scripts for OFED-3.12 release
authorVladimir Sokolovsky <vlad@mellanox.com>
Sun, 18 Aug 2013 13:43:45 +0000 (16:43 +0300)
committerVladimir Sokolovsky <vlad@mellanox.com>
Mon, 30 Sep 2013 06:07:52 +0000 (09:07 +0300)
Signed-off-by: Vladimir Sokolovsky <vlad@mellanox.com>
19 files changed:
Makefile
makefile
ofed_scripts/Makefile [deleted file]
ofed_scripts/checkout_files
ofed_scripts/configure [deleted file]
ofed_scripts/connectx_port_config
ofed_scripts/gen-compat-autoconf.sh [new file with mode: 0755]
ofed_scripts/gen-compat-config.sh [new file with mode: 0755]
ofed_scripts/ib_sdp.conf [deleted file]
ofed_scripts/makefile [deleted file]
ofed_scripts/mlxnet [deleted file]
ofed_scripts/mlxnet.conf [deleted file]
ofed_scripts/ofa_kernel.spec [deleted file]
ofed_scripts/ofed_checkout.sh
ofed_scripts/ofed_patch.sh
ofed_scripts/openibd
ofed_scripts/set_irq_affinity.sh [deleted file]
ofed_scripts/show_irq_affinity.sh [deleted file]
ofed_scripts/sysctl_perf_tuning

index e6e07dae6b83a72668fb1b73893119c0ec8381a6..57e7c7b8066129c179bf8850dfcb7707fa83086f 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -3,5 +3,6 @@ obj-$(CONFIG_INFINIBAND)        += drivers/infiniband/
 obj-$(CONFIG_CHELSIO_T3)        += drivers/net/ethernet/chelsio/cxgb3/
 obj-$(CONFIG_CHELSIO_T4)        += drivers/net/ethernet/chelsio/cxgb4/
 obj-$(CONFIG_MLX4_CORE)         += drivers/net/ethernet/mellanox/mlx4/
+obj-$(CONFIG_MLX5_CORE)         += drivers/net/ethernet/mellanox/mlx5/core/
 obj-$(CONFIG_RDS)               += net/rds/
 obj-$(CONFIG_SUNRPC_XPRT_RDMA)  += net/sunrpc/xprtrdma/
index 86493d6aeec54413b36cc5d9fc1e278468e1177e..96733d41e919e13f195e1f582eec8955a803c658 100644 (file)
--- a/makefile
+++ b/makefile
@@ -5,12 +5,15 @@ all:
 
 .DELETE_ON_ERROR:
 
-# These exported as they are used by the scripts
-# to check config and compat autoconf
-export CONFIG_CHECK=.$(COMPAT_CONFIG)_md5sum.txt
-
 include ./configure.mk.kernel
-include ./config.mk
+
+export COMPAT_CONFIG=$(CWD)/compat.config
+export COMPAT_AUTOCONF=$(CWD)/include/linux/compat_autoconf.h
+export KLIB_BUILD
+export KVERSION
+export MAKE
+
+-include $(COMPAT_CONFIG)
 
 export CREL=$(shell cat $(CWD)/compat_version)
 export CREL_PRE:=.compat_autoconf_
@@ -22,36 +25,6 @@ CFLAGS += \
        -DCOMPAT_PROJECT="\"Compat-rdma\"" \
        -DCOMPAT_VERSION="\"$(shell cat compat_version)\"" \
 
-ifneq ($(CONFIG_COMPAT_SLES_11_2),)
-CFLAGS += \
-       -DCONFIG_COMPAT_SLES_11_2
-endif
-
-ifneq ($(CONFIG_COMPAT_SLES_11_3),)
-CFLAGS += \
-       -DCONFIG_COMPAT_SLES_11_3
-endif
-
-ifneq ($(CONFIG_COMPAT_RHEL_6_4),)
-CFLAGS += \
-       -DCONFIG_COMPAT_RHEL_6_4
-endif
-
-ifneq ($(CONFIG_COMPAT_XPRTRDMA_NEEDED),)
-CFLAGS += \
-       -DCONFIG_COMPAT_XPRTRDMA_NEEDED
-endif
-
-ifneq ($(NEED_MIN_DUMP_ALLOC_ARG),)
-CFLAGS += \
-       -DNEED_MIN_DUMP_ALLOC_ARG
-endif
-
-ifneq ($(CONFIG_COMPAT_SKB_FRAG_NEEDED),)
-CFLAGS += \
-       -DCONFIG_COMPAT_SKB_FRAG_NEEDED
-endif
-
 DEPMOD  = /sbin/depmod
 INSTALL_MOD_DIR ?= $(shell test -f /etc/redhat-release && echo extra/ofa_kernel || echo updates)
 
@@ -63,6 +36,12 @@ endif
 
 export OPEN_ISCSI_MODULES = iscsi_tcp.ko libiscsi.ko scsi_transport_iscsi.ko
 
+$(COMPAT_AUTOCONF): $(COMPAT_CONFIG)
+       +@$(CWD)/ofed_scripts/gen-compat-autoconf.sh $(COMPAT_CONFIG) > $(COMPAT_AUTOCONF)
+
+$(COMPAT_CONFIG):
+       +@$(CWD)/ofed_scripts/gen-compat-config.sh > $(COMPAT_CONFIG)
+
 configure.mk.kernel:
        @echo Please run ./configure
        @exit 1
@@ -79,7 +58,7 @@ ifneq ($(kconfig_h),)
 KCONFIG_H = -include $(kconfig_h)
 endif
 
-V ?= 1
+V ?= 0
 
 #########################
 #      make kernel     #
@@ -87,14 +66,14 @@ V ?= 1
 #NB: The LINUXINCLUDE value comes from main kernel Makefile
 #    with local directories prepended. This eventually affects
 #    CPPFLAGS in the kernel Makefile
-kernel:
+kernel: $(COMPAT_CONFIG) $(COMPAT_AUTOCONF)
        @echo "Building kernel modules"
        @echo "Kernel version: $(KVERSION)"
        @echo "Modules directory: $(INSTALL_MOD_PATH)/$(MODULES_DIR)"
        @echo "Kernel sources: $(KSRC)"
        env CWD=$(CWD) BACKPORT_INCLUDES=$(BACKPORT_INCLUDES) \
                $(MAKE) -C $(KSRC) SUBDIRS="$(CWD)" \
-               V=$(V) $(WITH_MAKE_PARAMS) \
+               V=$(V) KBUILD_NOCMDDEP=1 $(WITH_MAKE_PARAMS) \
                CONFIG_MEMTRACK=$(CONFIG_MEMTRACK) \
                CONFIG_DEBUG_INFO=$(CONFIG_DEBUG_INFO) \
                CONFIG_INFINIBAND=$(CONFIG_INFINIBAND) \
@@ -138,13 +117,18 @@ kernel:
                CONFIG_INFINIBAND_NES=$(CONFIG_INFINIBAND_NES) \
                CONFIG_INFINIBAND_NES_DEBUG=$(CONFIG_INFINIBAND_NES_DEBUG) \
                CONFIG_MLX4_CORE=$(CONFIG_MLX4_CORE) \
+               CONFIG_MLX5_CORE=$(CONFIG_MLX5_CORE) \
                CONFIG_MLX4_EN=$(CONFIG_MLX4_EN) \
                CONFIG_MLX4_INFINIBAND=$(CONFIG_MLX4_INFINIBAND) \
+               CONFIG_MLX5_INFINIBAND=$(CONFIG_MLX5_INFINIBAND) \
                CONFIG_MLX4_ETHERNET=$(CONFIG_MLX4_ETHERNET) \
                CONFIG_MLX4_DEBUG=$(CONFIG_MLX4_DEBUG) \
+               CONFIG_MLX5_DEBUG=$(CONFIG_MLX5_DEBUG) \
                CONFIG_INFINIBAND_AMSO1100=$(CONFIG_INFINIBAND_AMSO1100) \
                CONFIG_SUNRPC_XPRT_RDMA=$(CONFIG_SUNRPC_XPRT_RDMA) \
                CONFIG_NFSD_RDMA=$(CONFIG_NFSD_RDMA) \
+               CONFIG_INFINIBAND_OCRDMA=$(CONFIG_INFINIBAND_OCRDMA) \
+               CONFIG_INFINIBAND_ISERT=$(CONFIG_INFINIBAND_ISERT) \
                LINUXINCLUDE=' \
                -D__OFED_BUILD__ \
                $(CFLAGS) \
@@ -157,15 +141,22 @@ kernel:
                $(KERNEL_NFS_FS_CFLAGS) \
                $(OPENIB_KERNEL_EXTRA_CFLAGS) \
                -I$(CWD)/include \
+               -I$(CWD)/include/uapi \
                -I$(CWD)/drivers/infiniband/debug \
                -I/usr/local/include/scst \
                -I$(CWD)/drivers/infiniband/ulp/srpt \
                $$(if $$(CONFIG_XEN),-D__XEN_INTERFACE_VERSION__=$$(CONFIG_XEN_INTERFACE_VERSION)) \
                $$(if $$(CONFIG_XEN),-I$$(srctree)/arch/x86/include/mach-xen) \
                -I$$(srctree)/arch/$$(SRCARCH)/include \
-               -Iarch/$$(SRCARCH)/include/generated -Iinclude \
+               -Iarch/$$(SRCARCH)/include/generated \
+               -Iinclude \
+               -I$$(srctree)/arch/$$(SRCARCH)/include/uapi \
+               -Iarch/$$(SRCARCH)/include/generated/uapi \
+               -I$$(srctree)/include/uapi \
+               -Iinclude/generated/uapi \
                $$(if $$(KBUILD_SRC),-Iinclude2 -I$$(srctree)/include) \
                -I$$(srctree)/arch/$$(SRCARCH)/include \
+               -Iarch/$$(SRCARCH)/include/generated \
                ' \
                modules
 
@@ -186,6 +177,10 @@ clean: clean_kernel
 
 clean_kernel:
        $(MAKE) -C $(KSRC) SUBDIRS="$(CWD)" $(WITH_MAKE_PARAMS) clean
+       @/bin/rm -f $(clean-files)
+
+clean-files := Module.symvers modules.order Module.markers compat/modules.order
+clean-files += $(COMPAT_CONFIG) $(COMPAT_AUTOCONF)
 
 help:
        @echo
diff --git a/ofed_scripts/Makefile b/ofed_scripts/Makefile
deleted file mode 100644 (file)
index 9ec90a9..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-EXTRA_CFLAGS += $(OPENIB_KERNEL_EXTRA_CFLAGS) \
-               $(KERNEL_MEMTRACK_CFLAGS) \
-               $(KERNEL_NFS_FS_CFLAGS) \
-               -I$(CWD)/include \
-               -I$(CWD)/drivers/infiniband/ulp/ipoib \
-               -I$(CWD)/drivers/infiniband/debug \
-               -I$(CWD)/drivers/net/cxgb3 \
-               -I$(CWD)/drivers/net/cxgb4 \
-               -I$(CWD)/net/rds \
-               -I$(CWD)/drivers/net/mlx4 \
-               -I$(CWD)/drivers/infiniband/hw/mlx4
-
-obj-$(CONFIG_INFINIBAND)        += drivers/infiniband/
-obj-$(CONFIG_CHELSIO_T3)        += drivers/net/cxgb3/
-obj-$(CONFIG_CHELSIO_T4)        += drivers/net/cxgb4/
-obj-$(CONFIG_MLX4_CORE)         += drivers/net/mlx4/
-obj-$(CONFIG_RDS)               += net/rds/
-obj-$(CONFIG_MEMTRACK)          += drivers/infiniband/debug/
-obj-$(CONFIG_SUNRPC_XPRT_RDMA)  += net/sunrpc/xprtrdma/
index eca216c86f82896c4502624f2892d0e3dc575a62..361af08e8b66d037be09ebf6c072f9a6f96c2866 100644 (file)
@@ -2,10 +2,11 @@ Documentation/infiniband/
 drivers/infiniband/
 drivers/net/ethernet/chelsio/cxgb3/
 drivers/net/ethernet/chelsio/cxgb4/
-drivers/net/ethernet/mellanox/mlx4/
+drivers/net/ethernet/mellanox/
 include/linux/mlx4/
+include/linux/mlx5/
 include/rdma/
+include/uapi/rdma/
 include/scsi/srp.h
 net/rds/
-include/linux/rds.h
 net/sunrpc/xprtrdma
diff --git a/ofed_scripts/configure b/ofed_scripts/configure
deleted file mode 100755 (executable)
index a49b347..0000000
+++ /dev/null
@@ -1,1241 +0,0 @@
-#!/bin/bash
-#
-# Copyright (c) 2006 Mellanox Technologies. All rights reserved.
-#
-# This Software is licensed under one of the following licenses:
-#
-# 1) under the terms of the "Common Public License 1.0" a copy of which is
-#    available from the Open Source Initiative, see
-#    http://www.opensource.org/licenses/cpl.php.
-#
-# 2) under the terms of the "The BSD License" a copy of which is
-#    available from the Open Source Initiative, see
-#    http://www.opensource.org/licenses/bsd-license.php.
-#
-# 3) under the terms of the "GNU General Public License (GPL) Version 2" a
-#    copy of which is available from the Open Source Initiative, see
-#    http://www.opensource.org/licenses/gpl-license.php.
-#
-# Licensee has the right to choose one of the above licenses.
-#
-# Redistributions of source code must retain the above copyright
-# notice and one of the license notices.
-#
-# Redistributions in binary form must reproduce both the above copyright
-# notice, one of the license notices in the documentation
-# and/or other materials provided with the distribution.
-#
-#  $Id: configure 9097 2006-08-24 06:39:09Z vlad $
-#
-
-usage()
-{
-cat << EOF
-\`configure' configures variables for kernel modules compilation
-
-Usage:  `basename $0` [options]
-
-    --prefix=PREFIX  for userspace components []
-    --build_root=BUILD_ROOT  root directory to build RPM packages
-    --kernel-version=VERSION  make for this kernel [$(uname -r)]
-    --modules-dir=DIR  modules directory [/lib/modules/$(uname -r)]
-    --kernel-sources=DIR  make for this kernel [/lib/modules/$(uname -r)/build]
-
-    Kernel modules configuration:
-
-    --with-core-mod    make CONFIG_INFINIBAND=m [no]
-    --without-core-mod   [yes]
-
-    --with-ipoib-mod    make CONFIG_INFINIBAND_IPOIB=m [no]
-    --without-ipoib-mod   [yes]
-
-    --with-ipoib-cm    make CONFIG_INFINIBAND_IPOIB_CM=y [yes]
-    --without-ipoib-cm   [no]
-
-    --with-ipoib_debug-mod    make CONFIG_INFINIBAND_IPOIB_DEBUG=y [yes]
-    --without-ipoib_debug-mod    [no]
-
-    --with-ipoib_debug_data-mod    make CONFIG_INFINIBAND_IPOIB_DEBUG_DATA=y [no]
-    --without-ipoib_debug_data-mod    [yes]
-
-    --with-sdp-mod    make CONFIG_INFINIBAND_SDP=m [no]
-    --without-sdp-mod    [yes]
-
-    --with-sdp_debug-mod    make CONFIG_INFINIBAND_SDP_DEBUG=y [yes]
-    --without-sdp_debug-mod   [no]
-
-    --with-sdp_debug_data-mod    make CONFIG_INFINIBAND_SDP_DEBUG_DATA=y [no]
-    --without-sdp_debug_data-mod    [yes]
-
-    --with-srp-mod    make CONFIG_INFINIBAND_SRP=m [no]
-    --without-srp-mod    [yes]
-
-    --with-srp-target-mod    make CONFIG_INFINIBAND_SRPT=m [no]
-    --without-srp-target-mod    [yes]
-
-    --with-user_mad-mod    make CONFIG_INFINIBAND_USER_MAD=m [no]
-    --without-user_mad-mod    [yes]
-
-    --with-user_access-mod    make CONFIG_INFINIBAND_USER_ACCESS=m [no]
-    --without-user_access-mod    [yes]
-
-    --with-addr_trans-mod    make CONFIG_INFINIBAND_ADDR_TRANS=y [no]
-    --without-addr_trans-mod    [yes]
-
-    --with-mthca-mod    make CONFIG_INFINIBAND_MTHCA=m [no]
-    --without-mthca-mod    [yes]
-
-    --with-mthca_debug-mod    make CONFIG_INFINIBAND_MTHCA_DEBUG=y [yes]
-    --without-mthca_debug-mod    [no]
-
-    --with-mlx4-mod         make CONFIG_MLX4_CORE=y CONFIG_MLX4_INFINIBAND=y [no]
-    --without-mlx4-mod      [yes]
-
-    --with-mlx4_core-mod         make CONFIG_MLX4_CORE=y [no]
-    --without-mlx4_core-mod      [yes]
-
-    --with-mlx4_en-mod         make CONFIG_MLX4_EN=y [no]
-    --without-mlx4_en-mod      [yes]
-
-    --with-mlx4_inf-mod         make CONFIG_MLX4_INFINIBAND=y [no]
-    --without-mlx4_inf-mod      [yes]
-
-    --with-mlx4_debug-mod         make CONFIG_MLX4_DEBUG=y [yes]
-    --without-mlx4_debug-mod      [no]
-
-    --with-ipath_inf-mod    make CONFIG_INFINIBAND_IPATH=m [no]
-    --without-ipath_inf-mod    [yes]
-
-    --with-qib-mod    make CONFIG_INFINIBAND_QIB=m [no]
-    --without-qib-mod    [yes]
-
-    --with-iser-mod    make CONFIG_INFINIBAND_ISER=m [no]
-    --without-iser-mod    [yes]
-
-    --with-ehca-mod    make CONFIG_INFINIBAND_EHCA=m [no]
-    --without-ehca-mod    [yes]
-
-    --with-rds-mod    make CONFIG_RDS=m [no]
-    --without-rds-mod   [no]
-
-    --with-rds_debug-mod    make CONFIG_RDS_DEBUG=y [no]
-    --without-rds_debug-mod    [yes]
-
-    --with-madeye-mod   make CONFIG_INFINIBAND_MADEYE=m [no]
-    --without-madeye-mod    [yes]
-
-    --with-qlgc_vnic-mod    make CONFIG_INFINIBAND_QLGC_VNIC=m [no]
-    --without-qlgc_vnic-mod    [yes]
-
-    --with-qlgc_vnic_stats-mod    make CONFIG_INFINIBAND_QLGC_VNIC_STATS=y [no]
-    --without-qlgc_vnic_stats-mod    [yes]
-
-    --with-cxgb3-mod    make CONFIG_INFINIBAND_CXGB3=m [no]
-    --without-cxgb3-mod    [yes]
-
-    --with-cxgb3_debug-mod    make CONFIG_INFINIBAND_CXGB3_DEBUG=y [no]
-    --without-cxgb3_debug-mod    [yes]
-
-    --with-cxgb4-mod    make CONFIG_INFINIBAND_CXGB4=m [no]
-    --without-cxgb4-mod    [yes]
-
-    --with-nes-mod    make CONFIG_INFINIBAND_NES=m [no]
-    --without-nes-mod    [yes]
-
-    --with-nes_debug-mod    make CONFIG_INFINIBAND_NES_DEBUG=y [no]
-    --without-nes_debug-mod    [yes]
-
-    --with-memtrack  enable momory tracking [no]
-    --without-memtrack disable memory tracking [yes]
-
-    --with-debug-info  make CONFIG_DEBUG_INFO=y [yes]
-    --without-debug-info [no]
-
-    --with-nfsrdma-mod    make CONFIG_SUNRPC_XPRT_RDMA=m [no]
-    --without-nfsrdma-mod    [yes]
-
-    --help - print out options
-
-
-EOF
-
-#   Currently not supported options
-#    --with-sdp-zcopy  make CONFIG_INFINIBAND_SDP_SEND_ZCOPY=y CONFIG_INFINIBAND_SDP_RECV_ZCOPY=y [no]
-#    --without-sdp-zcopy [yes]
-}
-
-# Execute command w/ echo and exit if it fail
-ex()
-{
-        echo "$@"
-        if ! "$@"; then
-                printf "\nFailed executing $@\n\n"
-                exit 1
-        fi
-}
-
-# Compare 2 kernel versions
-check_kerver()
-{
-        local kver=$1
-        local min_kver=$2
-        shift 2
-
-        kver_a=$(echo -n ${kver} | cut -d '.' -f 1)
-        kver_b=$(echo -n ${kver} | cut -d '.' -f 2)
-        kver_c=$(echo -n ${kver} | cut -d '.' -f 3 | cut -d '-' -f 1 | tr -d [:alpha:][:punct:])
-
-        min_kver_a=$(echo -n ${min_kver} | cut -d '.' -f 1)
-        min_kver_b=$(echo -n ${min_kver} | cut -d '.' -f 2)
-        min_kver_c=$(echo -n ${min_kver} | cut -d '.' -f 3 | cut -d '-' -f 1 | tr -d [:alpha:][:punct:])
-
-        if [ ${kver_a} -lt ${min_kver_a} ] ||
-                [[ ${kver_a} -eq ${min_kver_a} && ${kver_b} -lt ${min_kver_b} ]] ||
-                [[ ${kver_a} -eq ${min_kver_a} && ${kver_b} -eq ${min_kver_b} && ${kver_c} -lt ${min_kver_c} ]]; then
-                return 1
-        fi
-
-        return 0
-}
-
-main()
-{
-        ofed_patch_params=
-        # Parsing parameters
-        while [ ! -z "$1" ]
-        do
-                case $1 in
-                        -prefix | --prefix | --prefi | --pref | --pre | --pr | --p | -p)
-                                shift
-                                prefix=$1
-                                PREFIX="--prefix ${prefix}"
-                        ;;
-                        -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=* | -p=*)
-                                prefix=`expr "x$1" : 'x[^=]*=\(.*\)'`
-                                PREFIX="--prefix ${prefix}"
-                        ;;
-                        -kernel-version | --kernel-version | --kern-ver | --ker-ver)
-                                ofed_patch_params="$ofed_patch_params $1"
-                                shift
-                                ofed_patch_params="$ofed_patch_params $1"
-                                KVERSION=$1
-                        ;;
-                        -kernel-version=* | --kernel-version=* | --kern-ver=* | --ker-ver=*)
-                                ofed_patch_params="$ofed_patch_params $1"
-                                KVERSION=`expr "x$1" : 'x[^=]*=\(.*\)'`
-                        ;;
-                        -modules-dir | --modules-dir | --mod-dir)
-                                shift
-                                MODULES_DIR=$1
-                        ;;
-                        -modules-dir=* | --modules-dir=* | --mod-dir=*)
-                                MODULES_DIR=`expr "x$1" : 'x[^=]*=\(.*\)'`
-                        ;;
-                        -kernel-sources | --kernel-sources | --kernel-src | --kern-src | --ker-src)
-                                shift
-                                KSRC=$1
-                        ;;
-                        -kernel-sources=* | --kernel-sources=* | --kernel-src=* | --kern-src=* | --ker-src=*)
-                                KSRC=`expr "x$1" : 'x[^=]*=\(.*\)'`
-                        ;;
-                        -with-quilt | --with-quilt)
-                                ofed_patch_params="$ofed_patch_params $1"
-                                if [ ! -z "$2" ] && [ "`echo -n $2 | cut -c 1`" != '-' ]; then
-                                        shift
-                                        ofed_patch_params="$ofed_patch_params $1"
-                                fi
-                        ;;
-                        -with-quilt=* | --with-quilt=*)
-                                ofed_patch_params="$ofed_patch_params $1"
-                        ;;
-                        --without-quilt)
-                                ofed_patch_params="$ofed_patch_params $1"
-                        ;;
-                        -with-patchdir | --with-patchdir)
-                                ofed_patch_params="$ofed_patch_params $1"
-                                shift
-                                ofed_patch_params="$ofed_patch_params $1"
-                        ;;
-                        -with-patchdir=* | --with-patchdir=*)
-                                ofed_patch_params="$ofed_patch_params $1"
-                        ;;
-                        --without-patch)
-                                ofed_patch_params="$ofed_patch_params $1"
-                        ;;
-                        --with-kernel-fixes)
-                                ofed_patch_params="$ofed_patch_params $1"
-                        ;;
-                        --without-kernel-fixes)
-                                ofed_patch_params="$ofed_patch_params $1"
-                        ;;
-                        --with-hpage-patch)
-                                ofed_patch_params="$ofed_patch_params $1"
-                        ;;
-                        --without-hpage-patch)
-                                ofed_patch_params="$ofed_patch_params $1"
-                        ;;
-                        --with-backport-patches)
-                                ofed_patch_params="$ofed_patch_params $1"
-                        ;;
-                        --without-backport-patches)
-                                ofed_patch_params="$ofed_patch_params $1"
-                        ;;
-                        --with-memtrack)
-                            CONFIG_MEMTRACK="m"
-                        ;;
-                        --without-memtrack)
-                            CONFIG_MEMTRACK=
-                        ;;
-                        --with-debug-info)
-                            CONFIG_DEBUG_INFO="y"
-                        ;;
-                        --without-debug-info)
-                            CONFIG_DEBUG_INFO=
-                        ;;
-                        --with-core-mod)
-                            CONFIG_INFINIBAND="m"
-                        ;;
-                        --without-core-mod)
-                            CONFIG_INFINIBAND=
-                        ;;
-                        --with-ipoib-mod)
-                            CONFIG_INFINIBAND_IPOIB="m"
-                            CONFIG_INFINIBAND_IPOIB_CM="y"
-                            CONFIG_INFINIBAND_IPOIB_DEBUG="y"
-                        ;;
-                        --without-ipoib-mod)
-                            CONFIG_INFINIBAND_IPOIB=
-                        ;;
-                        --with-ipoib-cm)
-                            CONFIG_INFINIBAND_IPOIB_CM="y"
-                        ;;
-                        --without-ipoib-cm)
-                            CONFIG_INFINIBAND_IPOIB_CM=
-                        ;;
-                        --with-ipoib_debug-mod)
-                            CONFIG_INFINIBAND_IPOIB_DEBUG="y"
-                        ;;
-                        --without-ipoib_debug-mod)
-                            CONFIG_INFINIBAND_IPOIB_DEBUG=
-                        ;;
-                        --with-ipoib_debug_data-mod)
-                            CONFIG_INFINIBAND_IPOIB_DEBUG_DATA="y"
-                        ;;
-                        --without-ipoib_debug_data-mod)
-                            CONFIG_INFINIBAND_IPOIB_DEBUG_DATA=
-                        ;;
-                        --with-sdp-mod)
-                            CONFIG_INFINIBAND_SDP="m"
-                            CONFIG_INFINIBAND_SDP_DEBUG="y"
-                        ;;
-                        --without-sdp-mod)
-                            CONFIG_INFINIBAND_SDP=
-                        ;;
-                        --with-sdp-zcopy)
-                            CONFIG_INFINIBAND_SDP_SEND_ZCOPY="y"
-                            CONFIG_INFINIBAND_SDP_RECV_ZCOPY="y"
-                        ;;
-                        --without-sdp-zcopy)
-                            CONFIG_INFINIBAND_SDP_SEND_ZCOPY=
-                            CONFIG_INFINIBAND_SDP_RECV_ZCOPY=
-                        ;;
-                        --with-sdp_debug-mod)
-                            CONFIG_INFINIBAND_SDP_DEBUG="y"
-                        ;;
-                        --without-sdp_debug-mod)
-                            CONFIG_INFINIBAND_SDP_DEBUG=
-                        ;;
-                        --with-sdp_debug_data-mod)
-                            CONFIG_INFINIBAND_SDP_DEBUG_DATA="y"
-                        ;;
-                        --without-sdp_debug_data-mod)
-                            CONFIG_INFINIBAND_SDP_DEBUG_DATA=
-                        ;;
-                        --with-srp-mod)
-                            CONFIG_INFINIBAND_SRP="m"
-                        ;;
-                        --without-srp-mod)
-                            CONFIG_INFINIBAND_SRP=
-                        ;;
-                        --with-srp-target-mod)
-                            CONFIG_INFINIBAND_SRPT="m"
-                        ;;
-                        --without-srp-target-mod)
-                            CONFIG_INFINIBAND_SRPT=
-                        ;;
-                        --with-user_mad-mod)
-                            CONFIG_INFINIBAND_USER_MAD="m"
-                        ;;
-                        --without-user_mad-mod)
-                            CONFIG_INFINIBAND_USER_MAD=
-                        ;;
-                        --with-user_access-mod)
-                            CONFIG_INFINIBAND_USER_ACCESS="m"
-                            CONFIG_INFINIBAND_USER_MEM=y
-                        ;;
-                        --without-user_access-mod)
-                            CONFIG_INFINIBAND_USER_ACCESS=
-                            CONFIG_INFINIBAND_USER_MEM=
-                        ;;
-                        --with-addr_trans-mod)
-                            CONFIG_INFINIBAND_ADDR_TRANS=y
-                        ;;
-                        --without-addr_trans-mod)
-                            CONFIG_INFINIBAND_ADDR_TRANS=
-                        ;;
-                        --with-mthca-mod)
-                            CONFIG_INFINIBAND_MTHCA="m"
-                            CONFIG_INFINIBAND_MTHCA_DEBUG="y"
-                        ;;
-                        --without-mthca-mod)
-                            CONFIG_INFINIBAND_MTHCA=
-                        ;;
-                        --with-mthca_debug-mod)
-                            CONFIG_INFINIBAND_MTHCA_DEBUG="y"
-                        ;;
-                        --without-mthca_debug-mod)
-                            CONFIG_INFINIBAND_MTHCA_DEBUG=
-                        ;;
-                        --with-mlx4-mod)
-                            CONFIG_MLX4_CORE="m"
-                            CONFIG_MLX4_INFINIBAND="m"
-                            CONFIG_MLX4_DEBUG="y"
-                        ;;
-                        --with-mlx4_core-mod)
-                            CONFIG_MLX4_CORE="m"
-                        ;;
-                        --without-mlx4_core-mod)
-                            CONFIG_MLX4_CORE=
-                        ;;
-                       -without-mlx4-mod)
-                            CONFIG_MLX4_CORE=
-                            CONFIG_MLX4_INFINIBAND=
-                            CONFIG_MLX4_DEBUG=
-                        ;;
-                        --with-mlx4_en-mod)
-                           CONFIG_MLX4_CORE="m"
-                            CONFIG_MLX4_EN="m"
-                        ;;
-                        --without-mlx4_en-mod)
-                            CONFIG_MLX4_EN=
-                        ;;
-                        --with-mlx4_inf-mod)
-                            CONFIG_MLX4_CORE="m"
-                            CONFIG_MLX4_INFINIBAND="m"
-                        ;;
-                        --without-mlx4_inf-mod)
-                            CONFIG_MLX4_INFINIBAND=
-                        ;;
-                        --with-mlx4_debug-mod)
-                            CONFIG_MLX4_DEBUG="y"
-                        ;;
-                        --without-mlx4_debug-mod)
-                            CONFIG_MLX4_DEBUG=
-                        ;;
-                        --with-ipath_inf-mod)
-                            CONFIG_INFINIBAND_IPATH="m"
-                        ;;
-                        --without-ipath_inf-mod)
-                            CONFIG_INFINIBAND_IPATH=
-                        ;;
-                        --with-qib-mod)
-                            CONFIG_INFINIBAND_QIB="m"
-                        ;;
-                        --without-qib-mod)
-                            CONFIG_INFINIBAND_QIB=
-                        ;;
-                        --with-iser-mod)
-                            CONFIG_INFINIBAND_ISER="m"
-                        ;;
-                        --with-iscsi-mod)
-                            CONFIG_SCSI_ISCSI_ATTRS="m"
-                            CONFIG_ISCSI_TCP="m"
-                        ;;
-                        --without-iser-mod)
-                            CONFIG_INFINIBAND_ISER=
-                            CONFIG_SCSI_ISCSI_ATTRS=
-                            CONFIG_ISCSI_TCP=
-                        ;;
-                        --with-ehca-mod)
-                            CONFIG_INFINIBAND_EHCA="m"
-                            CONFIG_INFINIBAND_EHCA_SCALING="y"
-                        ;;
-                        --without-ehca-mod)
-                            CONFIG_INFINIBAND_EHCA=
-                            CONFIG_INFINIBAND_EHCA_SCALING=
-                        ;;
-                        --with-rds-mod)
-                            CONFIG_RDS="m"
-                            CONFIG_RDS_RDMA="m"
-                            CONFIG_RDS_TCP="m"
-                        ;;
-                        --without-rds-mod)
-                            CONFIG_RDS=
-                            CONFIG_RDS_RDMA=
-                            CONFIG_RDS_TCP=
-                        ;;
-                        --with-rds_debug-mod)
-                            CONFIG_RDS_DEBUG="y"
-                        ;;
-                        --without-rds_debug-mod)
-                            CONFIG_RDS_DEBUG=
-                        ;;
-                        --with-madeye-mod)
-                            CONFIG_INFINIBAND_MADEYE=m
-                        ;;
-                        --without-madeye-mod)
-                            CONFIG_INFINIBAND_MADEYE=
-                        ;;
-                        --with-qlgc_vnic-mod)
-                            CONFIG_INFINIBAND_QLGC_VNIC="m"
-                        ;;
-                        --without-qlgc_vnic-mod)
-                            CONFIG_INFINIBAND_QLGC_VNIC=
-                        ;;
-                        --with-qlgc_vnic_stats-mod)
-                            CONFIG_INFINIBAND_QLGC_VNIC_STATS="y"
-                        ;;
-                        --without-qlgc_vnic_stats-mod)
-                            CONFIG_INFINIBAND_QLGC_VNIC_STATS=
-                        ;;
-                        --with-cxgb3-mod)
-                            CONFIG_INFINIBAND_CXGB3="m"
-                            CONFIG_CHELSIO_T3="m"
-                        ;;
-                        --without-cxgb3-mod)
-                            CONFIG_INFINIBAND_CXGB3=
-                            CONFIG_CHELSIO_T3=
-                        ;;
-                        --with-cxgb3_debug-mod)
-                            CONFIG_INFINIBAND_CXGB3_DEBUG="y"
-                        ;;
-                        --without-cxgb3_debug-mod)
-                            CONFIG_INFINIBAND_CXGB3_DEBUG=
-                        ;;
-                        --with-cxgb4-mod)
-                            CONFIG_INFINIBAND_CXGB4="m"
-                            CONFIG_CHELSIO_T4="m"
-                        ;;
-                        --without-cxgb4-mod)
-                            CONFIG_INFINIBAND_CXGB4=
-                            CONFIG_CHELSIO_T4=
-                        ;;
-                        --with-nes-mod)
-                            CONFIG_INFINIBAND_NES="m"
-                        ;;
-                        --without-nes-mod)
-                            CONFIG_INFINIBAND_NES=
-                        ;;
-                        --with-nes_debug-mod)
-                            CONFIG_INFINIBAND_NES_DEBUG="y"
-                        ;;
-                        --without-nes_debug-mod)
-                            CONFIG_INFINIBAND_NES_DEBUG=
-                        ;;
-                        --with-nfsrdma-mod)
-                            CONFIG_SUNRPC_XPRT_RDMA="m"
-                            CONFIG_NFSD_RDMA="y"
-                        ;;
-                        --without-nfsrdma-mod)
-                            CONFIG_SUNRPC_XPRT_RDMA=
-                            CONFIG_NFSD_RDMA=
-                        ;;
-                        --with-modprobe|--without-modprobe)
-                        ;;
-                        -h | --help)
-                                usage
-                                exit 0
-                        ;;
-                        --with*)
-                                echo
-                                echo "Unsupported or unused parameter: $1"
-                                echo
-                        ;;
-                        *)
-                                echo
-                                echo "Unsupported parameter $1"
-                                echo
-                        ;;
-                esac
-                shift
-
-        done
-
-#Set default values
-KVERSION=${KVERSION:-$(uname -r)}
-MIN_KVERSION="2.6.5"
-MODULES_DIR=${MODULES_DIR:-/lib/modules/${KVERSION}/updates}
-KSRC=${KSRC:-/lib/modules/${KVERSION}/build}
-
-ARCH=${ARCH:-$(uname -m)}
-
-# Additional parameters to be passed to configure command
-CWD=$(pwd)
-CONFIG="configure.mk.kernel"
-
-mkdir -p ${CWD}/include/linux
-AUTOCONF_H="${CWD}/include/linux/autoconf.h"
-
-CONFIG_MEMTRACK=${CONFIG_MEMTRACK:-''}
-CONFIG_DEBUG_INFO=${CONFIG_DEBUG_INFO:-'y'}
-CONFIG_INFINIBAND=${CONFIG_INFINIBAND:-''}
-CONFIG_INFINIBAND_IPOIB=${CONFIG_INFINIBAND_IPOIB:-''}
-CONFIG_INFINIBAND_IPOIB_CM=${CONFIG_INFINIBAND_IPOIB_CM:-''}
-CONFIG_INFINIBAND_SDP=${CONFIG_INFINIBAND_SDP:-''}
-CONFIG_INFINIBAND_SRP=${CONFIG_INFINIBAND_SRP:-''}
-CONFIG_INFINIBAND_SRPT=${CONFIG_INFINIBAND_SRPT:-''}
-
-CONFIG_INFINIBAND_USER_MAD=${CONFIG_INFINIBAND_USER_MAD:-''}
-CONFIG_INFINIBAND_USER_ACCESS=${CONFIG_INFINIBAND_USER_ACCESS:-''}
-CONFIG_INFINIBAND_ADDR_TRANS=${CONFIG_INFINIBAND_ADDR_TRANS:-''}
-CONFIG_INFINIBAND_USER_MEM=${CONFIG_INFINIBAND_USER_MEM:-''}
-CONFIG_INFINIBAND_MTHCA=${CONFIG_INFINIBAND_MTHCA:-''}
-
-CONFIG_MLX4_CORE=${CONFIG_MLX4_CORE:-''}
-CONFIG_MLX4_EN=${CONFIG_MLX4_EN:-''}
-CONFIG_MLX4_INFINIBAND=${CONFIG_MLX4_INFINIBAND:-''}
-CONFIG_MLX4_DEBUG=${CONFIG_MLX4_DEBUG:-''}
-
-CONFIG_INFINIBAND_IPOIB_DEBUG=${CONFIG_INFINIBAND_IPOIB_DEBUG:-''}
-CONFIG_INFINIBAND_ISER=${CONFIG_INFINIBAND_ISER:-''}
-CONFIG_SCSI_ISCSI_ATTRS=${CONFIG_SCSI_ISCSI_ATTRS:-''}
-CONFIG_ISCSI_TCP=${CONFIG_ISCSI_TCP:-''}
-CONFIG_INFINIBAND_EHCA=${CONFIG_INFINIBAND_EHCA:-''}
-CONFIG_INFINIBAND_EHCA_SCALING=${CONFIG_INFINIBAND_EHCA_SCALING:-''}
-CONFIG_RDS=${CONFIG_RDS:-''}
-CONFIG_RDS_RDMA=${CONFIG_RDS_RDMA:-''}
-CONFIG_RDS_TCP=${CONFIG_RDS_TCP:-''}
-CONFIG_RDS_DEBUG=${CONFIG_RDS_DEBUG:-''}
-CONFIG_INFINIBAND_MADEYE=${CONFIG_INFINIBAND_MADEYE:-''}
-CONFIG_INFINIBAND_QLGC_VNIC=${CONFIG_INFINIBAND_QLGC_VNIC:-''}
-CONFIG_INFINIBAND_CXGB3=${CONFIG_INFINIBAND_CXGB3:-''}
-CONFIG_CHELSIO_T3=${CONFIG_CHELSIO_T3:-''}
-CONFIG_INFINIBAND_CXGB4=${CONFIG_INFINIBAND_CXGB4:-''}
-CONFIG_CHELSIO_T4=${CONFIG_CHELSIO_T4:-''}
-CONFIG_INFINIBAND_NES=${CONFIG_INFINIBAND_NES:-''}
-
-CONFIG_SUNRPC_XPRT_RDMA=${CONFIG_SUNRPC_XPRT_RDMA:-''} 
-CONFIG_SUNRPC=${CONFIG_SUNRPC:-''} 
-CONFIG_SUNRPC_GSS=${CONFIG_SUNRPC_GSS:-''} 
-CONFIG_RPCSEC_GSS_KRB5=${CONFIG_RPCSEC_GSS_KRB5:-''} 
-CONFIG_RPCSEC_GSS_SPKM3=${CONFIG_RPCSEC_GSS_SPKM3:-''} 
-
-CONFIG_NFS_FS=${CONFIG_NFS_FS:-''}
-CONFIG_NFS_V3=${CONFIG_NFS_V3:-''}
-CONFIG_NFS_V3_ACL=${CONFIG_NFS_V3_ACL:-''}
-CONFIG_NFS_V4=${CONFIG_NFS_V4:-''}
-CONFIG_NFS_ACL_SUPPORT=${CONFIG_NFS_ACL_SUPPORT:-''}
-CONFIG_NFS_DIRECTIO=${CONFIG_NFS_DIRECTIO:-''}
-
-CONFIG_EXPORTFS=${CONFIG_EXPORTFS:-''}
-
-CONFIG_LOCKD=${CONFIG_LOCKD:-''}
-CONFIG_LOCKD_V4=${CONFIG_LOCKD_V4:-''}
-
-CONFIG_NFSD=${CONFIG_NFSD:-''}
-CONFIG_NFSD_V2_ACL=${CONFIG_NFSD_V2_ACL:-''}
-CONFIG_NFSD_V3=${CONFIG_NFSD_V3:-''}
-CONFIG_NFSD_V3_ACL=${CONFIG_NFSD_V3_ACL:-''}
-CONFIG_NFSD_V4=${CONFIG_NFSD_V4:-''}
-CONFIG_NFSD_RDMA=${CONFIG_NFSD_RDMA:-''}
-
-CONFIG_INFINIBAND_IPOIB_DEBUG_DATA=${CONFIG_INFINIBAND_IPOIB_DEBUG_DATA:-''}
-CONFIG_INFINIBAND_SDP_SEND_ZCOPY=${CONFIG_INFINIBAND_SDP_SEND_ZCOPY:-''}
-CONFIG_INFINIBAND_SDP_RECV_ZCOPY=${CONFIG_INFINIBAND_SDP_RECV_ZCOPY:-''}
-CONFIG_INFINIBAND_SDP_DEBUG=${CONFIG_INFINIBAND_SDP_DEBUG:-''}
-CONFIG_INFINIBAND_SDP_DEBUG_DATA=${CONFIG_INFINIBAND_SDP_DEBUG_DATA:-''}
-CONFIG_INFINIBAND_IPATH=${CONFIG_INFINIBAND_IPATH:-''}
-CONFIG_INFINIBAND_QIB=${CONFIG_INFINIBAND_QIB:-''}
-CONFIG_INFINIBAND_MTHCA_DEBUG=${CONFIG_INFINIBAND_MTHCA_DEBUG:-''}
-CONFIG_INFINIBAND_QLGC_VNIC_STATS=${CONFIG_INFINIBAND_QLGC_VNIC_STATS:-''}
-CONFIG_INFINIBAND_CXGB3_DEBUG=${CONFIG_INFINIBAND_CXGB3_DEBUG:-''}
-CONFIG_INFINIBAND_NES_DEBUG=${CONFIG_INFINIBAND_NES_DEBUG:-''}
-CONFIG_INFINIBAND_AMSO1100=${CONFIG_INFINIBAND_AMSO1100:-''}
-
-        # Check for minimal supported kernel version
-        if ! check_kerver ${KVERSION} ${MIN_KVERSION}; then
-                echo "Kernel version ${KVERSION} is less then supported kernel ${MIN_KVERSION}. Exiting..."
-                exit 1
-        fi
-
-       if [ ! -e config.mk ]; then
-               echo "config.mk does not exist. running ofed_patch.sh"
-               ex ${CWD}/ofed_scripts/ofed_patch.sh ${ofed_patch_params}
-       fi
-
-        # Create configure.mk
-        /bin/rm -f ${CWD}/${CONFIG}
-        cat >> ${CWD}/${CONFIG} << EOFCONFIG
-# Current working directory
-CWD=${CWD}
-
-# Kernel level
-KVERSION=${KVERSION}
-ARCH=${ARCH}
-MODULES_DIR=${MODULES_DIR}
-KSRC=${KSRC}
-
-AUTOCONF_H=${AUTOCONF_H}
-
-WITH_MAKE_PARAMS=${WITH_MAKE_PARAMS}
-
-CONFIG_MEMTRACK=${CONFIG_MEMTRACK}
-CONFIG_DEBUG_INFO=${CONFIG_DEBUG_INFO}
-CONFIG_INFINIBAND=${CONFIG_INFINIBAND}
-CONFIG_INFINIBAND_IPOIB=${CONFIG_INFINIBAND_IPOIB}
-CONFIG_INFINIBAND_IPOIB_CM=${CONFIG_INFINIBAND_IPOIB_CM}
-CONFIG_INFINIBAND_SDP=${CONFIG_INFINIBAND_SDP}
-CONFIG_INFINIBAND_SRP=${CONFIG_INFINIBAND_SRP}
-CONFIG_INFINIBAND_SRPT=${CONFIG_INFINIBAND_SRPT}
-
-CONFIG_INFINIBAND_USER_MAD=${CONFIG_INFINIBAND_USER_MAD}
-CONFIG_INFINIBAND_USER_ACCESS=${CONFIG_INFINIBAND_USER_ACCESS}
-CONFIG_INFINIBAND_ADDR_TRANS=${CONFIG_INFINIBAND_ADDR_TRANS}
-CONFIG_INFINIBAND_USER_MEM=${CONFIG_INFINIBAND_USER_MEM}
-CONFIG_INFINIBAND_MTHCA=${CONFIG_INFINIBAND_MTHCA}
-
-CONFIG_MLX4_CORE=${CONFIG_MLX4_CORE}
-CONFIG_MLX4_EN=${CONFIG_MLX4_EN}
-CONFIG_MLX4_INFINIBAND=${CONFIG_MLX4_INFINIBAND}
-CONFIG_MLX4_DEBUG=${CONFIG_MLX4_DEBUG}
-
-CONFIG_INFINIBAND_IPOIB_DEBUG=${CONFIG_INFINIBAND_IPOIB_DEBUG}
-CONFIG_INFINIBAND_ISER=${CONFIG_INFINIBAND_ISER}
-CONFIG_SCSI_ISCSI_ATTRS=${CONFIG_SCSI_ISCSI_ATTRS}
-CONFIG_ISCSI_TCP=${CONFIG_ISCSI_TCP}
-CONFIG_INFINIBAND_EHCA=${CONFIG_INFINIBAND_EHCA}
-CONFIG_INFINIBAND_EHCA_SCALING=${CONFIG_INFINIBAND_EHCA_SCALING}
-CONFIG_RDS=${CONFIG_RDS}
-CONFIG_RDS_RDMA=${CONFIG_RDS_RDMA}
-CONFIG_RDS_TCP=${CONFIG_RDS_TCP}
-CONFIG_RDS_DEBUG=${CONFIG_RDS_DEBUG}
-CONFIG_INFINIBAND_MADEYE=${CONFIG_INFINIBAND_MADEYE}
-CONFIG_INFINIBAND_QLGC_VNIC=${CONFIG_INFINIBAND_QLGC_VNIC}
-CONFIG_INFINIBAND_CXGB3=${CONFIG_INFINIBAND_CXGB3}
-CONFIG_CHELSIO_T3=${CONFIG_CHELSIO_T3}
-CONFIG_INFINIBAND_CXGB4=${CONFIG_INFINIBAND_CXGB4}
-CONFIG_CHELSIO_T4=${CONFIG_CHELSIO_T4}
-CONFIG_INFINIBAND_NES=${CONFIG_INFINIBAND_NES}
-
-CONFIG_SUNRPC_XPRT_RDMA=${CONFIG_SUNRPC_XPRT_RDMA}
-CONFIG_SUNRPC=${CONFIG_SUNRPC}
-CONFIG_SUNRPC_GSS=${CONFIG_SUNRPC_GSS}
-CONFIG_RPCSEC_GSS_KRB5=${CONFIG_RPCSEC_GSS_KRB5}
-CONFIG_RPCSEC_GSS_SPKM3=${CONFIG_RPCSEC_GSS_SPKM3}
-
-CONFIG_NFS_FS=${CONFIG_NFS_FS}
-CONFIG_NFS_V3=${CONFIG_NFS_V3}
-CONFIG_NFS_V3_ACL=${CONFIG_NFS_V3_ACL}
-CONFIG_NFS_V4=${CONFIG_NFS_V4}
-CONFIG_NFS_ACL_SUPPORT=${CONFIG_NFS_ACL_SUPPORT}
-CONFIG_NFS_DIRECTIO=${CONFIG_NFS_DIRECTIO}
-CONFIG_EXPORTFS=${CONFIG_EXPORTFS}
-CONFIG_LOCKD=${CONFIG_LOCKD}
-CONFIG_LOCKD_V4=${CONFIG_LOCKD_V4}
-CONFIG_NFSD=${CONFIG_NFSD}
-CONFIG_NFSD_V2_ACL=${CONFIG_NFSD_V2_ACL}
-CONFIG_NFSD_V3=${CONFIG_NFSD_V3}
-CONFIG_NFSD_V3_ACL=${CONFIG_NFSD_V3_ACL}
-CONFIG_NFSD_V4=${CONFIG_NFSD_V4}
-CONFIG_NFSD_RDMA=${CONFIG_NFSD_RDMA}
-
-CONFIG_INFINIBAND_IPOIB_DEBUG_DATA=${CONFIG_INFINIBAND_IPOIB_DEBUG_DATA}
-CONFIG_INFINIBAND_SDP_SEND_ZCOPY=${CONFIG_INFINIBAND_SDP_SEND_ZCOPY}
-CONFIG_INFINIBAND_SDP_RECV_ZCOPY=${CONFIG_INFINIBAND_SDP_RECV_ZCOPY}
-CONFIG_INFINIBAND_SDP_DEBUG=${CONFIG_INFINIBAND_SDP_DEBUG}
-CONFIG_INFINIBAND_SDP_DEBUG_DATA=${CONFIG_INFINIBAND_SDP_DEBUG_DATA}
-CONFIG_INFINIBAND_IPATH=${CONFIG_INFINIBAND_IPATH}
-CONFIG_INFINIBAND_QIB=${CONFIG_INFINIBAND_QIB}
-CONFIG_INFINIBAND_MTHCA_DEBUG=${CONFIG_INFINIBAND_MTHCA_DEBUG}
-CONFIG_INFINIBAND_QLGC_VNIC_STATS=${CONFIG_INFINIBAND_QLGC_VNIC_STATS}
-CONFIG_INFINIBAND_CXGB3_DEBUG=${CONFIG_INFINIBAND_CXGB3_DEBUG}
-CONFIG_INFINIBAND_NES_DEBUG=${CONFIG_INFINIBAND_NES_DEBUG}
-CONFIG_INFINIBAND_AMSO1100=${CONFIG_INFINIBAND_AMSO1100}
-
-EOFCONFIG
-        echo "Created ${CONFIG}:"
-        cat ${CWD}/${CONFIG}
-
-# Create autoconf.h
-if [ "X${CONFIG_MEMTRACK}" == "Xm" ]; then
-        DEFINE_MEMTRACK="#undef CONFIG_MEMTRACK\n#define CONFIG_MEMTRACK 1"
-else
-        DEFINE_MEMTRACK="#undef CONFIG_MEMTRACK"
-fi
-if [ "X${CONFIG_DEBUG_INFO}" == "Xy" ]; then
-        DEFINE_DEBUG_INFO="#undef CONFIG_DEBUG_INFO\n#define CONFIG_DEBUG_INFO 1"
-else
-        DEFINE_DEBUG_INFO="#undef CONFIG_DEBUG_INFO"
-fi
-if [ "X${CONFIG_INFINIBAND}" == "Xm" ]; then
-        DEFINE_INFINIBAND="#undef CONFIG_INFINIBAND\n#define CONFIG_INFINIBAND 1"
-else
-        DEFINE_INFINIBAND="#undef CONFIG_INFINIBAND"
-fi
-if [ "X${CONFIG_INFINIBAND_IPOIB}" == "Xm" ]; then
-        DEFINE_INFINIBAND_IPOIB="#undef CONFIG_INFINIBAND_IPOIB\n#define CONFIG_INFINIBAND_IPOIB 1"
-else
-        DEFINE_INFINIBAND_IPOIB="#undef CONFIG_INFINIBAND_IPOIB"
-fi
-if [ "X${CONFIG_INFINIBAND_IPOIB_CM}" == "Xy" ]; then
-        DEFINE_INFINIBAND_IPOIB_CM="#undef CONFIG_INFINIBAND_IPOIB_CM\n#define CONFIG_INFINIBAND_IPOIB_CM 1"
-else
-        DEFINE_INFINIBAND_IPOIB_CM="#undef CONFIG_INFINIBAND_IPOIB_CM"
-fi
-if [ "X${CONFIG_INFINIBAND_SDP}" == "Xm" ]; then
-        DEFINE_INFINIBAND_SDP="#undef CONFIG_INFINIBAND_SDP\n#define CONFIG_INFINIBAND_SDP 1"
-else
-        DEFINE_INFINIBAND_SDP="#undef CONFIG_INFINIBAND_SDP"
-fi
-if [ "X${CONFIG_INFINIBAND_SRP}" == "Xm" ]; then
-        DEFINE_INFINIBAND_SRP="#undef CONFIG_INFINIBAND_SRP\n#define CONFIG_INFINIBAND_SRP 1"
-else
-        DEFINE_INFINIBAND_SRP="#undef CONFIG_INFINIBAND_SRP"
-fi
-if [ "X${CONFIG_INFINIBAND_SRPT}" == "Xm" ]; then
-        DEFINE_INFINIBAND_SRPT="#undef CONFIG_INFINIBAND_SRPT\n#define CONFIG_INFINIBAND_SRPT 1"
-else
-        DEFINE_INFINIBAND_SRPT="#undef CONFIG_INFINIBAND_SRP"
-fi
-if [ "X${CONFIG_INFINIBAND_USER_MAD}" == "Xm" ]; then
-        DEFINE_INFINIBAND_USER_MAD="#undef CONFIG_INFINIBAND_USER_MAD\n#define CONFIG_INFINIBAND_USER_MAD 1"
-else
-        DEFINE_INFINIBAND_USER_MAD="#undef CONFIG_INFINIBAND_USER_MAD"
-fi
-if [ "X${CONFIG_INFINIBAND_USER_ACCESS}" == "Xm" ]; then
-        DEFINE_INFINIBAND_USER_ACCESS="#undef CONFIG_INFINIBAND_USER_ACCESS\n#define CONFIG_INFINIBAND_USER_ACCESS 1"
-else
-        DEFINE_INFINIBAND_USER_ACCESS="#undef CONFIG_INFINIBAND_USER_ACCESS"
-fi
-if [ "X${CONFIG_INFINIBAND_ADDR_TRANS}" == "Xy" ]; then
-        DEFINE_INFINIBAND_ADDR_TRANS="#undef CONFIG_INFINIBAND_ADDR_TRANS\n#define CONFIG_INFINIBAND_ADDR_TRANS 1"
-else
-        DEFINE_INFINIBAND_ADDR_TRANS="#undef CONFIG_INFINIBAND_ADDR_TRANS"
-fi
-if [ "X${CONFIG_INFINIBAND_USER_MEM}" == "Xy" ]; then
-        DEFINE_INFINIBAND_USER_MEM="#undef CONFIG_INFINIBAND_USER_MEM\n#define CONFIG_INFINIBAND_USER_MEM 1"
-else
-        DEFINE_INFINIBAND_USER_MEM="#undef CONFIG_INFINIBAND_USER_MEM"
-fi
-if [ "X${CONFIG_INFINIBAND_MTHCA}" == "Xm" ]; then
-        DEFINE_INFINIBAND_MTHCA="#undef CONFIG_INFINIBAND_MTHCA\n#define CONFIG_INFINIBAND_MTHCA 1"
-else
-        DEFINE_INFINIBAND_MTHCA="#undef CONFIG_INFINIBAND_MTHCA"
-fi
-if [ "X${CONFIG_MLX4_CORE}" == "Xm" ]; then
-        DEFINE_MLX4_CORE="#undef CONFIG_MLX4_CORE\n#define CONFIG_MLX4_CORE 1"
-else
-        DEFINE_MLX4_CORE="#undef CONFIG_MLX4_CORE"
-fi
-if [ "X${CONFIG_MLX4_EN}" == "Xm" ]; then
-        DEFINE_MLX4_EN="#undef CONFIG_MLX4_EN\n#define CONFIG_MLX4_EN 1"
-else
-        DEFINE_MLX4_EN="#undef CONFIG_MLX4_EN"
-fi
-if [ "X${CONFIG_MLX4_INFINIBAND}" == "Xm" ]; then
-        DEFINE_MLX4_INFINIBAND="#undef CONFIG_MLX4_INFINIBAND\n#define CONFIG_MLX4_INFINIBAND 1"
-else
-        DEFINE_MLX4_INFINIBAND="#undef CONFIG_MLX4_INFINIBAND"
-fi
-if [ "X${CONFIG_MLX4_DEBUG}" == "Xy" ]; then
-        DEFINE_MLX4_DEBUG="#undef CONFIG_MLX4_DEBUG\n#define CONFIG_MLX4_DEBUG 1"
-else
-        DEFINE_MLX4_DEBUG="#undef CONFIG_MLX4_DEBUG"
-fi
-if [ "X${CONFIG_INFINIBAND_IPOIB_DEBUG}" == "Xy" ]; then
-        DEFINE_INFINIBAND_IPOIB_DEBUG="#undef CONFIG_INFINIBAND_IPOIB_DEBUG\n#define CONFIG_INFINIBAND_IPOIB_DEBUG 1"
-else
-        DEFINE_INFINIBAND_IPOIB_DEBUG="#undef CONFIG_INFINIBAND_IPOIB_DEBUG"
-fi
-if [ "X${CONFIG_INFINIBAND_ISER}" == "Xm" ]; then
-        DEFINE_INFINIBAND_ISER="#undef CONFIG_INFINIBAND_ISER\n#define CONFIG_INFINIBAND_ISER 1"
-        DEFINE_SCSI_ISCSI_ATTRS="#undef CONFIG_SCSI_ISCSI_ATTRS\n#define CONFIG_SCSI_ISCSI_ATTRS 1"
-        DEFINE_ISCSI_TCP="#undef CONFIG_ISCSI_TCP\n#define CONFIG_ISCSI_TCP 1"
-else
-        DEFINE_INFINIBAND_ISER="#undef CONFIG_INFINIBAND_ISER"
-        DEFINE_SCSI_ISCSI_ATTRS="#undef CONFIG_SCSI_ISCSI_ATTRS"
-        DEFINE_ISCSI_TCP="#undef CONFIG_ISCSI_TCP"
-fi
-if [ "X${CONFIG_INFINIBAND_EHCA}" == "Xm" ]; then
-        DEFINE_INFINIBAND_EHCA="#undef CONFIG_INFINIBAND_EHCA\n#define CONFIG_INFINIBAND_EHCA 1"
-else
-        DEFINE_INFINIBAND_EHCA="#undef CONFIG_INFINIBAND_EHCA"
-fi
-if [ "X${CONFIG_INFINIBAND_EHCA_SCALING}" == "Xy" ]; then
-        DEFINE_INFINIBAND_EHCA_SCALING="#undef CONFIG_INFINIBAND_EHCA_SCALING\n#define CONFIG_INFINIBAND_EHCA_SCALING 1"
-else
-        DEFINE_INFINIBAND_EHCA_SCALING="#undef CONFIG_INFINIBAND_EHCA_SCALING"
-fi
-if [ "X${CONFIG_RDS}" == "Xm" ]; then
-        DEFINE_RDS="#undef CONFIG_RDS\n#define CONFIG_RDS 1"
-        DEFINE_RDS_RDMA="#undef CONFIG_RDS_RDMA\n#define CONFIG_RDS_RDMA 1"
-        DEFINE_RDS_TCP="#undef CONFIG_RDS_TCP\n#define CONFIG_RDS_TCP 1"
-else
-        DEFINE_RDS="#undef CONFIG_RDS"
-        DEFINE_RDS_RDMA="#undef CONFIG_RDS_RDMA"
-        DEFINE_RDS_TCP="#undef CONFIG_RDS_TCP"
-fi
-if [ "X${CONFIG_RDS_DEBUG}" == "Xy" ]; then
-        DEFINE_RDS_DEBUG="#undef CONFIG_RDS_DEBUG\n#define CONFIG_RDS_DEBUG 1"
-else
-        DEFINE_RDS_DEBUG="#undef CONFIG_RDS_DEBUG"
-fi
-if [ "X${CONFIG_INFINIBAND_MADEYE}" == "Xm" ]; then
-        DEFINE_INFINIBAND_MADEYE="#undef CONFIG_INFINIBAND_MADEYE\n#define CONFIG_INFINIBAND_MADEYE 1"
-else
-        DEFINE_INFINIBAND_MADEYE="#undef CONFIG_INFINIBAND_MADEYE"
-fi
-if [ "X${CONFIG_INFINIBAND_IPOIB_DEBUG_DATA}" == "Xy" ]; then
-        DEFINE_INFINIBAND_IPOIB_DEBUG_DATA="#undef CONFIG_INFINIBAND_IPOIB_DEBUG_DATA\n#define CONFIG_INFINIBAND_IPOIB_DEBUG_DATA 1"
-else
-        DEFINE_INFINIBAND_IPOIB_DEBUG_DATA="#undef CONFIG_INFINIBAND_IPOIB_DEBUG_DATA"
-fi
-if [ "X${CONFIG_INFINIBAND_SDP_SEND_ZCOPY}" == "Xy" ]; then
-        DEFINE_INFINIBAND_SDP_SEND_ZCOPY="#undef CONFIG_INFINIBAND_SDP_SEND_ZCOPY\n#define CONFIG_INFINIBAND_SDP_SEND_ZCOPY 1"
-else
-        DEFINE_INFINIBAND_SDP_SEND_ZCOPY="#undef CONFIG_INFINIBAND_SDP_SEND_ZCOPY"
-fi
-if [ "X${CONFIG_INFINIBAND_SDP_RECV_ZCOPY}" == "Xy" ]; then
-        DEFINE_INFINIBAND_SDP_RECV_ZCOPY="#undef CONFIG_INFINIBAND_SDP_RECV_ZCOPY\n#define CONFIG_INFINIBAND_SDP_RECV_ZCOPY 1"
-else
-        DEFINE_INFINIBAND_SDP_RECV_ZCOPY="#undef CONFIG_INFINIBAND_SDP_RECV_ZCOPY"
-fi
-if [ "X${CONFIG_INFINIBAND_SDP_DEBUG}" == "Xy" ]; then
-        DEFINE_INFINIBAND_SDP_DEBUG="#undef CONFIG_INFINIBAND_SDP_DEBUG\n#define CONFIG_INFINIBAND_SDP_DEBUG 1"
-else
-        DEFINE_INFINIBAND_SDP_DEBUG="#undef CONFIG_INFINIBAND_SDP_DEBUG"
-fi
-if [ "X${CONFIG_INFINIBAND_SDP_DEBUG_DATA}" == "Xy" ]; then
-        DEFINE_INFINIBAND_SDP_DEBUG_DATA="#undef CONFIG_INFINIBAND_SDP_DEBUG_DATA\n#define CONFIG_INFINIBAND_SDP_DEBUG_DATA 1"
-else
-        DEFINE_INFINIBAND_SDP_DEBUG_DATA="#undef CONFIG_INFINIBAND_SDP_DEBUG_DATA"
-fi
-if [ "X${CONFIG_INFINIBAND_IPATH}" == "Xm" ]; then
-        DEFINE_INFINIBAND_IPATH="#undef CONFIG_INFINIBAND_IPATH\n#define CONFIG_INFINIBAND_IPATH 1"
-else
-        DEFINE_INFINIBAND_IPATH="#undef CONFIG_INFINIBAND_IPATH"
-fi
-if [ "X${CONFIG_INFINIBAND_QIB}" == "Xm" ]; then
-        DEFINE_INFINIBAND_QIB="#undef CONFIG_INFINIBAND_QIB\n#define CONFIG_INFINIBAND_QIB 1"
-else
-        DEFINE_INFINIBAND_QIB="#undef CONFIG_INFINIBAND_QIB"
-fi
-if [ "X${CONFIG_INFINIBAND_MTHCA_DEBUG}" == "Xy" ]; then
-        DEFINE_INFINIBAND_MTHCA_DEBUG="#undef CONFIG_INFINIBAND_MTHCA_DEBUG\n#define CONFIG_INFINIBAND_MTHCA_DEBUG 1"
-else
-        DEFINE_INFINIBAND_MTHCA_DEBUG="#undef CONFIG_INFINIBAND_MTHCA_DEBUG"
-fi
-if [ "X${CONFIG_INFINIBAND_QLGC_VNIC}" == "Xm" ]; then
-        DEFINE_INFINIBAND_QLGC_VNIC="#undef CONFIG_INFINIBAND_QLGC_VNIC\n#define CONFIG_INFINIBAND_QLGC_VNIC 1"
-else
-        DEFINE_INFINIBAND_QLGC_VNIC="#undef CONFIG_INFINIBAND_QLGC_VNIC"
-fi
-if [ "X${CONFIG_INFINIBAND_QLGC_VNIC_STATS}" == "Xy" ]; then
-        DEFINE_INFINIBAND_QLGC_VNIC_STATS="#undef CONFIG_INFINIBAND_QLGC_VNIC_STATS\n#define CONFIG_INFINIBAND_QLGC_VNIC_STATS 1"
-else
-        DEFINE_INFINIBAND_QLGC_VNIC_STATS="#undef CONFIG_INFINIBAND_QLGC_VNIC_STATS"
-fi
-if [ "X${CONFIG_INFINIBAND_CXGB3}" == "Xm" ]; then
-        DEFINE_INFINIBAND_CXGB3="#undef CONFIG_INFINIBAND_CXGB3\n#define CONFIG_INFINIBAND_CXGB3 1"
-else
-        DEFINE_INFINIBAND_CXGB3="#undef CONFIG_INFINIBAND_CXGB3"
-fi
-if [ "X${CONFIG_INFINIBAND_CXGB3_DEBUG}" == "Xy" ]; then
-        DEFINE_INFINIBAND_CXGB3_DEBUG="#undef CONFIG_INFINIBAND_CXGB3_DEBUG\n#define CONFIG_INFINIBAND_CXGB3_DEBUG 1"
-else
-        DEFINE_INFINIBAND_CXGB3_DEBUG="#undef CONFIG_INFINIBAND_CXGB3_DEBUG"
-fi
-if [ "X${CONFIG_CHELSIO_T3}" == "Xm" ]; then
-        DEFINE_CHELSIO_T3="#undef CONFIG_CHELSIO_T3\n#define CONFIG_CHELSIO_T3 1"
-else
-        DEFINE_CHELSIO_T3="#undef CONFIG_CHELSIO_T3"
-fi
-if [ "X${CONFIG_INFINIBAND_CXGB4}" == "Xm" ]; then
-        DEFINE_INFINIBAND_CXGB4="#undef CONFIG_INFINIBAND_CXGB4\n#define CONFIG_INFINIBAND_CXGB4 1"
-else
-        DEFINE_INFINIBAND_CXGB4="#undef CONFIG_INFINIBAND_CXGB4"
-fi
-if [ "X${CONFIG_CHELSIO_T4}" == "Xm" ]; then
-        DEFINE_CHELSIO_T4="#undef CONFIG_CHELSIO_T4\n#define CONFIG_CHELSIO_T4 1"
-else
-        DEFINE_CHELSIO_T4="#undef CONFIG_CHELSIO_T4"
-fi
-if [ "X${CONFIG_INFINIBAND_NES}" == "Xm" ]; then
-        DEFINE_INFINIBAND_NES="#undef CONFIG_INFINIBAND_NES\n#define CONFIG_INFINIBAND_NES 1"
-else
-        DEFINE_INFINIBAND_NES="#undef CONFIG_INFINIBAND_NES"
-fi
-if [ "X${CONFIG_INFINIBAND_NES_DEBUG}" == "Xy" ]; then
-        DEFINE_INFINIBAND_NES_DEBUG="#undef CONFIG_INFINIBAND_NES_DEBUG\n#define CONFIG_INFINIBAND_NES_DEBUG 1"
-else
-        DEFINE_INFINIBAND_NES_DEBUG="#undef CONFIG_INFINIBAND_NES_DEBUG"
-fi
-if [ "X${CONFIG_INFINIBAND_AMSO1100}" == "Xm" ]; then
-        DEFINE_INFINIBAND_AMSO1100="#undef CONFIG_INFINIBAND_AMSO1100\n#define CONFIG_INFINIBAND_AMSO1100 1"
-else
-        DEFINE_INFINIBAND_AMSO1100="#undef CONFIG_INFINIBAND_AMSO1100"
-fi
-if [ "X${CONFIG_SUNRPC_XPRT_RDMA}" == "Xm" ]; then
-        DEFINE_SUNRPC_XPRT_RDMA="#undef CONFIG_SUNRPC_XPRT_RDMA\n#define CONFIG_SUNRPC_XPRT_RDMA 1"
-        DEFINE_SUNRPC="#undef CONFIG_SUNRPC\n#define CONFIG_SUNRPC 1"
-        DEFINE_SUNRPC_GSS="#undef CONFIG_SUNRPC_GSS\n#define CONFIG_SUNRPC_GSS 1"
-        DEFINE_RPCSEC_GSS_KRB5="#undef CONFIG_RPCSEC_GSS_KRB5\n#define CONFIG_RPCSEC_GSS_KRB5 1"
-        DEFINE_RPCSEC_GSS_SPKM3="#undef CONFIG_RPCSEC_GSS_SPKM3\n#define CONFIG_RPCSEC_GSS_SPKM3 1"
-        DEFINE_NFS_FS="#undef CONFIG_NFS_FS\n#define CONFIG_NFS_FS 1"
-        DEFINE_NFS_V3="#undef CONFIG_NFS_V3\n#define CONFIG_NFS_V3 1"
-        DEFINE_NFS_V3_ACL="#undef CONFIG_NFS_V3_ACL\n#define CONFIG_NFS_V3_ACL 1"
-        DEFINE_NFS_V4="#undef CONFIG_NFS_V4\n#define CONFIG_NFS_V4 1"
-        DEFINE_NFS_ACL_SUPPORT="#undef CONFIG_NFS_ACL_SUPPORT\n#define CONFIG_NFS_ACL_SUPPORT 1"
-        DEFINE_NFS_DIRECTIO="#undef CONFIG_NFS_DIRECTIO\n#define CONFIG_NFS_DIRECTIO 1"
-        DEFINE_EXPORTFS="#undef CONFIG_EXPORTFS\n#define CONFIG_EXPORTFS 1"
-        DEFINE_LOCKD="#undef CONFIG_LOCKD\n#define CONFIG_LOCKD 1"
-        DEFINE_LOCKD_V4="#undef CONFIG_LOCKD_V4\n#define CONFIG_LOCKD_V4 1"
-        DEFINE_NFSD="#undef CONFIG_NFSD\n#define CONFIG_NFSD 1"
-        DEFINE_NFSD_V2_ACL="#undef CONFIG_NFSD_V2_ACL\n#define CONFIG_NFSD_V2_ACL 1"
-        DEFINE_NFSD_V3="#undef CONFIG_NFSD_V3\n#define CONFIG_NFSD_V3 1"
-        DEFINE_NFSD_V3_ACL="#undef CONFIG_NFSD_V3_ACL\n#define CONFIG_NFSD_V3_ACL 1"
-        DEFINE_NFSD_V4="#undef CONFIG_NFSD_V4\n#define CONFIG_NFSD_V4 1"
-        DEFINE_NFSD_RDMA="#undef CONFIG_NFSD_RDMA\n#define CONFIG_NFSD_RDMA 1"
-else
-        DEFINE_SUNRPC_XPRT_RDMA="/* CONFIG_SUNRPC_XPRT_RDMA is not set */"
-        DEFINE_SUNRPC="/* CONFIG_SUNRPC is not set */"
-        DEFINE_SUNRPC_GSS="/* CONFIG_SUNRPC_GSS is not set */"
-        DEFINE_RPCSEC_GSS_KRB5="/* CONFIG_RPCSEC_GSS_KRB5 is not set */"
-        DEFINE_RPCSEC_GSS_SPKM3="/* CONFIG_RPCSEC_GSS_SPKM3 is not set */"
-        DEFINE_NFS_FS="/* CONFIG_NFS_FS is not set */"
-        DEFINE_NFS_V3="/* CONFIG_NFS_V3 is not set */"
-        DEFINE_NFS_V3_ACL="/* CONFIG_NFS_V3_ACL is not set */"
-        DEFINE_NFS_V4="/* CONFIG_NFS_V4 is not set */"
-        DEFINE_NFS_ACL_SUPPORT="/* CONFIG_NFS_ACL_SUPPORT is not set */"
-        DEFINE_NFS_DIRECTIO="/* CONFIG_NFS_DIRECTIO is not set */"
-        DEFINE_EXPORTFS="/* CONFIG_EXPORTFS is not set */"
-        DEFINE_LOCKD="/* CONFIG_LOCKD is not set */"
-        DEFINE_LOCKD_V4="/* CONFIG_LOCKD_V4 is not set */"
-        DEFINE_NFSD="/* CONFIG_NFSD is not set */"
-        DEFINE_NFSD_V2_ACL="/* CONFIG_NFSD_V2_ACL is not set */"
-        DEFINE_NFSD_V3="/* CONFIG_NFSD_V3 is not set */"
-        DEFINE_NFSD_V3_ACL="/* CONFIG_NFSD_V3_ACL is not set */"
-        DEFINE_NFSD_V4="/* CONFIG_NFSD_V4 is not set */"
-        DEFINE_NFSD_RDMA="/* CONFIG_NFSD_RDMA is not set */"
-fi
-cat >> ${AUTOCONF_H} << EOFAUTOCONF
-#ifndef __OFED_BUILD__
-#include_next <linux/autoconf.h>
-$(echo -e "${DEFINE_INFINIBAND}" | grep -v undef)
-$(echo -e "${DEFINE_INFINIBAND_IPOIB}" | grep -v undef)
-$(echo -e "${DEFINE_INFINIBAND_IPOIB_CM}" | grep -v undef)
-$(echo -e "${DEFINE_INFINIBAND_SDP}" | grep -v undef)
-$(echo -e "${DEFINE_INFINIBAND_SRP}" | grep -v undef)
-$(echo -e "${DEFINE_INFINIBAND_SRPT}" | grep -v undef)
-
-$(echo -e "${DEFINE_INFINIBAND_USER_MAD}" | grep -v undef)
-$(echo -e "${DEFINE_INFINIBAND_USER_ACCESS}" | grep -v undef)
-$(echo -e "${DEFINE_INFINIBAND_ADDR_TRANS}" | grep -v undef)
-$(echo -e "${DEFINE_INFINIBAND_USER_MEM}" | grep -v undef)
-$(echo -e "${DEFINE_INFINIBAND_MTHCA}" | grep -v undef)
-$(echo -e "${DEFINE_INFINIBAND_QLGC_VNIC}" | grep -v undef)
-$(echo -e "${DEFINE_INFINIBAND_CXGB3}" | grep -v undef)
-$(echo -e "${DEFINE_CHELSIO_T3}" | grep -v undef)
-$(echo -e "${DEFINE_INFINIBAND_CXGB4}" | grep -v undef)
-$(echo -e "${DEFINE_CHELSIO_T4}" | grep -v undef)
-$(echo -e "${DEFINE_INFINIBAND_NES}" | grep -v undef)
-
-$(echo -e "${DEFINE_SUNRPC_XPRT_RDMA}" | grep -v undef)
-$(echo -e "${DEFINE_SUNRPC}" | grep -v undef)
-$(echo -e "${DEFINE_SUNRPC_GSS}" | grep -v undef)
-$(echo -e "${DEFINE_RPCSEC_GSS_KRB5}" | grep -v undef)
-$(echo -e "${DEFINE_RPCSEC_GSS_SPKM3}" | grep -v undef)
-$(echo -e "${DEFINE_NFS_FS}" | grep -v undef)
-$(echo -e "${DEFINE_NFS_V3}" | grep -v undef)
-$(echo -e "${DEFINE_NFS_V3_ACL}" | grep -v undef)
-$(echo -e "${DEFINE_NFS_V4}" | grep -v undef)
-$(echo -e "${DEFINE_NFS_ACL_SUPPORT}" | grep -v undef)
-$(echo -e "${DEFINE_NFS_DIRECTIO}" | grep -v undef)
-$(echo -e "${DEFINE_EXPORTFS}" | grep -v undef)
-$(echo -e "${DEFINE_LOCKD}" | grep -v undef)
-$(echo -e "${DEFINE_LOCKD_V4}" | grep -v undef)
-$(echo -e "${DEFINE_NFSD}" | grep -v undef)
-$(echo -e "${DEFINE_NFSD_V2_ACL}" | grep -v undef)
-$(echo -e "${DEFINE_NFSD_V3}" | grep -v undef)
-$(echo -e "${DEFINE_NFSD_V3_ACL}" | grep -v undef)
-$(echo -e "${DEFINE_NFSD_V4}" | grep -v undef)
-$(echo -e "${DEFINE_NFSD_RDMA}" | grep -v undef)
-
-$(echo -e "${DEFINE_INFINIBAND_IPOIB_DEBUG}" | grep -v undef)
-$(echo -e "${DEFINE_INFINIBAND_ISER}" | grep -v undef)
-$(echo -e "${DEFINE_SCSI_ISCSI_ATTRS}" | grep -v undef)
-$(echo -e "${DEFINE_ISCSI_TCP}" | grep -v undef)
-$(echo -e "${DEFINE_INFINIBAND_EHCA}" | grep -v undef)
-$(echo -e "${DEFINE_RDS}" | grep -v undef)
-$(echo -e "${DEFINE_RDS_RDMA}" | grep -v undef)
-$(echo -e "${DEFINE_RDS_TCP}" | grep -v undef)
-$(echo -e "${DEFINE_RDS_DEBUG}" | grep -v undef)
-$(echo -e "${DEFINE_INFINIBAND_QLGC_VNIC_STATS}" | grep -v undef)
-$(echo -e "${DEFINE_INFINIBAND_CXGB3_DEBUG}" | grep -v undef)
-$(echo -e "${DEFINE_INFINIBAND_NES_DEBUG}" | grep -v undef)
-
-$(echo -e "${DEFINE_MLX4_CORE}" | grep -v undef)
-$(echo -e "${DEFINE_MLX4_EN}" | grep -v undef)
-$(echo -e "${DEFINE_MLX4_INFINIBAND}" | grep -v undef)
-$(echo -e "${DEFINE_MLX4_ETHERNET}" | grep -v undef)
-$(echo -e "${DEFINE_MLX4_DEBUG}" | grep -v undef)
-
-$(echo -e "${DEFINE_INFINIBAND_IPOIB_DEBUG_DATA}" | grep -v undef)
-$(echo -e "${DEFINE_INFINIBAND_SDP_SEND_ZCOPY}" | grep -v undef)
-$(echo -e "${DEFINE_INFINIBAND_SDP_RECV_ZCOPY}" | grep -v undef)
-$(echo -e "${DEFINE_INFINIBAND_SDP_DEBUG}" | grep -v undef)
-$(echo -e "${DEFINE_INFINIBAND_SDP_DEBUG_DATA}" | grep -v undef)
-$(echo -e "${DEFINE_INFINIBAND_IPATH}" | grep -v undef)
-$(echo -e "${DEFINE_INFINIBAND_QIB}" | grep -v undef)
-$(echo -e "${DEFINE_INFINIBAND_MTHCA_DEBUG}" | grep -v undef)
-$(echo -e "${DEFINE_INFINIBAND_MADEYE}" | grep -v undef)
-$(echo -e "${DEFINE_INFINIBAND_AMSO1100}" | grep -v undef)
-#else
-#undef CONFIG_MEMTRACK
-#undef CONFIG_DEBUG_INFO
-#undef CONFIG_INFINIBAND
-#undef CONFIG_INFINIBAND_IPOIB
-#undef CONFIG_INFINIBAND_IPOIB_CM
-#undef CONFIG_INFINIBAND_SDP
-#undef CONFIG_INFINIBAND_SRP
-#undef CONFIG_INFINIBAND_SRPT
-
-#undef CONFIG_INFINIBAND_USER_MAD
-#undef CONFIG_INFINIBAND_USER_ACCESS
-#undef CONFIG_INFINIBAND_ADDR_TRANS
-#undef CONFIG_INFINIBAND_USER_MEM
-#undef CONFIG_INFINIBAND_MTHCA
-
-#undef CONFIG_MLX4_CORE
-#undef CONFIG_MLX4_DEBUG
-#undef CONFIG_MLX4_EN
-#undef CONFIG_MLX4_INFINIBAND
-
-#undef CONFIG_INFINIBAND_IPOIB_DEBUG
-#undef CONFIG_INFINIBAND_ISER
-#undef CONFIG_INFINIBAND_EHCA
-#undef CONFIG_INFINIBAND_EHCA_SCALING
-#undef CONFIG_RDS
-#undef CONFIG_RDS_RDMA
-#undef CONFIG_RDS_TCP
-#undef CONFIG_RDS_DEBUG
-#undef CONFIG_INFINIBAND_MADEYE
-#undef CONFIG_INFINIBAND_QLGC_VNIC
-#undef CONFIG_INFINIBAND_QLGC_VNIC_STATS
-#undef CONFIG_INFINIBAND_CXGB3
-#undef CONFIG_INFINIBAND_CXGB3_DEBUG
-#undef CONFIG_CHELSIO_T3
-#undef CONFIG_INFINIBAND_CXGB4
-#undef CONFIG_CHELSIO_T4
-#undef CONFIG_INFINIBAND_NES
-#undef CONFIG_INFINIBAND_NES_DEBUG
-
-#undef CONFIG_SUNRPC_XPRT_RDMA
-#undef CONFIG_SUNRPC
-#undef CONFIG_SUNRPC_GSS
-#undef CONFIG_RPCSEC_GSS_KRB5
-#undef CONFIG_RPCSEC_GSS_SPKM3
-#undef CONFIG_NFS_FS
-#undef CONFIG_NFS_V3
-#undef CONFIG_NFS_V3_ACL
-#undef CONFIG_NFS_V4
-#undef CONFIG_NFS_ACL_SUPPORT
-#undef CONFIG_NFS_DIRECTIO
-#undef CONFIG_EXPORTFS
-#undef CONFIG_LOCKD
-#undef CONFIG_LOCKD_V4
-#undef CONFIG_NFSD
-#undef CONFIG_NFSD_V2_ACL
-#undef CONFIG_NFSD_V3
-#undef CONFIG_NFSD_V3_ACL
-#undef CONFIG_NFSD_V4
-#undef CONFIG_NFSD_RDMA
-
-#undef CONFIG_INFINIBAND_IPOIB_DEBUG_DATA
-#undef CONFIG_INFINIBAND_SDP_SEND_ZCOPY
-#undef CONFIG_INFINIBAND_SDP_RECV_ZCOPY
-#undef CONFIG_INFINIBAND_SDP_DEBUG
-#undef CONFIG_INFINIBAND_SDP_DEBUG_DATA
-#undef CONFIG_INFINIBAND_IPATH
-#undef CONFIG_INFINIBAND_QIB
-#undef CONFIG_INFINIBAND_MTHCA_DEBUG
-#undef CONFIG_INFINIBAND_AMSO1100
-
-$(echo -e "${DEFINE_INFINIBAND}")
-$(echo -e "${DEFINE_INFINIBAND_IPOIB}")
-$(echo -e "${DEFINE_INFINIBAND_IPOIB_CM}")
-$(echo -e "${DEFINE_INFINIBAND_SDP}")
-$(echo -e "${DEFINE_INFINIBAND_SRP}")
-$(echo -e "${DEFINE_INFINIBAND_SRPT}")
-
-$(echo -e "${DEFINE_INFINIBAND_USER_MAD}")
-$(echo -e "${DEFINE_INFINIBAND_USER_ACCESS}")
-$(echo -e "${DEFINE_INFINIBAND_ADDR_TRANS}")
-$(echo -e "${DEFINE_INFINIBAND_USER_MEM}")
-$(echo -e "${DEFINE_INFINIBAND_MTHCA}")
-$(echo -e "${DEFINE_INFINIBAND_QLGC_VNIC}")
-$(echo -e "${DEFINE_INFINIBAND_CXGB3}")
-$(echo -e "${DEFINE_CHELSIO_T3}")
-$(echo -e "${DEFINE_INFINIBAND_CXGB4}")
-$(echo -e "${DEFINE_CHELSIO_T4}")
-$(echo -e "${DEFINE_INFINIBAND_NES}")
-
-$(echo -e "${DEFINE_SUNRPC_XPRT_RDMA}")
-$(echo -e "${DEFINE_SUNRPC}")
-$(echo -e "${DEFINE_SUNRPC_GSS}")
-$(echo -e "${DEFINE_RPCSEC_GSS_KRB5}")
-$(echo -e "${DEFINE_RPCSEC_GSS_SPKM3}")
-$(echo -e "${DEFINE_NFS_FS}")
-$(echo -e "${DEFINE_NFS_V3}")
-$(echo -e "${DEFINE_NFS_V3_ACL}")
-$(echo -e "${DEFINE_NFS_V4}")
-$(echo -e "${DEFINE_NFS_ACL_SUPPORT}")
-$(echo -e "${DEFINE_NFS_DIRECTIO}")
-$(echo -e "${DEFINE_EXPORTFS}")
-$(echo -e "${DEFINE_LOCKD}")
-$(echo -e "${DEFINE_LOCKD_V4}")
-$(echo -e "${DEFINE_NFSD}")
-$(echo -e "${DEFINE_NFSD_V2_ACL}")
-$(echo -e "${DEFINE_NFSD_V3}")
-$(echo -e "${DEFINE_NFSD_V3_ACL}")
-$(echo -e "${DEFINE_NFSD_V4}")
-$(echo -e "${DEFINE_NFSD_RDMA}")
-
-$(echo -e "${DEFINE_INFINIBAND_IPOIB_DEBUG}")
-$(echo -e "${DEFINE_INFINIBAND_ISER}")
-$(echo -e "${DEFINE_SCSI_ISCSI_ATTRS}")
-$(echo -e "${DEFINE_ISCSI_TCP}")
-$(echo -e "${DEFINE_INFINIBAND_EHCA}")
-$(echo -e "${DEFINE_RDS}")
-$(echo -e "${DEFINE_RDS_RDMA}")
-$(echo -e "${DEFINE_RDS_TCP}")
-$(echo -e "${DEFINE_RDS_DEBUG}")
-$(echo -e "${DEFINE_INFINIBAND_QLGC_VNIC_STATS}")
-$(echo -e "${DEFINE_INFINIBAND_CXGB3_DEBUG}")
-$(echo -e "${DEFINE_INFINIBAND_NES_DEBUG}")
-
-$(echo -e "${DEFINE_MLX4_CORE}")
-$(echo -e "${DEFINE_MLX4_EN}")
-$(echo -e "${DEFINE_MLX4_INFINIBAND}")
-$(echo -e "${DEFINE_MLX4_ETHERNET}")
-$(echo -e "${DEFINE_MLX4_DEBUG}")
-
-$(echo -e "${DEFINE_INFINIBAND_IPOIB_DEBUG_DATA}")
-$(echo -e "${DEFINE_INFINIBAND_SDP_SEND_ZCOPY}")
-$(echo -e "${DEFINE_INFINIBAND_SDP_RECV_ZCOPY}")
-$(echo -e "${DEFINE_INFINIBAND_SDP_DEBUG}")
-$(echo -e "${DEFINE_INFINIBAND_SDP_DEBUG_DATA}")
-$(echo -e "${DEFINE_INFINIBAND_IPATH}")
-$(echo -e "${DEFINE_INFINIBAND_QIB}")
-$(echo -e "${DEFINE_INFINIBAND_MTHCA_DEBUG}")
-$(echo -e "${DEFINE_INFINIBAND_MADEYE}")
-$(echo -e "${DEFINE_INFINIBAND_AMSO1100}")
-#endif
-
-EOFAUTOCONF
-
-        echo "Created ${AUTOCONF_H}:"
-        cat ${AUTOCONF_H}
-}
-
-main $@
index a6b7086dc0c5db16463df864f4682c44c51612f4..0064d47c4f645fe8bed75524fb11770c779dedfc 100755 (executable)
@@ -340,6 +340,18 @@ if [ -e ${Devices[$dev]}/mlx4_port2 ]; then
 fi
 echo
 
+write_mask="0x222"
+mlx4_port_file="${Devices[$dev]}/mlx4_port1"
+if [ ! -w $mlx4_port_file ] || [ $((0x$(stat -c "%a" $mlx4_port_file) & $write_mask)) == "0" ]; then
+       echo "Not allowed to change port configuration, quitting..."
+       exit 1;
+fi
+mlx4_port_file="${Devices[$dev]}/mlx4_port2"
+if [ -e $mlx4_port_file ] && ([ ! -w $mlx4_port_file ] || [ $((0x$(stat -c "%a" $mlx4_port_file) & $write_mask)) == "0" ]); then
+       echo "Not allowed to change port configuration, quitting..."
+       exit 1;
+fi
+
 ############################################################
 # Set port configuration for the selected device           #
 ############################################################
@@ -353,6 +365,19 @@ fi
 
 comm1=`echo ${comm} | cut -d ',' -f 1`
 comm2=`echo ${comm} | cut -d ',' -f 2`
+
+for uverbs_dir in ${Devices[$dev]}infiniband_verbs/uverbs*
+do
+       if [[ -f $uverbs_dir/ref_cnt  ]]; then
+               if [[ `cat "$uverbs_dir/ref_cnt"` > 1 ]]; then
+                       echo "WARNING: Please close user level applications" \
+                            "before running connectx_port_config. "
+                       echo "Operation aborted!"
+                       exit 1
+               fi
+       fi
+done
+
 {
 echo "${comm1}" > ${Devices[$dev]}/mlx4_port1
 } > /dev/null 2>&1
diff --git a/ofed_scripts/gen-compat-autoconf.sh b/ofed_scripts/gen-compat-autoconf.sh
new file mode 100755 (executable)
index 0000000..6f25ebd
--- /dev/null
@@ -0,0 +1,116 @@
+#!/bin/bash
+#
+# Copyright 2013        Mellanox Technologies. All rights reserved.
+# Copyright 2012       Luis R. Rodriguez <mcgrof@frijolero.org>
+# Copyright 2011       Hauke Mehrtens <hauke@hauke-m.de>
+# Copyright 2011       John W. Linville <linville@tuxdriver.com>
+#
+# Use this to parse a small .config equivalent looking file to generate
+# our own autoconf.h. This file has defines for each config option
+# just like the kernels include/linux/autoconf.h
+#
+# XXX: consider using scripts/kconfig/confdata.c instead.
+# On the downside this would require the user to have libc though.
+
+# This indicates which is the oldest kernel we support
+# Update this if you are adding support for older kernels.
+OLDEST_KERNEL_SUPPORTED="2.6.24"
+
+if [ $# -ne 1 ]; then
+       echo "Usage $0 config-file"
+       exit
+fi
+
+COMPAT_CONFIG="$1"
+
+if [ ! -f $COMPAT_CONFIG ]; then
+       echo "File $1 is not a file"
+       exit
+fi
+
+# Defines a CONFIG_ option if not defined yet, this helps respect
+# linux/autoconf.h
+function define_config {
+       VAR=$1
+       VALUE=$2
+       case $VALUE in
+       n) # Try to undefine it
+               echo "#undef $VAR"
+               ;;
+       y)
+               echo "#ifndef $VAR"
+               echo "#define $VAR 1"
+               echo "#endif /* $VAR */"
+               ;;
+       m)
+               echo "#ifndef $VAR"
+               echo "#define $VAR 1"
+               echo "#endif /* $VAR */"
+               ;;
+       *) # Assume string
+               # XXX: add better checks to make sure what was on
+               # the right was indeed a string
+               echo "#ifndef $VAR"
+               echo "#define $VAR \"$VALUE\""
+               echo "#endif /* $VAR */"
+               ;;
+       esac
+}
+
+function kernel_version_req {
+       VERSION=$(echo $1 | sed -e 's/\./,/g')
+       echo "#if (LINUX_VERSION_CODE < KERNEL_VERSION($VERSION))"
+       echo "#error compat requirement: Linux >= $VERSION"
+       echo "#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION($VERSION) */"
+}
+
+cat <<EOF
+#ifndef COMPAT_AUTOCONF_INCLUDED
+#define COMPAT_AUTOCONF_INCLUDED
+/*
+ * Automatically generated C config: don't edit
+ */
+EOF
+
+# Checks user is compiling against a kernel we support
+kernel_version_req $OLDEST_KERNEL_SUPPORTED
+
+# For each CONFIG_FOO=x option
+for i in $(egrep '^CONFIG_|^export CONFIG_|^ifdef CONFIG_|^ifndef CONFIG_|^endif #CONFIG_|^else #CONFIG_' $COMPAT_CONFIG | sed 's/ /+/'); do
+       case $i in
+       'ifdef+CONFIG_'* )
+               echo "#$i" | sed -e 's/+/ /' -e 's/\(ifdef CONFIG_COMPAT_KERNEL_3_\)\([0-9]*\)/if (LINUX_VERSION_CODE < KERNEL_VERSION(3,\2,0))/' -e 's/\(ifdef CONFIG_COMPAT_KERNEL_2_6_\)\([0-9]*\)/if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,\2))/' -e 's/\(ifdef CONFIG_COMPAT_RHEL_\)\([0-9]*\)_\([0-9]*\)/if (defined(RHEL_MAJOR) \&\& RHEL_MAJOR == \2 \&\& RHEL_MINOR >= \3)/' -e 's/\(#ifdef \)\(CONFIG_[^:space:]*\)/#if defined(\2) || defined(\2_MODULE)/'
+               continue
+               ;;
+       'ifndef+CONFIG_'* )
+               echo "#$i" | sed -e 's/+/ /' -e 's/\(ifndef CONFIG_COMPAT_KERNEL_3_\)\([0-9]*\)/if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,\2,0))/' -e 's/\(ifndef CONFIG_COMPAT_KERNEL_2_6_\)\([0-9]*\)/if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,\2))/' -e 's/\(ifndef CONFIG_COMPAT_RHEL_\)\([0-9]*\)_\([0-9]*\)/if (!defined(RHEL_MAJOR) || RHEL_MAJOR != \2 || RHEL_MINOR < \3)/' -e 's/\(#ifndef \)\(CONFIG_[^:space:]*\)/#if !defined(\2) \&\& !defined(\2_MODULE)/'
+               continue
+               ;;
+       'else+#CONFIG_'* | 'endif+#CONFIG_'* )
+               echo "#$i */" |sed -e 's/+#/ \/* /g'
+               continue
+               ;;
+       'export+CONFIG_'* )
+               # Get the element on the left of the "="
+               VAR=$(echo $i | cut -d"=" -f 1 | cut -d"+" -f 2)
+               # Get the element on the right of the "="
+               VALUE=$(echo $i | cut -d"=" -f 2)
+
+               # Any other module which can *definitely* be built as a module goes here
+               define_config $VAR $VALUE
+               continue
+               ;;
+       CONFIG_* )
+               # Get the element on the left of the "="
+               VAR=$(echo $i | cut -d"=" -f 1)
+               # Get the element on the right of the "="
+               VALUE=$(echo $i | cut -d"=" -f 2)
+
+               # Any other module which can *definitely* be built as a module goes here
+               define_config $VAR $VALUE
+               continue
+               ;;
+       esac
+done
+
+echo "#endif /* COMPAT_AUTOCONF_INCLUDED */"
diff --git a/ofed_scripts/gen-compat-config.sh b/ofed_scripts/gen-compat-config.sh
new file mode 100755 (executable)
index 0000000..bb25339
--- /dev/null
@@ -0,0 +1,217 @@
+#!/bin/bash
+# Copyright 2013        Mellanox Technologies. All rights reserved.
+# Copyright 2012        Luis R. Rodriguez <mcgrof@frijolero.org>
+# Copyright 2012        Hauke Mehrtens <hauke@hauke-m.de>
+#
+# This generates a bunch of CONFIG_COMPAT_KERNEL_2_6_22
+# CONFIG_COMPAT_KERNEL_3_0 .. etc for each kernel release you need an object
+# for.
+#
+# Note: this is part of the compat.git project, not compat-drivers,
+# send patches against compat.git.
+
+if [[ ! -f ${KLIB_BUILD}/Makefile ]]; then
+       exit
+fi
+
+KERNEL_VERSION=$(${MAKE} -C ${KLIB_BUILD} kernelversion | sed -n 's/^\([0-9]\)\..*/\1/p')
+
+# 3.0 kernel stuff
+COMPAT_LATEST_VERSION="11"
+KERNEL_SUBLEVEL="-1"
+
+function set_config {
+       VAR=$1
+       VALUE=$2
+
+       eval "export $VAR=$VALUE"
+       echo "export $VAR=$VALUE"
+}
+# Note that this script will export all variables explicitly,
+# trying to export all with a blanket "export" statement at
+# the top of the generated file causes the build to slow down
+# by an order of magnitude.
+
+if [[ ${KERNEL_VERSION} -eq "3" ]]; then
+       KERNEL_SUBLEVEL=$(${MAKE} -C ${KLIB_BUILD} kernelversion | sed -n 's/^3\.\([0-9]\+\).*/\1/p')
+else
+       COMPAT_26LATEST_VERSION="39"
+       KERNEL_26SUBLEVEL=$(${MAKE} -C ${KLIB_BUILD} kernelversion | sed -n 's/^2\.6\.\([0-9]\+\).*/\1/p')
+       let KERNEL_26SUBLEVEL=${KERNEL_26SUBLEVEL}+1
+
+       for i in $(seq ${KERNEL_26SUBLEVEL} ${COMPAT_26LATEST_VERSION}); do
+               set_config CONFIG_COMPAT_KERNEL_2_6_${i} y
+       done
+fi
+
+let KERNEL_SUBLEVEL=${KERNEL_SUBLEVEL}+1
+for i in $(seq ${KERNEL_SUBLEVEL} ${COMPAT_LATEST_VERSION}); do
+       set_config CONFIG_COMPAT_KERNEL_3_${i} y
+done
+
+# The purpose of these seem to be the inverse of the above other varibales.
+# The RHEL checks seem to annotate the existance of RHEL minor versions.
+RHEL_MAJOR=$(grep ^RHEL_MAJOR ${KLIB_BUILD}/Makefile | sed -n 's/.*= *\(.*\)/\1/p')
+if [[ ! -z ${RHEL_MAJOR} ]]; then
+       RHEL_MINOR=$(grep ^RHEL_MINOR ${KLIB_BUILD}/Makefile | sed -n 's/.*= *\(.*\)/\1/p')
+       for i in $(seq 0 ${RHEL_MINOR}); do
+               set_config CONFIG_COMPAT_RHEL_${RHEL_MAJOR}_${i} y
+       done
+fi
+
+if [[ ${CONFIG_COMPAT_KERNEL_2_6_33} = "y" ]]; then
+       if [[ ! ${CONFIG_COMPAT_RHEL_6_0} = "y" ]]; then
+               set_config CONFIG_COMPAT_FIRMWARE_CLASS m
+       fi
+fi
+
+if [[ ${CONFIG_COMPAT_KERNEL_2_6_36} = "y" ]]; then
+       if [[ ! ${CONFIG_COMPAT_RHEL_6_1} = "y" ]]; then
+               set_config CONFIG_COMPAT_KFIFO y
+       fi
+fi
+
+if [[ ${CONFIG_COMPAT_KERNEL_3_2} = "y" ]]; then
+       set_config CONFIG_COMPAT_USE_LRO y
+fi
+
+SLES_11_2_KERNEL=$(echo ${KVERSION} | sed -n 's/^\(3\.0\.[0-9]\+\)\-\(.*\)\-\(.*\)/\1-\2-\3/p')
+if [[ ! -z ${SLES_11_2_KERNEL} ]]; then
+       SLES_MAJOR="11"
+       SLES_MINOR="2"
+       set_config CONFIG_COMPAT_SLES_11_2 y
+fi
+
+SLES_11_1_KERNEL=$(echo ${KVERSION} | sed -n 's/^\(2\.6\.32\.[0-9]\+\)\-\(.*\)\-\(.*\)/\1-\2-\3/p')
+if [[ ! -z ${SLES_11_1_KERNEL} ]]; then
+       SLES_MAJOR="11"
+       SLES_MINOR="1"
+       set_config CONFIG_COMPAT_SLES_11_1 y
+fi
+
+FC14_KERNEL=$(echo ${KVERSION} | grep fc14)
+if [[ ! -z ${FC14_KERNEL} ]]; then
+ # CONFIG_COMPAT_DISABLE_DCB should be set to 'y' as it used in drivers/net/ethernet/mellanox/mlx4/Makefile
+       set_config CONFIG_COMPAT_DISABLE_DCB y
+fi
+
+FC16_KERNEL=$(echo ${KVERSION} | grep fc16)
+if [[ ! -z ${FC16_KERNEL} ]]; then
+       set_config CONFIG_COMPAT_MAXRATE y
+       set_config CONFIG_COMPAT_EN_SYSFS y
+fi
+
+UBUNTU12=$(uname -a | grep Ubuntu | grep 3\.2)
+if [[ ! -z ${UBUNTU12} ]]; then
+       set_config CONFIG_COMPAT_EN_SYSFS y
+       set_config CONFIG_COMPAT_ISER_ATTR_IS_VISIBLE y
+fi
+
+UEK_1_KERNEL=$(echo ${KVERSION} | grep uek | grep 2.6.32)
+if [[ ! -z ${UEK_1_KERNEL} ]]; then
+       set_config CONFIG_COMPAT_IS_BITMAP y
+fi
+
+UEK_2_KERNEL=$(echo ${KVERSION} | grep uek | grep 2.6.39)
+if [[ ! -z ${UEK_2_KERNEL} ]]; then
+       set_config CONFIG_COMPAT_DST_NEIGHBOUR y
+       set_config CONFIG_COMPAT_NETDEV_FEATURES y
+fi
+
+if [[ ${CONFIG_COMPAT_KERNEL_2_6_38} = "y" ]]; then
+       if [[ ! ${CONFIG_COMPAT_RHEL_6_3} = "y" ]]; then
+               set_config CONFIG_COMPAT_NO_PRINTK_NEEDED y
+       fi
+fi
+
+if [[ ${CONFIG_COMPAT_SLES_11_1} = "y" ]]; then
+       set_config CONFIG_COMPAT_DISABLE_DCB y
+       set_config CONFIG_COMPAT_UNDO_I6_PRINT_GIDS y
+       set_config CONFIG_COMPAT_ISCSI_TRANSPORT_PARAM_MASK y
+       set_config CONFIG_COMPAT_DISABLE_VA_FORMAT_PRINT y
+       set_config CONFIG_COMPAT_DISABLE_REAL_NUM_TXQ y
+fi
+
+if [[ ${CONFIG_COMPAT_SLES_11_2} = "y" ]]; then
+       set_config CONFIG_COMPAT_MIN_DUMP_ALLOC_ARG y
+       set_config CONFIG_COMPAT_IS_NUM_TX_QUEUES y
+       set_config CONFIG_COMPAT_NEW_TX_RING_SCHEME y
+       set_config CONFIG_COMPAT_IS___SKB_TX_HASH y
+       set_config CONFIG_COMPAT_ISER_ATTR_IS_VISIBLE y
+       set_config CONFIG_COMPAT_ISCSI_ISER_GET_EP_PARAM y
+       set_config CONFIG_COMPAT_IF_ISCSI_SCSI_REQ y
+       set_config CONFIG_COMPAT_EN_SYSFS y
+fi
+
+if (grep -q dst_set_neighbour ${KLIB_BUILD}/include/net/dst.h > /dev/null 2>&1 || grep -q dst_set_neighbour /lib/modules/${KVERSION}/source/include/net/dst.h > /dev/null 2>&1); then
+       set_config CONFIG_COMPAT_DST_NEIGHBOUR y
+fi
+
+if (grep -q eth_hw_addr_random ${KLIB_BUILD}/include/linux/etherdevice.h > /dev/null 2>&1 || grep -q eth_hw_addr_random /lib/modules/${KVERSION}/source/include/linux/etherdevice.h > /dev/null 2>&1); then
+       set_config CONFIG_COMPAT_ETH_HW_ADDR_RANDOM y
+fi
+
+if (grep -q dev_hw_addr_random ${KLIB_BUILD}/include/linux/etherdevice.h > /dev/null 2>&1 || grep -q dev_hw_addr_random /lib/modules/${KVERSION}/source/include/linux/etherdevice.h > /dev/null 2>&1); then
+       set_config CONFIG_COMPAT_DEV_HW_ADDR_RANDOM y
+fi
+
+if [[ ${CONFIG_COMPAT_RHEL_6_3} = "y" ]]; then
+       set_config CONFIG_COMPAT_XPRT_ALLOC_4PARAMS y
+       set_config CONFIG_COMPAT_XPRT_RESERVE_XPRT_CONG_2PARAMS y
+       set_config CONFIG_COMPAT_FRAGS_SKB y
+fi
+
+if [[ ${CONFIG_COMPAT_RHEL_6_4} = "y" ]]; then
+       set_config CONFIG_COMPAT_IS_PHYS_ID_STATE y
+       set_config CONFIG_COMPAT_IS_PCI_PHYSFN y
+       set_config CONFIG_COMPAT_IS_KSTRTOX y
+       set_config CONFIG_COMPAT_IS_BITOP y
+       set_config CONFIG_COMPAT_NETLINK_3_7 y
+       set_config CONFIG_COMPAT_IS_IP_TOS2PRIO y
+       set_config CONFIG_COMPAT_RCU y
+       set_config CONFIG_COMPAT_HAS_NUM_CHANNELS y
+       set_config CONFIG_COMPAT_ETHTOOL_OPS_EXT y
+fi
+
+if [[ ${RHEL_MAJOR} -eq "6" ]]; then
+       set_config CONFIG_COMPAT_IS___SKB_TX_HASH y
+       set_config CONFIG_COMPAT_ISER_ATTR_IS_VISIBLE y
+       set_config CONFIG_COMPAT_ISCSI_ISER_GET_EP_PARAM y
+       set_config CONFIG_COMPAT_IS_BITMAP y
+       set_config CONFIG_COMPAT_DEFINE_NUM_LRO y
+       set_config CONFIG_COMPAT_NDO_VF_MAC_VLAN y
+       set_config CONFIG_COMPAT_EN_SYSFS y
+       set_config CONFIG_COMPAT_LOOPBACK y
+       set_config CONFIG_COMPAT_XPRTRDMA_NEEDED y
+
+       if [[ ${RHEL_MINOR} -ne "1" ]]; then
+               set_config CONFIG_COMPAT_IS_NUM_TX_QUEUES y
+               set_config CONFIG_COMPAT_IS_PRIO_TC_MAP y
+               set_config CONFIG_COMPAT_NEW_TX_RING_SCHEME y
+               set_config CONFIG_COMPAT_NETIF_F_RXHASH y
+       fi
+fi
+
+if (grep -q virtqueue_get_buf ${KLIB_BUILD}/include/linux/virtio.h > /dev/null 2>&1 || grep -q virtqueue_get_buf /lib/modules/${KVERSION}/source/include/linux/virtio.h > /dev/null 2>&1); then
+       set_config CONFIG_COMPAT_VIRTQUEUE_GET_BUF y
+fi
+
+if (grep -q virtqueue_add_buf ${KLIB_BUILD}/include/linux/virtio.h > /dev/null 2>&1 || grep -q virtqueue_add_buf /lib/modules/${KVERSION}/source/include/linux/virtio.h > /dev/null 2>&1); then
+       set_config CONFIG_COMPAT_VIRTQUEUE_ADD_BUF y
+fi
+
+if (grep -q virtqueue_kick ${KLIB_BUILD}/include/linux/virtio.h > /dev/null 2>&1 || grep -q virtqueue_kick /lib/modules/${KVERSION}/source/include/linux/virtio.h > /dev/null 2>&1); then
+       set_config CONFIG_COMPAT_VIRTQUEUE_KICK y
+fi
+
+if (grep -q zc_request ${KLIB_BUILD}/include/net/9p/transport.h > /dev/null 2>&1 || grep -q zc_request /lib/modules/${KVERSION}/source/include/net/9p/transport.h > /dev/null 2>&1); then
+        set_config CONFIG_COMPAT_ZC_REQUEST y
+fi
+
+if (grep -q gfp_t ${KLIB_BUILD}/tools/include/virtio/linux/virtio.h > /dev/null 2>&1 || grep -q gfp_t /lib/modules/${KVERSION}/source/include/linux/virtio.h > /dev/null 2>&1); then
+        set_config CONFIG_COMPAT_GFP_T y
+fi
+
+if (grep -q virtqueue_add_buf_gfp ${KLIB_BUILD}/tools/include/virtio/linux/virtio.h > /dev/null 2>&1 || grep -q virtqueue_add_buf_gfp /lib/modules/${KVERSION}/source/include/linux/virtio.h > /dev/null 2>&1); then
+        set_config CONFIG_COMPAT_VIRTQUEUE_ADD_BUF_GFP y
+fi
diff --git a/ofed_scripts/ib_sdp.conf b/ofed_scripts/ib_sdp.conf
deleted file mode 100644 (file)
index fa4720b..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-alias net-pf-27 ib_sdp
-alias net-pf-28 ib_sdp
diff --git a/ofed_scripts/makefile b/ofed_scripts/makefile
deleted file mode 100644 (file)
index f87b2e4..0000000
+++ /dev/null
@@ -1,157 +0,0 @@
-# $Id: Makefile 9120 2006-08-28 13:01:07Z vlad $
-
-PHONY += all kernel install_kernel install clean clean_kernel
-       
-all:
-.PHONY: $(PHONY)
-
-.DELETE_ON_ERROR:
-
-include ./configure.mk.kernel
-include ./config.mk
-
-DEPMOD  = /sbin/depmod
-INSTALL_MOD_DIR ?= updates
-
-ifeq ($(CONFIG_MEMTRACK),m)
-        export KERNEL_MEMTRACK_CFLAGS = -include $(CWD)/drivers/infiniband/debug/mtrack.h
-else
-        export KERNEL_MEMTRACK_CFLAGS =
-endif
-
-export OPEN_ISCSI_MODULES = iscsi_tcp.ko libiscsi.ko scsi_transport_iscsi.ko
-
-configure.mk.kernel:
-       @echo Please run ./configure
-       @exit 1
-
-all: kernel
-
-install: install_kernel
-install_kernel: install_modules
-
-autoconf_h=$(shell /bin/ls -1 $(KSRC)/include/*/autoconf.h | head -1)
-kconfig_h=$(shell /bin/ls -1 $(KSRC)/include/*/kconfig.h | head -1)
-
-ifneq ($(kconfig_h),)
-KCONFIG_H = -include $(kconfig_h)
-endif
-
-V ?= 1
-
-#########################
-#      make kernel     #
-#########################
-#NB: The LINUXINCLUDE value comes from main kernel Makefile
-#    with local directories prepended. This eventually affects
-#    CPPFLAGS in the kernel Makefile
-kernel:
-       @echo "Building kernel modules"
-       @echo "Kernel version: $(KVERSION)"
-       @echo "Modules directory: $(INSTALL_MOD_PATH)/$(MODULES_DIR)"
-       @echo "Kernel sources: $(KSRC)"
-       env CWD=$(CWD) BACKPORT_INCLUDES=$(BACKPORT_INCLUDES) \
-               $(MAKE) -C $(KSRC) SUBDIRS="$(CWD)" \
-               V=$(V) KBUILD_NOCMDDEP=1 $(WITH_MAKE_PARAMS) \
-               CONFIG_MEMTRACK=$(CONFIG_MEMTRACK) \
-               CONFIG_DEBUG_INFO=$(CONFIG_DEBUG_INFO) \
-               CONFIG_INFINIBAND=$(CONFIG_INFINIBAND) \
-               CONFIG_INFINIBAND_IPOIB=$(CONFIG_INFINIBAND_IPOIB) \
-               CONFIG_INFINIBAND_IPOIB_CM=$(CONFIG_INFINIBAND_IPOIB_CM) \
-               CONFIG_INFINIBAND_SDP=$(CONFIG_INFINIBAND_SDP) \
-               CONFIG_INFINIBAND_SRP=$(CONFIG_INFINIBAND_SRP) \
-               CONFIG_INFINIBAND_SRPT=$(CONFIG_INFINIBAND_SRPT) \
-               CONFIG_INFINIBAND_USER_MAD=$(CONFIG_INFINIBAND_USER_MAD) \
-               CONFIG_INFINIBAND_USER_ACCESS=$(CONFIG_INFINIBAND_USER_ACCESS) \
-               CONFIG_INFINIBAND_USER_MEM=$(CONFIG_INFINIBAND_USER_MEM) \
-               CONFIG_INFINIBAND_ADDR_TRANS=$(CONFIG_INFINIBAND_ADDR_TRANS) \
-               CONFIG_INFINIBAND_MTHCA=$(CONFIG_INFINIBAND_MTHCA) \
-               CONFIG_INFINIBAND_IPOIB_DEBUG=$(CONFIG_INFINIBAND_IPOIB_DEBUG) \
-               CONFIG_INFINIBAND_ISER=$(CONFIG_INFINIBAND_ISER) \
-               CONFIG_SCSI_ISCSI_ATTRS=$(CONFIG_SCSI_ISCSI_ATTRS) \
-               CONFIG_ISCSI_TCP=$(CONFIG_ISCSI_TCP) \
-               CONFIG_INFINIBAND_EHCA=$(CONFIG_INFINIBAND_EHCA) \
-               CONFIG_INFINIBAND_EHCA_SCALING=$(CONFIG_INFINIBAND_EHCA_SCALING) \
-               CONFIG_RDS=$(CONFIG_RDS) \
-               CONFIG_RDS_RDMA=$(CONFIG_RDS_RDMA) \
-               CONFIG_RDS_TCP=$(CONFIG_RDS_TCP) \
-               CONFIG_RDS_DEBUG=$(CONFIG_RDS_DEBUG) \
-               CONFIG_INFINIBAND_IPOIB_DEBUG_DATA=$(CONFIG_INFINIBAND_IPOIB_DEBUG_DATA) \
-               CONFIG_INFINIBAND_SDP_SEND_ZCOPY=$(CONFIG_INFINIBAND_SDP_SEND_ZCOPY) \
-               CONFIG_INFINIBAND_SDP_RECV_ZCOPY=$(CONFIG_INFINIBAND_SDP_RECV_ZCOPY) \
-               CONFIG_INFINIBAND_SDP_DEBUG=$(CONFIG_INFINIBAND_SDP_DEBUG) \
-               CONFIG_INFINIBAND_SDP_DEBUG_DATA=$(CONFIG_INFINIBAND_SDP_DEBUG_DATA) \
-               CONFIG_INFINIBAND_IPATH=$(CONFIG_INFINIBAND_IPATH) \
-               CONFIG_INFINIBAND_QIB=$(CONFIG_INFINIBAND_QIB) \
-               CONFIG_INFINIBAND_MTHCA_DEBUG=$(CONFIG_INFINIBAND_MTHCA_DEBUG) \
-               CONFIG_INFINIBAND_MADEYE=$(CONFIG_INFINIBAND_MADEYE) \
-               CONFIG_INFINIBAND_QLGC_VNIC=$(CONFIG_INFINIBAND_QLGC_VNIC) \
-               CONFIG_INFINIBAND_QLGC_VNIC_DEBUG=$(CONFIG_INFINIBAND_QLGC_VNIC_DEBUG) \
-               CONFIG_INFINIBAND_QLGC_VNIC_STATS=$(CONFIG_INFINIBAND_QLGC_VNIC_STATS) \
-               CONFIG_CHELSIO_T3=$(CONFIG_CHELSIO_T3) \
-               CONFIG_INFINIBAND_CXGB3=$(CONFIG_INFINIBAND_CXGB3) \
-               CONFIG_INFINIBAND_CXGB3_DEBUG=$(CONFIG_INFINIBAND_CXGB3_DEBUG) \
-               CONFIG_CHELSIO_T4=$(CONFIG_CHELSIO_T4) \
-               CONFIG_INFINIBAND_CXGB4=$(CONFIG_INFINIBAND_CXGB4) \
-               CONFIG_INFINIBAND_NES=$(CONFIG_INFINIBAND_NES) \
-               CONFIG_INFINIBAND_NES_DEBUG=$(CONFIG_INFINIBAND_NES_DEBUG) \
-               CONFIG_MLX4_CORE=$(CONFIG_MLX4_CORE) \
-               CONFIG_MLX4_EN=$(CONFIG_MLX4_EN) \
-               CONFIG_MLX4_INFINIBAND=$(CONFIG_MLX4_INFINIBAND) \
-               CONFIG_MLX4_ETHERNET=$(CONFIG_MLX4_ETHERNET) \
-               CONFIG_MLX4_DEBUG=$(CONFIG_MLX4_DEBUG) \
-               CONFIG_INFINIBAND_AMSO1100=$(CONFIG_INFINIBAND_AMSO1100) \
-               CONFIG_SUNRPC_XPRT_RDMA=$(CONFIG_SUNRPC_XPRT_RDMA) \
-               CONFIG_NFSD_RDMA=$(CONFIG_NFSD_RDMA) \
-               LINUXINCLUDE=' \
-               -D__OFED_BUILD__ \
-               -include $(autoconf_h) \
-               -include $(CWD)/include/linux/autoconf.h \
-               $(KCONFIG_H) \
-               $(BACKPORT_INCLUDES) \
-               $(KERNEL_MEMTRACK_CFLAGS) \
-               $(KERNEL_NFS_FS_CFLAGS) \
-               $(OPENIB_KERNEL_EXTRA_CFLAGS) \
-               -I$(CWD)/include \
-               -I$(CWD)/drivers/infiniband/debug \
-               -I/usr/local/include/scst \
-               -I$(CWD)/drivers/infiniband/ulp/srpt \
-               $$(if $$(CONFIG_XEN),-D__XEN_INTERFACE_VERSION__=$$(CONFIG_XEN_INTERFACE_VERSION)) \
-               $$(if $$(CONFIG_XEN),-I$$(srctree)/arch/x86/include/mach-xen) \
-               -I$$(srctree)/arch/$$(hdr-arch)/include \
-               -Iinclude \
-               $$(if $$(KBUILD_SRC),-Iinclude2 -I$$(srctree)/include) \
-               -I$$(srctree)/arch/$$(SRCARCH)/include \
-               -Iarch/$$(SRCARCH)/include/generated \
-               ' \
-               modules
-
-
-#########################
-#      Install kernel  #
-#########################
-install_modules:
-       @echo "Installing kernel modules"
-
-       $(MAKE) -C $(KSRC) SUBDIRS="$(CWD)" \
-               INSTALL_MOD_PATH=$(INSTALL_MOD_PATH) \
-               INSTALL_MOD_DIR=$(INSTALL_MOD_DIR) \
-               $(WITH_MAKE_PARAMS) modules_install;
-       if [ ! -n "$(INSTALL_MOD_PATH)" ]; then $(DEPMOD) $(KVERSION);fi;
-
-clean: clean_kernel
-
-clean_kernel:
-       $(MAKE) -C $(KSRC) SUBDIRS="$(CWD)" $(WITH_MAKE_PARAMS) clean
-
-help:
-       @echo
-       @echo kernel:                   build kernel modules
-       @echo all:                      build kernel modules
-       @echo
-       @echo install_kernel:           install kernel modules under $(INSTALL_MOD_PATH)/$(MODULES_DIR)
-       @echo install:                  run install_kernel
-       @echo
-       @echo clean:                    delete kernel modules binaries
-       @echo clean_kernel:             delete kernel modules binaries
-       @echo
diff --git a/ofed_scripts/mlxnet b/ofed_scripts/mlxnet
deleted file mode 100755 (executable)
index 66a7f53..0000000
+++ /dev/null
@@ -1,211 +0,0 @@
-#!/bin/bash 
-
-#
-# Copyright (c) 2006 Mellanox Technologies. All rights reserved.
-#
-# This Software is licensed under one of the following licenses:
-#
-# 1) under the terms of the "Common Public License 1.0" a copy of which is
-#    available from the Open Source Initiative, see
-#    http://www.opensource.org/licenses/cpl.php.
-#
-# 2) under the terms of the "The BSD License" a copy of which is
-#    available from the Open Source Initiative, see
-#    http://www.opensource.org/licenses/bsd-license.php.
-#
-# 3) under the terms of the "GNU General Public License (GPL) Version 2" a
-#    copy of which is available from the Open Source Initiative, see
-#    http://www.opensource.org/licenses/gpl-license.php.
-#
-# Licensee has the right to choose one of the above licenses.
-#
-# Redistributions of source code must retain the above copyright
-# notice and one of the license notices.
-#
-# Redistributions in binary form must reproduce both the above copyright
-# notice, one of the license notices in the documentation
-# and/or other materials provided with the distribution.
-#
-#
-
-CONFIG="/etc/mlxethernet/mlxnet.conf"
-if [ ! -f $CONFIG ]; then
-    echo No Ethernet configuration found
-    exit 0
-fi
-
-. $CONFIG
-
-
-ACTION=$1
-shift
-
-# Check if OpenIB configured to start automatically
-if [ "X${ONBOOT}" != "Xyes" ]; then
-    exit 0
-fi
-
-# If module $1 has refcnt return 1 otherwise, return 0
-is_ref()
-{
-    local RC
-    cat /sys/module/"$1"/refcnt | grep -w 0  > /dev/null 2>&1
-    RC=$?
-    if [ "${RC}" -eq "1" ]; then
-       echo "$1" has references
-       RC=1
-    else
-       RC=0
-    fi 
-    return $RC    
-}
-
-# If module $1 is loaded return - 0 else - 1
-is_module()
-{
-local RC
-
-    /sbin/lsmod | grep -w "$1" > /dev/null 2>&1
-    RC=$?
-    
-return $RC        
-}
-
-set_irq_affinity()
-{
-# Set the Intterupts affinity in Rx side
-irqs="`cat /proc/interrupts | grep mlx4 | grep comp | cut -d':' -f1 `"
-cores="`cat /proc/cpuinfo | grep processor -wc`"
-
-EQ=-1 
-core=-1
-for irq in $irqs; do
-       vec=`echo $irq | cut -d':' -f1`
-       EQ=$(($EQ+1))
-       core=$(($core+1))
-       if [ "$core" == "$cores" ]; then
-           core=0
-       fi
-       mask=`echo $core | awk '{printf("%x", lshift(1,$1))}'`
-       echo $mask > /proc/irq/$vec/smp_affinity
-       after_vec_hex=`cat /proc/irq/$vec/smp_affinity | tail -c3 | sed -e 's:^0[bBxX]::' | tr '[a-f]' '[A-F]'`
-       after_vec=`echo ""$after_vec_hex" 10 o p" | dc`
-       if [ "$mask" != "$after_vec" ]; then
-           set_affinity="Warn"
-       fi
-done
-}
-
-handle_irqdaemon()
-{
-for irqb in /etc/init.d/irq* ; do
-    break
-done
-if [ "$set_affinity" == "Warn" ]; then
-    #We could not change the intterupt manually
-    #lets hope that at least the irq daemon is runinng
-    if $irqb status 1 >/dev/null 2>&1; then
-       echo "Deamon running" > /dev/null
-    else 
-       $irqb start 1 >/dev/null 2>&1 
-       #lets check if it is running now
-       if $irqb status 1 >/dev/null 2>&1; then
-           echo "Deamon running" > /dev/null
-       else
-           logger "mlx4_core: irq balancer daemon not running and interrupt affinity can't be set."
-       fi
-    fi
-fi
-}
-
-start()
-{
-    local RC=0
-    local cnt=0
-    /sbin/modprobe mlx4_core > /dev/null 2>&1
-    my_rc=$?
-    if [ $my_rc -ne 0 ]; then
-       echo "Loading Mellanox mlx4_core HCA driver: [FAIL]"
-       exit 1 
-    else
-       echo "Loading Mellanox mlx4_core HCA driver: [SUCCESS]"
-    fi
-
-    # Config the intterupt affinity
-    set_irq_affinity
-    # Check and turn on the irq balancer if needed
-    handle_irqdaemon
-
-    /sbin/modprobe mlx4_en > /dev/null 2>&1
-    my_rc=$?
-    if [ $my_rc -ne 0 ]; then
-       echo "Loading Mellanox mlx4_en driver: [FAIL]"
-       exit 1 
-    else
-       echo "Loading Mellanox mlx4_en driver: [SUCCESS]"
-       sleep 2
-        for eth_dev in /sys/class/net/eth*/device/vendor
-       do
-           if [ `cat $eth_dev` == "0x15b3" ]; then 
-               cnt=1
-           fi
-       done
-       if [ $cnt == 0 ]; then
-           echo "WARNING: No Ethernet interfaces found, please check configuration"
-       fi
-    fi
-
-    if [ -x ${LOAD_INTF} ]; then
-       $LOAD_INTF
-    fi
-}
-
-stop()
-{
-    local RC
-    echo "Unloading Mellanox mlx4_en driver"
-    if is_module mlx4_en; then
-       /sbin/rmmod mlx4_en > /dev/null 2>&1
-       RC=$?
-       if [ "$RC" -ne "0" ]; then
-           echo Could not unload Ethernet driver
-           exit 1
-       fi
-    else
-       echo Ethernet driver is not loaded
-    fi
-    if is_module mlx4_core; then
-       is_ref mlx4_core
-       RC=$?
-       if [ "$RC" -ne "1" ]; then
-           /sbin/rmmod mlx4_core > /dev/null 2>&1
-       fi
-    else
-       echo Core driver is not loaded
-    fi
-}
-
-case $ACTION in
-        start)
-                start
-                ;;
-        stop)
-                stop    
-                ;;
-        restart)
-                stop
-                start
-                ;;
-        *)
-                echo 
-                echo "Usage: `basename $0` {start|stop|restart}"
-                echo
-                exit 1
-                ;;
-esac
-
-RC=$?
-exit $RC
-
-
-
diff --git a/ofed_scripts/mlxnet.conf b/ofed_scripts/mlxnet.conf
deleted file mode 100644 (file)
index 3f2a199..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-# Start HCA Eth driver upon boot
-ONBOOT=yes
-
diff --git a/ofed_scripts/ofa_kernel.spec b/ofed_scripts/ofa_kernel.spec
deleted file mode 100755 (executable)
index 4a4dd38..0000000
+++ /dev/null
@@ -1,674 +0,0 @@
-#
-# Copyright (c) 2012 Mellanox Technologies. All rights reserved.
-#
-# This Software is licensed under one of the following licenses:
-#
-# 1) under the terms of the "Common Public License 1.0" a copy of which is
-#    available from the Open Source Initiative, see
-#    http://www.opensource.org/licenses/cpl.php.
-#
-# 2) under the terms of the "The BSD License" a copy of which is
-#    available from the Open Source Initiative, see
-#    http://www.opensource.org/licenses/bsd-license.php.
-#
-# 3) under the terms of the "GNU General Public License (GPL) Version 2" a
-#    copy of which is available from the Open Source Initiative, see
-#    http://www.opensource.org/licenses/gpl-license.php.
-#
-# Licensee has the right to choose one of the above licenses.
-#
-# Redistributions of source code must retain the above copyright
-# notice and one of the license notices.
-#
-# Redistributions in binary form must reproduce both the above copyright
-# notice, one of the license notices in the documentation
-# and/or other materials provided with the distribution.
-#
-#
-
-%{!?configure_options: %define configure_options %{nil}}
-
-# %{!?MEMTRACK: %define MEMTRACK 0}
-%define MEMTRACK %(if ( echo %{configure_options} | grep "with-memtrack" > /dev/null ); then echo -n '1'; else echo -n '0'; fi)
-%define MADEYE %(if ( echo %{configure_options} | grep "with-madeye-mod" > /dev/null ); then echo -n '1'; else echo -n '0'; fi)
-
-%{!?KVERSION: %define KVERSION %(uname -r)}
-%define krelver %(echo -n %{KVERSION} | sed -e 's/-/_/g')
-
-%{!?build_kernel_ib: %define build_kernel_ib 0}
-%{!?build_kernel_ib_devel: %define build_kernel_ib_devel 0}
-
-# Select packages to build
-%{!?modprobe_update: %define modprobe_update %(if ( echo %{configure_options} | grep "without-modprobe" > /dev/null ); then echo -n '0'; else echo -n '1'; fi)}
-
-# Kernel module packages to be included into kernel-ib
-%define build_mthca %(if ( echo %{configure_options} | grep "with-mthca-mod" > /dev/null ); then echo -n '1'; else echo -n '0'; fi)
-%define build_qib %(if ( echo %{configure_options} | grep "with-qib-mod" > /dev/null ); then echo -n '1'; else echo -n '0'; fi)
-%define build_ipath %(if ( echo %{configure_options} | grep "with-ipath_inf-mod" > /dev/null ); then echo -n '1'; else echo -n '0'; fi)
-%define build_ehca %(if ( echo %{configure_options} | grep "with-ehca-mod" > /dev/null ); then echo -n '1'; else echo -n '0'; fi)
-%define build_ipoib %(if ( echo %{configure_options} | grep "with-ipoib-mod" > /dev/null ); then echo -n '1'; else echo -n '0'; fi)
-%define build_sdp %(if ( echo %{configure_options} | grep "with-sdp-mod" > /dev/null ); then echo -n '1'; else echo -n '0'; fi)
-%define build_srp %(if ( echo %{configure_options} | grep "with-srp-mod" > /dev/null ); then echo -n '1'; else echo -n '0'; fi)
-%define build_srpt %(if ( echo %{configure_options} | grep "with-srp-target-mod" > /dev/null ); then echo -n '1'; else echo -n '0'; fi)
-%define build_iser %(if ( echo %{configure_options} | grep "with-iser-mod" > /dev/null ); then echo -n '1'; else echo -n '0'; fi)
-%define build_oiscsi %(if ( echo %{configure_options} | grep "with-iscsi-mod" > /dev/null ); then echo -n '1'; else echo -n '0'; fi)
-%define build_rds %(if ( echo %{configure_options} | grep "with-rds-mod" > /dev/null ); then echo -n '1'; else echo -n '0'; fi)
-%define build_cxgb3 %(if ( echo %{configure_options} | grep "with-cxgb3-mod" > /dev/null ); then echo -n '1'; else echo -n '0'; fi)
-%define build_cxgb4 %(if ( echo %{configure_options} | grep "with-cxgb4-mod" > /dev/null ); then echo -n '1'; else echo -n '0'; fi)
-%define build_nes %(if ( echo %{configure_options} | grep "with-nes-mod" > /dev/null ); then echo -n '1'; else echo -n '0'; fi)
-%define build_mlx4 %(if ( echo %{configure_options} | grep "with-mlx4-mod" > /dev/null ); then echo -n '1'; else echo -n '0'; fi)
-%define build_mlx4_en %(if ( echo %{configure_options} | grep "with-mlx4_en-mod" > /dev/null ); then echo -n '1'; else echo -n '0'; fi)
-%define build_qlgc_vnic %(if ( echo %{configure_options} | grep "with-qlgc_vnic-mod" > /dev/null ); then echo -n '1'; else echo -n '0'; fi)
-%define build_nfsrdma %(if ( echo %{configure_options} | grep "with-nfsrdma-mod" > /dev/null ); then echo -n '1'; else echo -n '0'; fi)
-
-%{!?LIB_MOD_DIR: %define LIB_MOD_DIR /lib/modules/%{KVERSION}/updates}
-
-%{!?IB_CONF_DIR: %define IB_CONF_DIR /etc/infiniband}
-%{!?MLXNET_CONF_DIR: %define MLXNET_CONF_DIR /etc/mlxethernet}
-
-%{!?K_SRC: %define K_SRC /lib/modules/%{KVERSION}/build}
-
-%{!?KERNEL_SOURCES: %define KERNEL_SOURCES /lib/modules/%{KVERSION}/source}
-
-# Do not include srp.h if it exist in the kernel
-%define include_srp_h %(if [ -e %{KERNEL_SOURCES}/include/scsi/srp.h ]; then echo -n 0; else echo -n 1; fi )
-%define include_rdma %(if [ -d %{KERNEL_SOURCES}/include/rdma ]; then echo -n 1; else echo -n 0; fi )
-
-%define include_udev_rules %(eval `grep udev_rules /etc/udev/udev.conf | grep -v '^#'` ; if test -d $udev_rules; then echo -n 1; else echo -n 0; fi)
-
-# Disable debugging
-%define debug_package %{nil}
-%define __check_files %{nil}
-
-# Disable brp-lib64-linux
-%ifarch x86_64 ia64
-%define __arch_install_post %{nil}
-%endif
-
-%{!?_name: %define _name ofa_kernel}
-%{!?_version: %define _version @VERSION@}
-%{!?_release: %define _release @RELEASE@}
-
-Summary: Infiniband HCA Driver
-Name: %{_name}
-Version: %{_version}
-Release: %{_release}
-License: GPL/BSD
-Url: http://openib.org/
-Group: System Environment/Base
-Source: %{_name}-%{_version}.tgz
-BuildRoot: %{?build_root:%{build_root}}%{!?build_root:/var/tmp/OFED}
-Vendor: OpenFabrics
-%description 
-InfiniBand "verbs", Access Layer  and ULPs
-
-BuildRequires: sysfsutils-devel
-
-%package -n kernel-ib
-Requires: coreutils
-Requires: kernel
-Requires: pciutils
-Requires: grep
-Requires: perl
-Requires: procps
-Requires: module-init-tools
-Version: %{_version}
-Release: %{krelver}
-Summary: Infiniband Driver and ULPs kernel modules
-Group: System Environment/Libraries
-%description -n kernel-ib
-Core, HW and ULPs kernel modules
-
-%package -n kernel-ib-devel
-Requires: coreutils
-Requires: kernel
-Requires: pciutils
-Requires: kernel-ib
-Version: %{_version}
-Release: %{krelver}
-Summary: Infiniband Driver and ULPs kernel modules sources
-Group: System Environment/Libraries
-%description -n kernel-ib-devel
-Core, HW and ULPs kernel modules sources
-
-#################################################################################################################################
-
-%prep
-%setup -n %{_name}-%{_version}
-
-###
-### build
-###
-%build
-rm -rf $RPM_BUILD_ROOT
-cd $RPM_BUILD_DIR/%{_name}-%{_version}
-
-%if %{build_kernel_ib_devel}
-# Save clean sources for kernel-ib-devel
-mkdir -p $RPM_BUILD_DIR/src
-cp -a $RPM_BUILD_DIR/%{_name}-%{_version} $RPM_BUILD_DIR/src/
-%endif
-
-./configure --prefix=%{_prefix} --kernel-version %{KVERSION} --kernel-sources %{K_SRC} --modules-dir %{LIB_MOD_DIR} %{configure_options}
-
-%if %{build_kernel_ib_devel}
-# Copy InfniBand include files after applying backport patches (if required)
-mkdir -p $RPM_BUILD_DIR/src/%{_name}
-cp -a $RPM_BUILD_DIR/%{_name}-%{_version}/include/ $RPM_BUILD_DIR/src/%{_name}
-cp -a $RPM_BUILD_DIR/%{_name}-%{_version}/kernel_addons/ $RPM_BUILD_DIR/src/%{_name}
-cp -a $RPM_BUILD_DIR/%{_name}-%{_version}/configure.mk.kernel $RPM_BUILD_DIR/src/%{_name}
-cp -a $RPM_BUILD_DIR/%{_name}-%{_version}/config.mk  $RPM_BUILD_DIR/src/%{_name}
-sed -i -e "s@\${CWD}@%{_prefix}/src/%{_name}@g" $RPM_BUILD_DIR/src/%{_name}/config.mk
-%endif
-
-%if %{build_kernel_ib}
-%if %{build_srpt}
-if [ -f /usr/local/include/scst/Module.symvers ]; then
-       cat /usr/local/include/scst/Module.symvers >> ./Module.symvers
-fi
-%endif
-export INSTALL_MOD_DIR=updates
-make kernel
-%endif
-
-###
-### install
-###
-%install
-%if %{build_kernel_ib_devel}
-mkdir -p $RPM_BUILD_ROOT/%{_prefix}/src
-cp -a $RPM_BUILD_DIR/src/%{_name}-%{_version} $RPM_BUILD_ROOT/%{_prefix}/src
-cp -a $RPM_BUILD_DIR/src/%{_name} $RPM_BUILD_ROOT/%{_prefix}/src
-rm -rf $RPM_BUILD_DIR/src
-
-# Support external modules include dir for backward compatibility
-cd $RPM_BUILD_ROOT/%{_prefix}/src/
-ln -s %{_name} openib
-cd -
-%endif
-
-%if %{build_kernel_ib}
-make install_kernel MODULES_DIR=%{LIB_MOD_DIR} INSTALL_MOD_PATH=$RPM_BUILD_ROOT INSTALL_MOD_DIR=updates KERNELRELEASE=%{KVERSION}
-%endif
-
-%if %{build_kernel_ib_devel}
-modsyms=`find $RPM_BUILD_DIR/%{_name}-%{_version} -name Module.symvers -o -name Modules.symvers`
-if [ -n "$modsyms" ]; then
-       for modsym in $modsyms
-       do
-               cat $modsym >> $RPM_BUILD_ROOT/%{_prefix}/src/%{_name}/Module.symvers
-       done
-else
-       ./ofed_scripts/create_Module.symvers.sh
-       cp ./Module.symvers $RPM_BUILD_ROOT/%{_prefix}/src/%{_name}/Module.symvers
-fi
-%endif
-       
-INFO=${RPM_BUILD_ROOT}%{IB_CONF_DIR}/info
-/bin/rm -f ${INFO}
-mkdir -p ${RPM_BUILD_ROOT}%{IB_CONF_DIR}
-touch ${INFO}
-
-cat >> ${INFO} << EOFINFO
-#!/bin/bash
-
-echo prefix=%{_prefix}
-echo Kernel=%{KVERSION}
-echo
-echo "Configure options: %{configure_options}"
-echo
-EOFINFO
-
-chmod +x ${INFO} > /dev/null 2>&1
-
-# Copy infiniband configuration
-install -d $RPM_BUILD_ROOT/%{IB_CONF_DIR}
-install -m 0644 $RPM_BUILD_DIR/%{_name}-%{_version}/ofed_scripts/openib.conf $RPM_BUILD_ROOT/%{IB_CONF_DIR}
-
-# Install openib service script
-install -d $RPM_BUILD_ROOT/etc/init.d
-install -m 0755 $RPM_BUILD_DIR/%{_name}-%{_version}/ofed_scripts/openibd $RPM_BUILD_ROOT/etc/init.d
-install -d $RPM_BUILD_ROOT/sbin
-install -m 0755 $RPM_BUILD_DIR/%{_name}-%{_version}/ofed_scripts/sysctl_perf_tuning $RPM_BUILD_ROOT/sbin
-
-%if %{build_mlx4}
-install -d $RPM_BUILD_ROOT/%{_bindir}
-install -m 0755 $RPM_BUILD_DIR/%{_name}-%{_version}/ofed_scripts/ibdev2netdev $RPM_BUILD_ROOT/%{_bindir}
-%endif
-
-%if %{build_mlx4_en}
-install -d $RPM_BUILD_ROOT/sbin
-install -m 0755 $RPM_BUILD_DIR/%{_name}-%{_version}/ofed_scripts/connectx_port_config $RPM_BUILD_ROOT/sbin
-install -d $RPM_BUILD_ROOT/etc/modprobe.d
-install -m 0644 $RPM_BUILD_DIR/%{_name}-%{_version}/ofed_scripts/mlx4_en.conf $RPM_BUILD_ROOT/etc/modprobe.d
-touch $RPM_BUILD_ROOT/%{IB_CONF_DIR}/connectx.conf
-%endif
-
-%if %{build_qib}
-install -m 0644 $RPM_BUILD_DIR/%{_name}-%{_version}/ofed_scripts/truescale.cmds $RPM_BUILD_ROOT/%{IB_CONF_DIR}
-%endif
-
-%if %{build_ipoib}
-%if %{modprobe_update}
-install -d $RPM_BUILD_ROOT/etc/modprobe.d
-install -m 0644 $RPM_BUILD_DIR/%{_name}-%{_version}/ofed_scripts/ib_ipoib.conf $RPM_BUILD_ROOT/etc/modprobe.d
-%endif
-%endif
-
-%if %{build_sdp}
-%if %{modprobe_update}
-install -d $RPM_BUILD_ROOT/etc/modprobe.d
-install -m 0644 $RPM_BUILD_DIR/%{_name}-%{_version}/ofed_scripts/ib_sdp.conf $RPM_BUILD_ROOT/etc/modprobe.d
-%endif
-%endif
-
-%if %{include_udev_rules}
-install -d $RPM_BUILD_ROOT/etc/udev/rules.d
-install -m 0644 $RPM_BUILD_DIR/%{_name}-%{_version}/ofed_scripts/90-ib.rules $RPM_BUILD_ROOT/etc/udev/rules.d
-case "$(udevinfo -V 2> /dev/null | awk '{print $NF}' 2> /dev/null)" in
-0[1-4]*)
-sed -i -e 's/KERNEL==/KERNEL=/g'  $RPM_BUILD_ROOT/etc/udev/rules.d/90-ib.rules
-;;
-esac
-%endif
-       
-%clean
-#Remove installed driver after rpm build finished
-rm -rf $RPM_BUILD_ROOT
-rm -rf $RPM_BUILD_DIR/%{_name}-%{_version}
-
-###
-### pre section
-###
-
-%pre -n kernel-ib
-
-%pre -n kernel-ib-devel
-
-###
-### post section
-###
-
-%post -n kernel-ib
-if [ $1 -ge 1 ]; then # 1 : This package is being installed or reinstalled
-count_ib_ports()
-{
-    local cnt=0
-    local tmp_cnt=0
-    
-    tmp_cnt=$(/sbin/lspci -n | grep "15b3:6282" | wc -l | tr -d '[:space:]') # Arbel mode
-    cnt=$[ $cnt + 2*${tmp_cnt} ]
-    
-    tmp_cnt=$(/sbin/lspci -n | grep -E "15b3:5e8c|15b3:6274" | wc -l | tr -d '[:space:]') # Sinai
-    cnt=$[ $cnt + ${tmp_cnt} ]
-
-    tmp_cnt=$(/sbin/lspci -n | grep -E "15b3:5a44|15b3:6278" | wc -l | tr -d '[:space:]') # Tavor mode
-    cnt=$[ $cnt + 2*${tmp_cnt} ]
-
-    tmp_cnt=$(/sbin/lspci -n | grep -E "1fc1:|1077:7220" | wc -l | tr -d '[:space:]') # QLogic SDR and DDR HCA
-    cnt=$[ $cnt + ${tmp_cnt} ]
-    
-    tmp_cnt=$(/sbin/lspci -n | grep -E "1077:7322" | wc -l | tr -d '[:space:]') # QLogic QDR HCA
-    cnt=$[ $cnt + 2*${tmp_cnt} ]
-    return $cnt
-}
-
-count_ib_ports
-ports_num=$?
-
-# Set default number of ports to 2 if no HCAs found
-if [ $ports_num -eq 0 ]; then
-    ports_num=2
-fi    
-#############################################################################################################
-#                                       Modules configuration                                               #
-#############################################################################################################
-
-%if ! %{include_udev_rules}
-    if [ -e /etc/udev/udev.rules ]; then
-        perl -ni -e 'if (/\# Infiniband devices \#$/) { $filter = 1 }' -e 'if (!$filter) { print }' -e 'if (/\# End Infiniband devices \#$/){ $filter = 0 }' /etc/udev/udev.rules
-        cat >> /etc/udev/udev.rules << EOF
-# Infiniband devices #
-KERNEL="umad*", NAME="infiniband/%k"
-KERNEL="issm*", NAME="infiniband/%k"
-KERNEL="ucm*", NAME="infiniband/%k", MODE="0666"
-KERNEL="uverbs*", NAME="infiniband/%k", MODE="0666"
-KERNEL="uat", NAME="infiniband/%k", MODE="0666"
-KERNEL="ucma", NAME="infiniband/%k", MODE="0666"
-KERNEL="rdma_cm", NAME="infiniband/%k", MODE="0666"
-# End Infiniband devices #
-EOF
-    fi
-%endif
-
-%if %{modprobe_update}
-%if %{build_ipoib}
-for (( i=0 ; i < $ports_num ; i++ ))
-do
-cat >> /etc/modprobe.d/ib_ipoib.conf << EOF
-alias ib${i} ib_ipoib
-EOF
-done
-%endif
-%endif
-
-    /sbin/depmod %{KVERSION}
-
-#############################################################################################################
-
-
-if [[ -f /etc/redhat-release || -f /etc/rocks-release ]]; then        
-perl -i -ne 'if (m@^#!/bin/bash@) {
-        print q@#!/bin/bash
-#
-# Bring up/down openib
-#
-# chkconfig: 2345 05 95
-# description: Activates/Deactivates InfiniBand Driver to \
-#              start at boot time.
-#
-### BEGIN INIT INFO
-# Provides:       openibd
-### END INIT INFO
-@;
-                 } else {
-                     print;
-                 }' /etc/init.d/openibd
-
-        if ! ( /sbin/chkconfig --del openibd > /dev/null 2>&1 ); then
-                true
-        fi
-        if ! ( /sbin/chkconfig --add openibd > /dev/null 2>&1 ); then
-                true
-        fi
-fi
-
-if [ -f /etc/SuSE-release ]; then
-    local_fs='$local_fs'
-    openiscsi=''
-    %if %{build_oiscsi}
-        openiscsi='open-iscsi'
-    %endif
-        perl -i -ne "if (m@^#!/bin/bash@) {
-        print q@#!/bin/bash
-### BEGIN INIT INFO
-# Provides:       openibd
-# Required-Start: $local_fs
-# Required-Stop: opensmd $openiscsi
-# Default-Start:  2 3 5
-# Default-Stop: 0 1 2 6
-# Description:    Activates/Deactivates InfiniBand Driver to \
-#                 start at boot time.
-### END INIT INFO
-@;
-                 } else {
-                     print;
-                 }" /etc/init.d/openibd
-
-        if ! ( /sbin/insserv openibd > /dev/null 2>&1 ); then
-                true
-        fi
-fi
-
-if [ -f /etc/debian_version ]; then
-    local_fs='$local_fs'
-    openiscsi=''
-    %if %{build_oiscsi}
-        openiscsi='open-iscsi'
-    %endif
-        perl -i -ne "if (m@^#!/bin/bash@) {
-        print q@#!/bin/bash
-### BEGIN INIT INFO
-# Provides:       openibd
-# Required-Start: $local_fs
-# Required-Stop: opensmd $openiscsi
-# Default-Start:  2 3 5
-# Default-Stop: 0 1 2 6
-# Description:    Activates/Deactivates InfiniBand Driver to \
-#                 start at boot time.
-### END INIT INFO
-@;
-                 } else {
-                     print;
-                 }" /etc/init.d/openibd
-
-        if ! ( /usr/sbin/update-rc.d openibd defaults > /dev/null 2>&1 ); then
-                true
-        fi
-fi
-
-%if %{build_kernel_ib}
-    echo >> %{IB_CONF_DIR}/openib.conf
-    echo "# Load UCM module" >> %{IB_CONF_DIR}/openib.conf
-    echo "UCM_LOAD=no" >> %{IB_CONF_DIR}/openib.conf
-    echo >> %{IB_CONF_DIR}/openib.conf
-    echo "# Load RDMA_CM module" >> %{IB_CONF_DIR}/openib.conf
-    echo "RDMA_CM_LOAD=yes" >> %{IB_CONF_DIR}/openib.conf
-    echo >> %{IB_CONF_DIR}/openib.conf
-    echo "# Load RDMA_UCM module" >> %{IB_CONF_DIR}/openib.conf
-    echo "RDMA_UCM_LOAD=yes" >> %{IB_CONF_DIR}/openib.conf
-    echo >> %{IB_CONF_DIR}/openib.conf
-    echo "# Increase ib_mad thread priority" >> %{IB_CONF_DIR}/openib.conf
-    echo "RENICE_IB_MAD=no" >> %{IB_CONF_DIR}/openib.conf
-    echo >> %{IB_CONF_DIR}/openib.conf
-    echo "# Run sysctl performance tuning script" >> %{IB_CONF_DIR}/openib.conf
-    echo "RUN_SYSCTL=yes" >> %{IB_CONF_DIR}/openib.conf
-%endif
-
-%if %{build_mthca}
-       echo >> %{IB_CONF_DIR}/openib.conf                                                
-       echo "# Load MTHCA" >> %{IB_CONF_DIR}/openib.conf
-       echo "MTHCA_LOAD=yes" >> %{IB_CONF_DIR}/openib.conf
-%endif
-
-%if %{build_qib}
-       echo >> %{IB_CONF_DIR}/openib.conf
-       echo "# Load QIB" >> %{IB_CONF_DIR}/openib.conf
-       echo "QIB_LOAD=yes" >> %{IB_CONF_DIR}/openib.conf
-%endif
-
-%if %{build_ipath}
-       echo >> %{IB_CONF_DIR}/openib.conf                                                
-       echo "# Load IPATH" >> %{IB_CONF_DIR}/openib.conf
-       echo "IPATH_LOAD=yes" >> %{IB_CONF_DIR}/openib.conf
-%endif
-
-%if %{build_ehca}
-       echo >> %{IB_CONF_DIR}/openib.conf                                                
-       echo "# Load eHCA" >> %{IB_CONF_DIR}/openib.conf
-       echo "EHCA_LOAD=yes" >> %{IB_CONF_DIR}/openib.conf
-%endif
-
-%if %{build_mlx4}
-       echo >> %{IB_CONF_DIR}/openib.conf
-       echo "# Load MLX4 modules" >> %{IB_CONF_DIR}/openib.conf
-       echo "MLX4_LOAD=yes" >> %{IB_CONF_DIR}/openib.conf
-%endif
-
-%if %{build_mlx4_en}
-       echo >> %{IB_CONF_DIR}/openib.conf
-       echo "# Load MLX4_EN module" >> %{IB_CONF_DIR}/openib.conf
-       echo "MLX4_EN_LOAD=yes" >> %{IB_CONF_DIR}/openib.conf
-%endif
-
-%if %{build_cxgb3}
-       echo >> %{IB_CONF_DIR}/openib.conf                                                
-       echo "# Load CXGB3 modules" >> %{IB_CONF_DIR}/openib.conf
-       echo "CXGB3_LOAD=yes" >> %{IB_CONF_DIR}/openib.conf
-%endif
-
-%if %{build_cxgb4}
-       echo >> %{IB_CONF_DIR}/openib.conf
-       echo "# Load CXGB4 modules" >> %{IB_CONF_DIR}/openib.conf
-       echo "CXGB4_LOAD=yes" >> %{IB_CONF_DIR}/openib.conf
-%endif
-
-%if %{build_nes}
-       echo >> %{IB_CONF_DIR}/openib.conf                                                
-       echo "# Load NES modules" >> %{IB_CONF_DIR}/openib.conf
-       echo "NES_LOAD=yes" >> %{IB_CONF_DIR}/openib.conf
-%endif
-
-%if %{build_ipoib}
-       echo >> %{IB_CONF_DIR}/openib.conf                                                
-       echo "# Load IPoIB" >> %{IB_CONF_DIR}/openib.conf
-       echo "IPOIB_LOAD=yes" >> %{IB_CONF_DIR}/openib.conf
-       echo >> %{IB_CONF_DIR}/openib.conf                                                
-       echo "# Enable IPoIB Connected Mode" >> %{IB_CONF_DIR}/openib.conf
-       echo "SET_IPOIB_CM=yes" >> %{IB_CONF_DIR}/openib.conf
-%endif
-
-%if %{build_sdp}
-       echo >> %{IB_CONF_DIR}/openib.conf                                                
-       echo "# Load SDP module" >> %{IB_CONF_DIR}/openib.conf
-       echo "SDP_LOAD=yes" >> %{IB_CONF_DIR}/openib.conf
-%endif
-
-%if %{build_srp}
-       echo >> %{IB_CONF_DIR}/openib.conf                                                
-       echo "# Load SRP module" >> %{IB_CONF_DIR}/openib.conf
-       echo "SRP_LOAD=no" >> %{IB_CONF_DIR}/openib.conf
-%endif
-
-%if %{build_srpt}
-       echo >> %{IB_CONF_DIR}/openib.conf                                                
-       echo "# Load SRP Target module" >> %{IB_CONF_DIR}/openib.conf
-       echo "SRPT_LOAD=no" >> %{IB_CONF_DIR}/openib.conf
-%endif
-
-%if %{build_iser}
-       echo >> %{IB_CONF_DIR}/openib.conf                                                
-       echo "# Load ISER module" >> %{IB_CONF_DIR}/openib.conf
-       echo "ISER_LOAD=no" >> %{IB_CONF_DIR}/openib.conf
-%endif
-
-%if %{build_rds}
-       echo >> %{IB_CONF_DIR}/openib.conf                                                
-       echo "# Load RDS module" >> %{IB_CONF_DIR}/openib.conf
-       echo "RDS_LOAD=no" >> %{IB_CONF_DIR}/openib.conf
-%endif
-
-%if %{build_qlgc_vnic}
-       echo >> %{IB_CONF_DIR}/openib.conf
-       echo "# Load QLogic VNIC module" >> %{IB_CONF_DIR}/openib.conf
-       echo "QLGC_VNIC_LOAD=yes" >> %{IB_CONF_DIR}/openib.conf
-%endif
-
-fi # 1 : closed
-# END of post -n kernel-ib
-
-%post -n kernel-ib-devel
-
-###
-### preun section
-###
-
-%preun -n kernel-ib
-if [ $1 = 0 ]; then  # 1 : Erase, not upgrade
-          if [[ -f /etc/redhat-release || -f /etc/rocks-release ]]; then        
-                if ! ( /sbin/chkconfig --del openibd  > /dev/null 2>&1 ); then
-                        true
-                fi
-          fi
-          if [ -f /etc/SuSE-release ]; then
-                if ! ( /sbin/insserv -r openibd > /dev/null 2>&1 ); then
-                        true
-                fi
-          fi
-          if [ -f /etc/debian_version ]; then
-                if ! ( /usr/sbin/update-rc.d openibd remove > /dev/null 2>&1 ); then
-                        true
-                fi
-          fi
-fi
-
-###
-### post uninstall section
-###
-%postun -n kernel-ib
-if [ $1 = 0 ]; then  # 1 : Erase, not upgrade
-        # Clean /etc/modprobe.d/ofed.conf   
-        # Remove previous configuration if exist
-        /sbin/depmod %{KVERSION}
-
-# Clean udev.rules
-%if ! %{include_udev_rules}
-    if [ -e /etc/udev/udev.rules ]; then
-        perl -ni -e 'if (/\# Infiniband devices \#$/) { $filter = 1 }' -e 'if (!$filter) { print }' -e 'if (/\# End Infiniband devices \#$/){ $filter = 0 }' /etc/udev/udev.rules
-    fi
-%endif
-
-# Clean sysctl.conf
-if [ -f /etc/sysctl.conf ]; then
-perl -ni -e 'if (/\#\# OFED Network tuning parameters \#\#$/) { $filter = 1 }' -e 'if (!$filter) { print }' -e 'if (/\#\# END of OFED parameters \#\#$/){ $filter = 0 }' /etc/sysctl.conf
-fi
-
-fi
-
-%postun -n kernel-ib-devel
-
-###
-### Files
-###
-%if %{build_kernel_ib}
-%files -n kernel-ib
-%defattr(-,root,root,-)
-%dir %{IB_CONF_DIR}
-%config(noreplace) %{IB_CONF_DIR}/openib.conf
-%{IB_CONF_DIR}/info
-/etc/init.d/openibd
-/sbin/sysctl_perf_tuning
-%if %{include_udev_rules}
-/etc/udev/rules.d/90-ib.rules
-%endif
-%{LIB_MOD_DIR}
-%if %{build_qib}
-%config(noreplace) %{IB_CONF_DIR}/truescale.cmds
-%endif
-%if %{build_ipoib}
-%if %{modprobe_update}
-/etc/modprobe.d/ib_ipoib.conf
-%endif
-%endif
-%if %{build_sdp}
-%if %{modprobe_update}
-/etc/modprobe.d/ib_sdp.conf
-%endif
-%endif
-%if %{build_mlx4}
-%{_bindir}/ibdev2netdev
-%endif
-%if %{build_mlx4_en}
-/sbin/connectx_port_config
-/etc/modprobe.d/mlx4_en.conf
-%config(noreplace) %{IB_CONF_DIR}/connectx.conf
-%endif
-
-%endif
-
-%if %{build_kernel_ib_devel}
-%files -n kernel-ib-devel
-%defattr(-,root,root,-)
-%dir %{_prefix}/src
-%{_prefix}/src/%{_name}-%{_version}
-%{_prefix}/src/%{_name}
-%{_prefix}/src/openib
-%endif
-
-# END Files
-
-%changelog
-* Tue Aug 9 2011 Vladimir Sokolovsky <vlad@mellanox.co.il>
-- Simplify spec
-* Mon May 10 2010 Vladimir Sokolovsky <vlad@mellanox.co.il>
-- Support install macro that removes RPM_BUILD_ROOT
-* Thu Feb 4 2010 Vladimir Sokolovsky <vlad@mellanox.co.il>
-- Added ibdev2netdev script
-* Wed Sep 8 2008 Vladimir Sokolovsky <vlad@mellanox.co.il>
-- Added nfsrdma support
-* Wed Aug 13 2008 Vladimir Sokolovsky <vlad@mellanox.co.il>
-- Added mlx4_en support
-* Tue Aug 21 2007 Vladimir Sokolovsky <vlad@mellanox.co.il>
-- Added %build macro
-* Sun Jan 28 2007 Vladimir Sokolovsky <vlad@mellanox.co.il>
-- Created spec file for kernel-ib
index fa91d0852b5dd15bd2b61cba60508ffd90901544..fa531dd0c2e322cb1625c019b9e87df39b616a51 100755 (executable)
@@ -29,17 +29,10 @@ xex()
 # branch defaults to ofed_kernel
 branch=${1:-ofed_kernel}
 
-# make sure we have the list of all the other files and dirs
-if [ ! -e ofed_scripts/checkout_files ]; then
-       ex git checkout ${branch} ofed_scripts/checkout_files
-fi
-
-xex xargs -rt git ls-tree -r --name-only ${branch} <ofed_scripts/checkout_files |
-       xex xargs -rt git checkout ${branch}
+git checkout -f ${branch}
 
 ex git update-ref HEAD ${branch}
 
 ln -snf ofed_scripts/configure
 ln -snf ofed_scripts/Makefile
 ln -snf ofed_scripts/makefile
-(cd drivers/scsi/; rm -f Makefile; cp ../../ofed_scripts/iscsi_scsi_makefile Makefile)
index ae22c9b5bb5f12d3faa3d56bded26a38017dc7f7..1c8fb63e07b3ef26134b106115562f51817299e9 100755 (executable)
@@ -34,6 +34,8 @@ Usage:  `basename $0` [options]
 
     --with-backport=VERSION  apply these backports [$(get_backport_dir.sh `uname -r`)]
     --kernel-version=VERSION  apply backports for this kernel [$(uname -r)]
+    --with-git[=TMP_BRANCH]  use git, create a temporary branch [backport-$(get_backport_dir.sh `uname -r`)]
+    --without-git        don't use git
     --with-quilt[=FILE]  path to quilt [$(/usr/bin/which quilt  2> /dev/null)]
     --without-quilt  use patch and not quilt [no]
     --with-patchdir=DIR  path to the patches directory []
@@ -50,10 +52,7 @@ Usage:  `basename $0` [options]
 
     --help - print out options
 
-List of supported backports:
-
 EOF
-       get_backports
 }
 
 # Execute command w/ echo and exit if it fail
@@ -66,38 +65,6 @@ ex()
         fi
 }
 
-get_backports()
-{
-       echo 2.6.9_U2
-       echo 2.6.9_U3
-       echo 2.6.9_U4
-       echo 2.6.9_U5
-       echo 2.6.9_U6
-       echo 2.6.9_U7
-       echo 2.6.16_sles10
-       echo 2.6.16_sles10_sp1
-       echo 2.6.16_sles10_sp2
-       echo 2.6.16
-       echo 2.6.17
-       echo 2.6.18_FC6 "(good for RHEL5 as well)"
-       echo 2.6.18-EL5.1  "( RHEL5 U1)"
-       echo 2.6.18-EL5.2  "( RHEL5 U2)"
-       echo 2.6.18-EL5.3  "( RHEL5 U3)"
-       echo 2.6.18-EL5.4  "( RHEL5 U4)"
-       echo 2.6.18_suse10_2
-       echo 2.6.18
-       echo 2.6.19
-       echo 2.6.20
-       echo 2.6.21
-       echo 2.6.22
-       echo 2.6.22_suse10_3
-       echo 2.6.23
-       echo 2.6.24
-       echo 2.6.25
-       echo 2.6.26
-       echo 2.6.27_sles11
-}
-
 # Apply patch
 apply_patch()
 {
@@ -106,7 +73,9 @@ apply_patch()
 
         if [ -e  ${patch} ]; then
             printf "\t${patch}\n"
-            if [ "${WITH_QUILT}" == "yes" ]; then
+            if [ "${WITH_GIT}" == "yes" ]; then
+                ex $GIT am $REJECT < ${patch}
+            elif [ "${WITH_QUILT}" == "yes" ]; then
                 ex $QUILT import ${patch}
                 ex $QUILT push patches/${patch##*/}
             else
@@ -125,14 +94,21 @@ apply_patch()
 # Apply patches from the given directory
 apply_backport_patches()
 {
-        local pdir=${CWD}/backports/${BACKPORT_DIR}
+        local pdir=${CWD}/${BACKPORT_DIR}
         shift
         printf "\nApplying patches for ${BACKPORT_DIR} kernel:\n"
+        if [ "${WITH_GIT}" == "yes" ]; then
+            ex $GIT checkout -b backport-${BACKPORT_DIR}
+        fi
         if [ -d ${pdir} ]; then
+            if [ "${WITH_GIT}" == "yes" ]; then
+                ex $GIT am $REJECT ${pdir}/*.patch
+            else
                 for patch in ${pdir}/*
                 do
-                        apply_patch ${patch}
+                    apply_patch ${patch}
                 done
+            fi
         else
                 echo ${pdir} no such directory
         fi
@@ -150,43 +126,37 @@ QUILT_DIFF_OPTS='-x .svn -p --ignore-matching-lines=\$Id'
 QUILT_PATCH_OPTS='-l'
 EOF
 
-        QUILT="${QUILT} --quiltrc ${quiltrc}"
+    QUILT="${QUILT} --quiltrc ${quiltrc}"
 
-        if [ -n "${PATCH_DIR}" ]; then
-                # Apply user's patches
-                for patch in ${PATCH_DIR}/*
-                do
-                        apply_patch ${patch}
-                done
-
-        else
-                # Apply backport patches
-                BACKPORT_DIR=${BACKPORT_DIR:-$(${CWD}/ofed_scripts/get_backport_dir.sh ${KVERSION})}
-                if [ -n "${BACKPORT_DIR}" ]; then
-                        if [ "X${WITH_BACKPORT_PATCHES}" == "Xyes" ]; then
-                                apply_backport_patches
-                        fi
-                        BACKPORT_INCLUDES='-I${CWD}/kernel_addons/backport/'${BACKPORT_DIR}/include/
-                fi
+    if [ -n "${PATCH_DIR}" ]; then
+            # Apply user's patches
+            for patch in ${PATCH_DIR}/*
+            do
+                    apply_patch ${patch}
+            done
 
+    else
+            # Apply kernel fixes
+            if [ "X${WITH_KERNEL_FIXES}" == "Xyes" ]; then
+                apply_kernel_fixes
+            fi
 
-#FIXME: why are these applied here? Move them to before backports?
-                if [ "$WITH_PATCH" == "yes" ]; then
-                        # Apply huge pages patch
-                        if [ -d ${CWD}/kernel_patches/hpage_patches ]; then
-                            if [ "X${WITH_HPAGE_PATCH}" == "Xyes" ]; then
-                                # Apply hpages.patch
-                                patch=${CWD}/kernel_patches/hpage_patches/hpages.patch
-                                apply_patch ${patch}
-                            fi
-                        fi
-                fi
-        fi
+            # Apply backport patches
+            echo "getting backport dir for kernel version ${KVERSION}"
+            BACKPORT_DIR="backports"
+            echo "found backport dir ${BACKPORT_DIR}"
+            if [ -n "${BACKPORT_DIR}" ]; then
+                    if [ "X${WITH_BACKPORT_PATCHES}" == "Xyes" ]; then
+                            apply_backport_patches
+                    fi
+                    BACKPORT_INCLUDES='-I${CWD}/kernel_addons/backport/'${BACKPORT_DIR}/include/
+            fi
+    fi
 
-       # quilt leaves some files in .pc with no permissions
-       if [ -d ${CWD}/.pc ]; then
-               ex chmod -R u+rw ${CWD}/.pc
-       fi
+    # quilt leaves some files in .pc with no permissions
+    if [ -d ${CWD}/.pc ]; then
+        ex chmod -R u+rw ${CWD}/.pc
+    fi
 }
 
 main()
@@ -202,6 +172,20 @@ main()
                         -kernel-version=* | --kernel-version=* | --kern-ver=* | --ker-ver=*)
                                 KVERSION=`expr "x$1" : 'x[^=]*=\(.*\)'`
                         ;;
+                        -with-git | --with-git)
+                                WITH_GIT="yes"
+                                if [ ! -z "$2" ] && [ "`echo -n $2 | cut -c 1`" != '-' ]; then
+                                        shift
+                                        GIT_BRANCH=$1
+                                fi
+                        ;;
+                        -with-git=* | --with-git=*)
+                                WITH_GIT="yes"
+                                GIT_BRANCH=`expr "x$1" : 'x[^=]*=\(.*\)'`
+                        ;;
+                        --without-git)
+                                WITH_GIT="no"
+                        ;;
                         -with-quilt | --with-quilt)
                                 WITH_QUILT="yes"
                                 if [ ! -z "$2" ] && [ "`echo -n $2 | cut -c 1`" != '-' ]; then
@@ -276,6 +260,7 @@ main()
 
 #Set default values
 KVERSION=${KVERSION:-$(uname -r)}
+WITH_GIT=${WITH_GIT:-"yes"}
 WITH_QUILT=${WITH_QUILT:-"yes"}
 WITH_PATCH=${WITH_PATCH:-"yes"}
 BACKPORT_INCLUDES=""
@@ -284,6 +269,13 @@ WITH_BACKPORT_PATCHES=${WITH_BACKPORT_PATCHES:-"yes"}
 WITH_HPAGE_PATCH=${WITH_HPAGE_PATCH:-"no"}
 
 QUILT=${QUILT:-$(/usr/bin/which quilt  2> /dev/null)}
+GIT=${GIT:-$(/usr/bin/which git 2> /dev/null)}
+REJECT=`$GIT am --help 2> /dev/null | grep -qw '\-\-reject' && echo -n '--reject'`
+
+if [[ ! -x "$GIT" || ! -d ".git" ]]; then
+    WITH_GIT="no"
+fi
+
 CWD=$(pwd)
 PATCH_DIR=${PATCH_DIR:-""}
 
@@ -294,7 +286,8 @@ PATCH_DIR=${PATCH_DIR:-""}
         fi
 
         patches_handle
-       touch .backports_applied
+
+        touch .backports_applied
 }
 
 main $@
index 9be5af44287c7b202af211a419cbc70c6f3d7ba1..a969efb28e4e078139a60318429cf3247af1ef02 100644 (file)
@@ -1,7 +1,7 @@
-#!/bin/bash 
+#!/bin/bash
 
 #
-# Copyright (c) 2006 Mellanox Technologies. All rights reserved.
+# Copyright (c) 2013 Mellanox Technologies. All rights reserved.
 # Copyright (c) 2010 QLogic Corporation. All rights reserved.
 #
 # This Software is licensed under one of the following licenses:
@@ -32,7 +32,8 @@
 #
 
 # config: /etc/infiniband/openib.conf
-CONFIG="/etc/infiniband/openib.conf"
+OPENIBD_CONFIG=${OPENIBD_CONFIG:-"/etc/infiniband/openib.conf"}
+CONFIG=$OPENIBD_CONFIG
 
 if [ ! -f $CONFIG ]; then
     echo No InfiniBand configuration found
@@ -59,7 +60,7 @@ if [ $link == $base ] ; then
     RUNMODE=manual
     ONBOOT=yes
 else
-    RUNMODE=auto    
+    RUNMODE=auto
 fi
 
 # Allow unsupported modules, if disallowed by current configuration
@@ -77,7 +78,7 @@ if [ "X${ONBOOT}" != "Xyes" ]; then
     exit 0
 fi
 
-if ( grep -i 'SuSE Linux' /etc/issue >/dev/null 2>&1 ); then 
+if ( grep -i 'SuSE Linux' /etc/issue >/dev/null 2>&1 ); then
     if [ -n "$INIT_VERSION" ] ; then
         # MODE=onboot
             if LANG=C egrep -L "^ONBOOT=['\"]?[Nn][Oo]['\"]?" ${CONFIG} > /dev/null ; then
@@ -169,7 +170,7 @@ echo_failure() {
   [ "$BOOTUP" = "color" ] && $MOVE_TO_COL
   echo -n "["
   [ "$BOOTUP" = "color" ] && $SETCOLOR_FAILURE
-  echo -n $"FAILED" 
+  echo -n $"FAILED"
   [ "$BOOTUP" = "color" ] && $SETCOLOR_NORMAL
   echo -n "]"
   echo -e "\r"
@@ -202,7 +203,7 @@ count_ib_ports()
         fi
         cnt=$[ $cnt + $ports_in_hca ]
     done
-   
+
     return $cnt
 }
 
@@ -269,38 +270,34 @@ fi
 
 if [ "X${SRP_TARGET_LOAD}" == "Xyes" ]; then
     POST_LOAD_MODULES="$POST_LOAD_MODULES ib_srp_target"
-fi    
+fi
 
 if [ "X${RDMA_CM_LOAD}" == "Xyes" ]; then
     POST_LOAD_MODULES="$POST_LOAD_MODULES rdma_cm"
-fi    
+fi
 
 if [ "X${UCM_LOAD}" == "Xyes" ]; then
     POST_LOAD_MODULES="$POST_LOAD_MODULES ib_ucm"
-fi    
+fi
 
 if [ "X${RDS_LOAD}" == "Xyes" ]; then
     POST_LOAD_MODULES="$POST_LOAD_MODULES rds rds_rdma rds_tcp"
-fi    
-
-if [ "X${ISER_LOAD}" == "Xyes" ]; then
-    POST_LOAD_MODULES="$POST_LOAD_MODULES ib_iser"
-fi    
+fi
 
 if [ "X${RDMA_UCM_LOAD}" == "Xyes" ]; then
     POST_LOAD_MODULES="$POST_LOAD_MODULES rdma_ucm"
-fi    
+fi
 
 GEN1_UNLOAD_MODULES="ib_srp_target scsi_target ib_srp kdapltest_module ib_kdapl ib_sdp ib_useraccess ib_useraccess_cm ib_cm ib_dapl_srv ib_ip2pr ib_ipoib ib_tavor mod_thh mod_rhh ib_dm_client ib_sa_client ib_client_query ib_poll ib_mad ib_core ib_services"
 
-UNLOAD_MODULES="ib_mthca mlx4_ib ib_ipath ipath_core ib_ehca iw_nes cxgb3i iw_cxgb3 cxgb3 iw_cxgb4 cxgb4"
+UNLOAD_MODULES="ib_mthca mlx5_ib mlx5_core mlx4_ib ib_ipath ipath_core ib_ehca iw_nes cxgb3i iw_cxgb3 cxgb3 iw_cxgb4 cxgb4"
 UNLOAD_MODULES="$UNLOAD_MODULES ib_qib"
 UNLOAD_MODULES="$UNLOAD_MODULES ib_ipoib ib_madeye ib_rds"
 UNLOAD_MODULES="$UNLOAD_MODULES rds_rdma rds_tcp rds ib_ucm kdapl ib_srp_target scsi_target ib_srpt ib_srp ib_iser ib_sdp"
 UNLOAD_MODULES="$UNLOAD_MODULES rdma_ucm rdma_cm ib_addr iw_cm ib_cm ib_local_sa findex"
 UNLOAD_MODULES="$UNLOAD_MODULES ib_sa ib_uverbs ib_umad ib_mad ib_core"
 
-STATUS_MODULES="rdma_ucm ib_rds rds rds_rdma rds_tcp ib_srpt ib_srp qlgc_vnic ib_sdp rdma_cm ib_addr ib_local_sa findex ib_ipoib ib_ehca ib_ipath ipath_core mlx4_core mlx4_ib mlx4_en ib_mthca ib_uverbs ib_umad ib_ucm ib_sa ib_cm ib_mad ib_core iw_cxgb3 iw_cxgb4 iw_nes"
+STATUS_MODULES="rdma_ucm ib_rds rds rds_rdma rds_tcp ib_srpt ib_srp qlgc_vnic ib_sdp rdma_cm ib_addr ib_local_sa findex ib_ipoib ib_ehca ib_ipath ipath_core mlx4_core mlx4_ib mlx4_en mlx5_core mlx5_ib ib_mthca ib_uverbs ib_umad ib_ucm ib_sa ib_cm ib_mad ib_core iw_cxgb3 iw_cxgb4 iw_nes"
 STATUS_MODULES="$STATUS_MODULES ib_qib"
 
 ipoib_ha_pidfile=/var/run/ipoib_ha.pid
@@ -320,7 +317,7 @@ get_mlx4_en_interfaces()
         if (grep 0x15b3 ${ethpath}/device/vendor > /dev/null 2>&1); then
             mlx4_en_interfaces="$mlx4_en_interfaces ${ethpath##*/}"
         fi
-    done    
+    done
 }
 
 # If module $1 is loaded return - 0 else - 1
@@ -330,8 +327,45 @@ local RC
 
     /sbin/lsmod | grep -w "$1" > /dev/null 2>&1
     RC=$?
-    
-return $RC        
+
+return $RC
+}
+
+log_msg()
+{
+    logger -i "openibd: $@"
+}
+
+load_module()
+{
+    local module=$1
+    filename=`modinfo $module | grep filename | awk '{print $NF}'`
+
+    if [ ! -n "$filename" ]; then
+        echo_failure "Module $module does not exist"
+        log_msg "Error: Module $module does not exist"
+        return 1
+    fi
+
+    if [ -L $filename ]; then
+        filename=`readlink -f $filename`
+    fi
+
+    rpm_name=`/bin/rpm -qf $filename --queryformat "[%{NAME}]" 2> /dev/null`
+    if [ $? -ne 0 ]; then
+            echo_warning "Module $module does not belong to OFED"
+            log_msg "Module $module does not belong to OFED"
+    else
+        case "$rpm_name" in
+            *compat-rdma* | kernel-ib)
+            ;;
+            *)
+            echo_warning "Module $module belong to $rpm_name which is not a part of OFED"
+            log_msg "Module $module belong to $rpm_name which is not a part of OFED"
+            ;;
+        esac
+    fi
+    ${modprobe} $module > /dev/null 2>&1
 }
 
 # Return module's refcnt
@@ -350,7 +384,7 @@ get_sw_fw_info()
         OFEDHOME=$(${INFO} | grep -w prefix | cut -d '=' -f 2)
     fi
     MREAD=$(which mstmread 2> /dev/null)
-    
+
     # Get OFED Build id
     if [ -r ${OFEDHOME}/BUILD_ID ]; then
         echo  "Software"
@@ -358,7 +392,7 @@ get_sw_fw_info()
         printf "Build ID:\n"
         cat ${OFEDHOME}/BUILD_ID
         echo  "-------------------------------------"
-    fi    
+    fi
 
     # Get FW version
     if [ ! -x ${MREAD} ]; then
@@ -390,7 +424,7 @@ get_sw_fw_info()
         hour=$(echo -n $ftime | cut -d x -f 2 | cut -b 5,6)
         min=$(echo -n $ftime | cut -d x -f 2 | cut -b 3,4)
         sec=$(echo -n $ftime | cut -d x -f 2 | cut -b 1,2)
-        
+
         printf "\tDate:"
         printf "\t$day/$month/$year $hour:$min:$sec\n"
     done
@@ -419,7 +453,7 @@ get_debug_info()
     echo >> $DEBUG_INFO
     echo "############# LSPCI ##############" >> $DEBUG_INFO
     /sbin/lspci 2> /dev/null >> $DEBUG_INFO
-    
+
     echo >> $DEBUG_INFO
     echo "############# LSPCI -N ##############" >> $DEBUG_INFO
     /sbin/lspci -n 2> /dev/null >> $DEBUG_INFO
@@ -427,9 +461,9 @@ get_debug_info()
     echo >> $DEBUG_INFO
     echo "############# LSMOD ##############" >> $DEBUG_INFO
     /sbin/lsmod >> $DEBUG_INFO
-    
+
     echo >> $DEBUG_INFO
-    echo "############# DMESG ##############" >> $DEBUG_INFO                                                            
+    echo "############# DMESG ##############" >> $DEBUG_INFO
     /bin/dmesg >> $DEBUG_INFO
 
     if [ -r /var/log/messages ]; then
@@ -448,144 +482,19 @@ get_debug_info()
     echo
 }
 
-errata_58()
-{
-# Check AMD chipset issue Errata #58
-if test -x /sbin/lspci && test -x /sbin/setpci; then
-     if ( /sbin/lspci -nd 1022:1100 2> /dev/null | grep "1100" > /dev/null ) &&
-        ( /sbin/lspci -nd 1022:7450 2> /dev/null | grep "7450" > /dev/null ) &&
-        ( /sbin/lspci -nd 15b3:5a46 2> /dev/null | grep "5a46" > /dev/null ); then
-
-        if ! ( grep FIX_AMD_8131_ERR58 $CONFIG > /dev/null ); then
-            echo >> $CONFIG
-            echo "# Set FIX_AMD_8131_ERR58=YES to apply AMD-8131 Errata #58 workaround" >> $CONFIG
-            echo "FIX_AMD_8131_ERR58=\"YES\"" >> $CONFIG
-        fi
-        
-        # Set default value for FIX_AMD_8131_ERR58
-        if [ -z "$FIX_AMD_8131_ERR58" ]; then
-                FIX_AMD_8131_ERR58="YES"
-        fi
-        
-        CURVAL=`/sbin/setpci -d 1022:1100 69`
-
-        for val in $CURVAL
-        do
-            if [ "${val}" != "c0" ]; then
-                if [ "$FIX_AMD_8131_ERR58" == "YES" ]; then
-                    /sbin/setpci -d 1022:1100 69=c0
-                    if [ $? -eq 0 ]; then
-                        # echo "AMD-8131 Errata #58 workaround applied"
-                        break
-                    else
-                        echo "Failed to apply AMD-8131 Errata #58 workaround"
-                    fi
-                else
-                    echo
-                    echo "Invalid configuration found for PCI-X chipset AMD-8131 (Errata #58)"
-                    echo
-                    if [ "$RUNMODE" == "manual" ]; then
-                        read -p "Do you wish to continue anyway? [y/N]:"
-                        if [[ "$REPLY" != "y" && "$REPLY" != "yes" ]]; then
-                            exit 1
-                        fi
-                        break
-                    else
-                        exit 1
-                    fi
-                fi
-            fi
-        done
-    
-    fi
-fi
-
-}
-
-errata_56()
-{
-# Check AMD chipset issue Errata #56
-if test -x /sbin/lspci && test -x /sbin/setpci; then
-     if ( /sbin/lspci -nd 1022:1100 2> /dev/null | grep "1100" > /dev/null ) &&
-        ( /sbin/lspci -nd 1022:7450 2> /dev/null | grep "7450" > /dev/null ) &&
-        ( /sbin/lspci -nd 15b3:5a46 2> /dev/null | grep "5a46" > /dev/null ); then
-
-        if ! ( grep FIX_AMD_8131_ERR56 $CONFIG > /dev/null ); then
-            echo >> $CONFIG
-            echo "# Set FIX_AMD_8131_ERR56=YES to apply AMD-8131 Errata #56 workaround" >> $CONFIG
-            echo "FIX_AMD_8131_ERR56=\"YES\"" >> $CONFIG
-        fi
-
-        # Set default value for FIX_AMD_8131_ERR56
-        if [ -z "$FIX_AMD_8131_ERR56" ]; then
-                FIX_AMD_8131_ERR56="YES"
-        fi
-
-        bus=""
-
-        # Look for devices AMD-8131
-        for amd_dev in `/sbin/setpci -v -f -d 1022:7450 19 | cut -d':' -f1,2`
-        do
-
-                bus=`/sbin/setpci -s $amd_dev 19`
-                rev=`/sbin/setpci -s $amd_dev 8`
-
-
-                # Look for Tavor attach to secondary bus of this devices
-                for device in `/sbin/setpci -f -s $bus: -d 15b3:5a46 19`
-                do
-                        if [ $rev -lt 13 ]; then
-                                if [ "$FIX_AMD_8131_ERR56" == "YES" ]; then                     
-                                        /sbin/setpci -d 15b3:5a44 72=14
-                                        if [ $? -eq 0 ]; then
-                                                # echo "AMD-8131 Errata #56 workaround applied"
-                                                break
-                                        else
-                                                echo "Failed to apply AMD-8131 Errata #56 workaround"
-                                        fi
-                                else
-                                        echo
-                                        echo "Invalid configuration found for PCI-X chipset AMD-8131 (Errata #56)"
-                                        echo
-
-                                        if [ "$RUNMODE" == "manual" ]; then
-                                                read -p "Do you wish to continue anyway? [y/N]:"
-                                                if [[ "$REPLY" != "y" && "$REPLY" != "yes" ]]; then
-                                                    exit 1
-                                                fi
-                                                break
-                                        else
-                                                exit 1
-                                        fi
-                                fi
-
-                        else
-                                continue
-                        fi
-
-                        # If more than one device is on the bus the issue a
-                        # warning
-                        num=`/sbin/setpci -f -s $bus: 0 | wc -l |  sed 's/\ *//g'`
-
-                        if [ $num -gt 1 ]; then
-                                echo "Warning: your current PCI-X configuration might be incorrect."
-                                echo "see AMD-8131 Errata 56 for more details."
-                        fi
-
-                done
-        done
-
-     fi
-fi
-}
-
-
 ib_set_node_desc()
 {
       # Wait while node's hostname is set
       NODE_DESC_TIME_BEFORE_UPDATE=${NODE_DESC_TIME_BEFORE_UPDATE:-10}
       sleep $NODE_DESC_TIME_BEFORE_UPDATE
+      # Reread NODE_DESC value
+      . $CONFIG
       NODE_DESC=${NODE_DESC:-$(hostname -s)}
+      while [ "${NODE_DESC}" == "localhost" ]; do
+          sleep 1
+          . $CONFIG
+          NODE_DESC=${NODE_DESC:-$(hostname -s)}
+      done
       # Add node description to sysfs
       ibsysdir="/sys/class/infiniband"
       if [ -d ${ibsysdir} ]; then
@@ -593,7 +502,7 @@ ib_set_node_desc()
           for hca in ${ibsysdir}/*
           do
               if [ -e ${hca}/node_desc ]; then
-                  logger -i "Set node_desc for $(basename $hca): ${NODE_DESC} HCA-${hca_id}"
+                  log_msg "Set node_desc for $(basename $hca): ${NODE_DESC} HCA-${hca_id}"
                   echo -n "${NODE_DESC} HCA-${hca_id}" >> ${hca}/node_desc
               fi
               let hca_id++
@@ -716,7 +625,7 @@ is_onboot()
                 if LANG=C egrep -L "^ONBOOT=['\"]?[Nn][Oo]['\"]?" ${NETWORK_CONF_DIR}/ifcfg-$i > /dev/null ; then
                     return 1
                 fi
-            ;;    
+            ;;
             SuSE)
                 if ! LANG=C egrep -L "^STARTMODE=['\"]?onboot['\"]?" ${NETWORK_CONF_DIR}/ifcfg-$i > /dev/null ; then
                     return 1
@@ -731,8 +640,8 @@ is_onboot()
                 if LANG=C egrep -L "^ONBOOT=['\"]?[Nn][Oo]['\"]?" ${NETWORK_CONF_DIR}/ifcfg-$i > /dev/null ; then
                     return 1
                 fi
-            ;;    
-        esac    
+            ;;
+        esac
 
         return 0
 }
@@ -759,7 +668,7 @@ bring_up()
 
         case $DISTRIB in
                 RedHat|Rocks)
-                    if [ $IS_FEDORA -eq 0 ]; then       
+                    if [ $IS_FEDORA -eq 0 ]; then
                         /sbin/ifup ${i} 2> /dev/null
                     else
                         . ${NETWORK_CONF_DIR}/ifcfg-${i}
@@ -773,7 +682,7 @@ bring_up()
                 SuSE)
                     if [ "$KPREFIX" == "26" ]; then
                         ifconfig ${i} up > /dev/null 2>&1
-                    fi    
+                    fi
                             # Workaround for ifup issue: two devices with the same IP address
                         . ${NETWORK_CONF_DIR}/ifcfg-${i}
                 if [ ! -z ${IPADDR} ] && [ ! -z ${NETMASK} ] && [ ! -z ${BROADCAST} ]; then
@@ -786,8 +695,8 @@ bring_up()
                 *)
                     /sbin/ifup ${i} 2> /dev/null
                 ;;
-        esac 
-        
+        esac
+
         if [ "X${SET_IPOIB_CM}" == "Xyes" ]; then
                 set_ipoib_cm ${i}
         fi
@@ -798,7 +707,7 @@ bring_up()
 start()
 {
     local RC=0
-   
+
     # Stop Gen1 modules if they are UP after uninstall
     if is_module ib_tavor; then
         echo
@@ -814,11 +723,9 @@ start()
         fi
     fi
 
-    errata_58
-    
     # Load Mellanox HCA driver
     if [ "X${MTHCA_LOAD}" == "Xyes" ]; then
-        ${modprobe} ib_mthca > /dev/null 2>&1
+        load_module ib_mthca
         my_rc=$?
         if [ $my_rc -ne 0 ]; then
                 echo_failure $"Loading Mellanox HCA driver: "
@@ -827,7 +734,11 @@ start()
     fi
 
     if [ "X${MLX4_LOAD}" == "Xyes" ]; then
-        ${modprobe} mlx4_core > /dev/null 2>&1
+        # W/A: original version of mlx4_core being loaded before the updated one
+        if is_module mlx4_core; then
+                ${modprobe} -r mlx4_core
+        fi
+        load_module mlx4_core
         my_rc=$?
         if [ $my_rc -ne 0 ]; then
                 echo_failure $"Loading Mellanox MLX4 HCA driver: "
@@ -837,7 +748,7 @@ start()
                          . /etc/infiniband/connectx.conf > /dev/null 2>&1
                 fi
         fi
-        ${modprobe} mlx4_ib > /dev/null 2>&1
+        load_module mlx4_ib
         my_rc=$?
         if [ $my_rc -ne 0 ]; then
                 echo_failure $"Loading Mellanox MLX4_IB HCA driver: "
@@ -847,10 +758,10 @@ start()
 
     if [ "X${MLX4_EN_LOAD}" == "Xyes" ]; then
         if ! is_module mlx4_core; then
-                ${modprobe} mlx4_core > /dev/null 2>&1
+                load_module mlx4_core
         fi
 
-        ${modprobe} mlx4_en > /dev/null 2>&1
+        load_module mlx4_en
         my_rc=$?
         if [ $my_rc -ne 0 ]; then
                 echo_failure $"Loading Mellanox MLX4_EN HCA driver: "
@@ -858,9 +769,23 @@ start()
         RC=$[ $RC + $my_rc ]
     fi
 
+    if [ "X${MLX5_LOAD}" == "Xyes" ]; then
+        load_module mlx5_core
+        my_rc=$?
+        if [ $my_rc -ne 0 ]; then
+                echo_failure $"Loading Mellanox MLX5 HCA driver: "
+        fi
+        load_module mlx5_ib
+        my_rc=$?
+        if [ $my_rc -ne 0 ]; then
+                echo_failure $"Loading Mellanox MLX5_IB HCA driver: "
+        fi
+        RC=$[ $RC + $my_rc ]
+    fi
+
     # Load QLogic QIB driver
     if [ "X${QIB_LOAD}" == "Xyes" ]; then
-        ${modprobe} ib_qib > /dev/null 2>&1
+        load_module ib_qib
         my_rc=$?
         if [ $my_rc -ne 0 ]; then
                 echo_failure $"Loading QLogic QIB driver: "
@@ -872,7 +797,7 @@ start()
 
     # Load QLogic InfiniPath driver
     if [ "X${IPATH_LOAD}" == "Xyes" ]; then
-        ${modprobe} ib_ipath > /dev/null 2>&1
+        load_module ib_ipath
         my_rc=$?
         if [ $my_rc -ne 0 ]; then
                 echo_failure $"Loading QLogic InfiniPath driver: "
@@ -885,7 +810,7 @@ start()
     # Load eHCA driver
     if [ "X${EHCA_LOAD}" == "Xyes" ]; then
         fix_location_codes
-        ${modprobe} ib_ehca > /dev/null 2>&1
+        load_module ib_ehca
         my_rc=$?
         if [ $my_rc -ne 0 ]; then
                 echo_failure $"Loading eHCA driver: "
@@ -896,7 +821,7 @@ start()
     # Load iw_cxgb3 driver
     if [ "X${CXGB3_LOAD}" == "Xyes" ]; then
         fix_location_codes
-        ${modprobe} iw_cxgb3 > /dev/null 2>&1
+        load_module iw_cxgb3
         my_rc=$?
         if [ $my_rc -ne 0 ]; then
                 echo_failure $"Loading cxgb3 driver: "
@@ -907,7 +832,7 @@ start()
     # Load iw_cxgb4 driver
     if [ "X${CXGB4_LOAD}" == "Xyes" ]; then
         fix_location_codes
-        ${modprobe} iw_cxgb4 > /dev/null 2>&1
+        load_module iw_cxgb4
         my_rc=$?
         if [ $my_rc -ne 0 ]; then
                 echo_failure $"Loading cxgb4 driver: "
@@ -918,7 +843,7 @@ start()
     # Load iw_nes driver
     if [ "X${NES_LOAD}" == "Xyes" ]; then
         fix_location_codes
-        ${modprobe} iw_nes > /dev/null 2>&1
+        load_module iw_nes
         my_rc=$?
         if [ $my_rc -ne 0 ]; then
                 echo_failure $"Loading nes driver: "
@@ -928,23 +853,23 @@ start()
 
     ib_set_node_desc > /dev/null 2>&1 &
 
-    ${modprobe} ib_umad > /dev/null 2>&1
+    load_module ib_umad
     RC=$[ $RC + $? ]
-    ${modprobe} ib_uverbs > /dev/null 2>&1
+    load_module ib_uverbs
     RC=$[ $RC + $? ]
-    
+
     if [ $IPOIB -eq 1 ]; then
-        ${modprobe} ib_ipoib > /dev/null 2>&1
+        load_module ib_ipoib
         RC=$[ $RC + $? ]
     fi
 
     if [ $RC -eq 0 ]; then
         echo_success $"Loading HCA driver and Access Layer: "
-    else    
+    else
         echo_failure $"Loading HCA driver and Access Layer: "
         get_debug_info
         exit 1
-    fi    
+    fi
 
     # Enable IPoIB Interface if configured
     if [ $IPOIB -eq 1 ]; then
@@ -963,29 +888,29 @@ start()
                                 ln -snf ${WD}/ifcfg-${i} ${NETWORK_CONF_DIR}/ifcfg-${i}
                                 REMOVE_NETWORK_CONF=1
                         fi
-        
+
                         if [ "$RUNMODE" != "manual" ]; then
                                 if ! is_onboot $i; then
                                         continue
                                 fi
                         fi
-        
+
                         bring_up $i
                         RC=$?
-        
+
                         unset IPADDR NETMASK BROADCAST
 
                         if [ $REMOVE_NETWORK_CONF -eq 1 ]; then
                             rm -f ${NETWORK_CONF_DIR}/ifcfg-${i}
                         fi
-            
-                        if [ $RC -eq 0 ]; then 
+
+                        if [ $RC -eq 0 ]; then
                                 echo_success $"Bringing up interface $i:"
                         else
                                 echo_failure $"Bringing up interface $i:"
                         fi
                 fi
-                
+
                 # Bring up child interfaces if configured
                 for child_conf in $(/bin/ls -1 ${NETWORK_CONF_DIR}/ifcfg-${i}.???? 2> /dev/null)
                 do
@@ -999,7 +924,7 @@ start()
                                         continue
                                 fi
                         fi
-        
+
                         if [ ! -f /sys/class/net/${i}/create_child ]; then
                                 continue
                         fi
@@ -1012,24 +937,24 @@ start()
                         RC=$?
 
                         unset IPADDR NETMASK BROADCAST
-                        if [ $RC -eq 0 ]; then 
+                        if [ $RC -eq 0 ]; then
                                 echo_success $"Bringing up interface $ch_i:"
                         else
                                 echo_failure $"Bringing up interface $ch_i:"
                         fi
                 done
-        done    
+        done
         echo_done "Setting up service network   .   .   ."
-        
-    fi    
-    
+
+    fi
+
     # Load configured modules
     if [ "$POST_LOAD_MODULES" != "" ]; then
         for mod in  $POST_LOAD_MODULES
         do
                 case $mod in
                         ib_srp)
-                                ${modprobe} $mod > /dev/null 2>&1
+                                load_module $mod
                                 if [ "X${SRPHA_ENABLE}" == "Xyes" ]; then
                                     if [ ! -x /sbin/multipath ]; then
                                         echo "/sbin/multipath is required to enable SRP HA."
@@ -1053,16 +978,14 @@ EOF
                                 fi
                         ;;
                         *)
-                                ${modprobe} $mod > /dev/null 2>&1
+                                load_module $mod
                         ;;
                 esac
                 RC=$?
                 [ $RC -ne 0 ] && echo_failure "Loading $mod"
-        done    
+        done
     fi
-    
-    errata_56
-    
+
     # Create devices using udev
     if [ -x /sbin/udevstart ]; then
         UDEVSTART=/sbin/udevstart
@@ -1173,7 +1096,7 @@ unload()
                                 rm_mod $mod
                                sleep 2
                        ;;
-                       ib_mthca | mlx4_ib | ib_ehca | iw_cxgb3 | iw_cxgb4 | iw_nes)
+                       ib_mthca | mlx4_ib | mlx5_ib | ib_ehca | iw_cxgb3 | iw_cxgb4 | iw_nes)
                                 rm_mod $mod
                                sleep 2
                        ;;
@@ -1197,16 +1120,16 @@ stop_gen1()
         for i in $interfaces
         do
                 if [[ ! -e ${WD}/ifcfg-${i} && ! -e ${NETWORK_CONF_DIR}/ifcfg-${i} ]]; then
-                        # echo "No configuration found for ${i}"        
+                        # echo "No configuration found for ${i}"
                         continue
                 fi
-    
+
                 REMOVE_NETWORK_CONF=0
                 if [ ! -e ${NETWORK_CONF_DIR}/ifcfg-${i} ]; then
                         ln -snf ${WD}/ifcfg-${i} ${NETWORK_CONF_DIR}/ifcfg-${i}
                         REMOVE_NETWORK_CONF=1
                 fi
-    
+
                 ifdown ${i} > /dev/null 2>&1
                 RC=$(($RC+$?))
                 [ $RC -eq 0 ] && echo_success $"Shutting down interface $i: " || echo_failure $"Shutting down interface $i: "
@@ -1214,7 +1137,7 @@ stop_gen1()
                         rm -f ${NETWORK_CONF_DIR}/ifcfg-${i}
                 fi
         done
-    
+
         [ $RC -ne 0 ] && echo "Please reboot the host." &&  exit 1
         sleep 2
     fi
@@ -1231,14 +1154,14 @@ stop_gen1()
 stop()
 {
         # Check if applications which use infiniband are running
-        local apps="opensm osmtest ibbs ibns"
+        local apps="opensm osmtest ibbs ibns ibacm"
         local pid
-        
+
         for app in $apps
         do
-        if ( ps -ef | grep $app | grep -v grep > /dev/null 2>&1 ); then
+        if ( /usr/bin/pgrep $app > /dev/null 2>&1 ); then
                 echo
-                echo "Please stop $app and all applications running over InfiniBand"
+                echo "Please stop \"$app\" and all applications running over InfiniBand"
                 echo "Then run \"$0 $ACTION\""
                 echo
                 exit 1
@@ -1278,7 +1201,7 @@ stop()
         if is_module ib_tavor; then
                 stop_gen1
         fi
-    
+
         # Stop IPoIB HA daemon if running
         if [ -f $ipoib_ha_pidfile ]; then
                 local line p
@@ -1379,8 +1302,8 @@ stop()
 status()
 {
     local RC=0
-       if is_module ib_mthca || is_module mlx4_core || is_module ib_qib || is_module ib_ipath || is_module ib_ehca || is_module iw_cxgb3 || is_module iw_cxgb4 || is_module iw_nes; then
+
+       if is_module ib_mthca || is_module mlx4_core || is_module mlx5_core || is_module ib_qib || is_module ib_ipath || is_module ib_ehca || is_module iw_cxgb3 || is_module iw_cxgb4 || is_module iw_nes; then
                echo
                echo "  HCA driver loaded"
                echo
@@ -1389,7 +1312,7 @@ status()
                echo $"HCA driver is not loaded"
                echo
        fi
-  
+
     if is_module ib_ipoib; then
        get_interfaces
        if [ -n "$interfaces" ]; then
@@ -1397,7 +1320,7 @@ status()
            echo $interfaces
            echo
            echo $"Currently active IPoIB devices:"
-           
+
            for i in $interfaces
            do
                 if [[ ! -e ${WD}/ifcfg-${i} && ! -e ${NETWORK_CONF_DIR}/ifcfg-${i} ]]; then
@@ -1405,10 +1328,10 @@ status()
                 fi
                 echo `/sbin/ip -o link show $i | awk -F ": " '/UP>/ { print $2 }'`
                 RC=$?
-           done     
+           done
        fi
     fi
-    
+
     if is_module mlx4_en; then
        get_mlx4_en_interfaces
        if [ -n "$mlx4_en_interfaces" ]; then
@@ -1416,18 +1339,18 @@ status()
            echo $mlx4_en_interfaces
            echo
            echo $"Currently active MLX4_EN devices:"
-           
+
            for i in $mlx4_en_interfaces
            do
                 echo `/sbin/ip -o link show $i | awk -F ": " '/UP>/ { print $2 }'`
-           done     
+           done
        fi
     fi
 
     echo
-    
+
     local cnt=0
-    
+
     for mod in  $STATUS_MODULES
     do
         if is_module $mod; then
@@ -1436,9 +1359,9 @@ status()
                 echo "  $mod"
         fi
     done
-     
+
     echo
-    
+
     return $RC
 }
 
@@ -1455,7 +1378,7 @@ trap_handler()
         printf "\nProbably some application are still using InfiniBand modules...\n"
     else
         printf "\nPlease wait ...\n"
-    fi    
+    fi
     return 0
 }
 
@@ -1466,7 +1389,7 @@ case $ACTION in
                 start
                 ;;
         stop)
-                stop    
+                stop
                 ;;
         restart)
                 stop
@@ -1476,7 +1399,7 @@ case $ACTION in
                 status
                 ;;
         *)
-                echo 
+                echo
                 echo "Usage: `basename $0` {start|stop|restart|status}"
                 echo
                 exit 1
diff --git a/ofed_scripts/set_irq_affinity.sh b/ofed_scripts/set_irq_affinity.sh
deleted file mode 100755 (executable)
index 0065b0b..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-#! /bin/bash
-if [ -z $1 ]; then
-       echo "usage: $0 <interface> [2nd interface]"
-       exit 1
-fi
-CORES=$((`cat /proc/cpuinfo | grep processor | tail -1 | awk '{print $3}'`+1))
-hop=2
-
-if [ -z $2 ]; then
-       limit_1=$((2**CORES))
-       echo "---------------------------------------"
-       echo "Optimizing IRQs for Single port traffic"
-       echo "---------------------------------------"
-else
-       echo "-------------------------------------"
-       echo "Optimizing IRQs for Dual port traffic"
-       echo "-------------------------------------"
-       limit_1=$(( 2**$((CORES/2)) ))
-       limit_2=$((2**CORES))
-       IRQS_2=$(cat /proc/interrupts | grep $2 | awk '{print $1}' | sed 's/://')
-fi
-
-IRQS_1=$(cat /proc/interrupts | grep $1 | awk '{print $1}' | sed 's/://')
-
-if [ -z "$IRQS_1" ] ; then
-       echo No IRQs found for $1.
-else
-       echo Discovered irqs for $1: $IRQS_1
-       mask=1 ; for IRQ in $IRQS_1 ; do echo Assign irq $IRQ mask 0x$(printf "%x" $mask) ; echo $(printf "%x" $mask) > /proc/irq/$IRQ/smp_affinity ; mask=$(( mask * $hop)) ; if [ $mask -ge $limit_1 ] ; then mask=1; fi ;done
-fi
-
-echo 
-
-if [ "$2" != "" ]; then
-       if [ -z "$IRQS_2" ]; then
-               echo No IRQs found for $1.
-       else
-               echo Discovered irqs for $2: $IRQS_2
-               mask=$limit_1 ; for IRQ in $IRQS_2 ; do echo Assign irq $IRQ mask 0x$(printf "%x" $mask) ; echo $(printf "%x" $mask) > /proc/irq/$IRQ/smp_affinity ; mask=$(( mask * $hop)) ; if [ $mask -ge $limit_2 ] ; then mask=$limit_1 ; fi ;done
-       fi
-fi
-echo 
-echo done. 
diff --git a/ofed_scripts/show_irq_affinity.sh b/ofed_scripts/show_irq_affinity.sh
deleted file mode 100755 (executable)
index 38eb47c..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-#! /bin/bash
-if [ -z $1 ]; then 
-       IRQS=$(cat /proc/interrupts | grep eth-mlx | awk '{print $1}' | sed 's/://')
-else
-       IRQS=$(cat /proc/interrupts | grep $1 | awk '{print $1}' | sed 's/://')
-fi
-
-for irq in $IRQS
-do
-       echo -n "$irq: "
-       cat /proc/irq/$irq/smp_affinity
-done
-
index 8140c37588eab260dc6ed74021f61d930e7c9028..37ff04f26d9dac8e7eb41fc6ea83dd84cd77b5e4 100755 (executable)
@@ -47,17 +47,19 @@ load()
        /sbin/sysctl net.core.optmem_max                >> $sysctl_orig
        /sbin/sysctl net.ipv4.tcp_rmem                  >> $sysctl_orig
        /sbin/sysctl net.ipv4.tcp_wmem                  >> $sysctl_orig
+       /sbin/sysctl net.ipv4.tcp_low_latency           >> $sysctl_orig
 
        /sbin/sysctl -q -w net.ipv4.tcp_timestamps=0
-       /sbin/sysctl -q -w net.ipv4.tcp_sack=0
+       /sbin/sysctl -q -w net.ipv4.tcp_sack=1
        /sbin/sysctl -q -w net.core.netdev_max_backlog=250000
-       /sbin/sysctl -q -w net.core.rmem_max=16777216
-       /sbin/sysctl -q -w net.core.wmem_max=16777216
-       /sbin/sysctl -q -w net.core.rmem_default=16777216
-       /sbin/sysctl -q -w net.core.wmem_default=16777216
-       /sbin/sysctl -q -w net.core.optmem_max=16777216
-       /sbin/sysctl -q -w net.ipv4.tcp_rmem="4096 87380 16777216"
-       /sbin/sysctl -q -w net.ipv4.tcp_wmem="4096 65536 16777216"
+       /sbin/sysctl -q -w net.core.rmem_max=4194304
+       /sbin/sysctl -q -w net.core.wmem_max=4194304
+       /sbin/sysctl -q -w net.core.rmem_default=4194304
+       /sbin/sysctl -q -w net.core.wmem_default=4194304
+       /sbin/sysctl -q -w net.core.optmem_max=4194304
+       /sbin/sysctl -q -w net.ipv4.tcp_rmem="4096 87380 4194304"
+       /sbin/sysctl -q -w net.ipv4.tcp_wmem="4096 65536 4194304"
+       /sbin/sysctl -q -w net.ipv4.tcp_low_latency=1
 }
 
 unload()