[rdma: 1/2] Pull rhel7 improvements back to Fedora
Doug Ledford
dledford at fedoraproject.org
Tue Jul 22 19:38:22 UTC 2014
commit 2641c6e00bb446fffd1eacf416c01fd909d41211
Author: Doug Ledford <dledford at redhat.com>
Date: Tue Jul 22 15:36:03 2014 -0400
Pull rhel7 improvements back to Fedora
Signed-off-by: Doug Ledford <dledford at redhat.com>
rdma.conf | 10 ++++++----
rdma.sbin => rdma.kernel-init | 33 +++++++++++----------------------
rdma.modules-setup.sh | 22 ++++++++++++++++++++++
rdma.service | 4 ++--
rdma.spec | 37 +++++++++++++++++++++++--------------
rdma.udev-rules | 2 +-
6 files changed, 65 insertions(+), 43 deletions(-)
---
diff --git a/rdma.conf b/rdma.conf
index 67b4ddc..1e620b6 100644
--- a/rdma.conf
+++ b/rdma.conf
@@ -1,12 +1,14 @@
# Load IPoIB
IPOIB_LOAD=yes
-# Load SRP module
+# Load SRP (SCSI Remote Protocol initiator support) module
SRP_LOAD=no
-# Load SRPT module
+# Load SRPT (SCSI Remote Protocol target support) module
SRPT_LOAD=no
-# Load iSER module
+# Load iSER (iSCSI over RDMA initiator support) module
ISER_LOAD=no
-# Load RDS network protocol
+# Load iSERT (iSCSI over RDMA target support) module
+ISERT_LOAD=no
+# Load RDS (Reliable Datagram Service) network protocol
RDS_LOAD=no
# Should we modify the system mtrr registers? We may need to do this if you
# get messages from the ib_ipath driver saying that it couldn't enable
diff --git a/rdma.sbin b/rdma.kernel-init
similarity index 92%
rename from rdma.sbin
rename to rdma.kernel-init
index f60d5b1..0e8d1be 100644
--- a/rdma.sbin
+++ b/rdma.kernel-init
@@ -9,7 +9,7 @@
shopt -s nullglob
CONFIG=/etc/rdma/rdma.conf
-MTRR_SCRIPT=/usr/sbin/rdma-fixup-mtrr.awk
+MTRR_SCRIPT=/usr/libexec/rdma-fixup-mtrr.awk
LOAD_ULP_MODULES=""
LOAD_CORE_USER_MODULES="ib_umad ib_uverbs ib_ucm rdma_ucm"
@@ -29,6 +29,12 @@ if [ -f $CONFIG ]; then
if [ "${RDS_LOAD}" == "yes" -a -f /lib/modules/`uname -r`/kernel/net/rds/rds.ko ]; then
LOAD_ULP_MODULES="$LOAD_ULP_MODULES rds"
+ if [ -f /lib/modules/`uname -r`/kernel/net/rds/rds_tcp.ko ]; then
+ LOAD_ULP_MODULES="$LOAD_ULP_MODULES rds_tcp"
+ fi
+ if [ -f /lib/modules/`uname -r`/kernel/net/rds/rds_rdma.ko ]; then
+ LOAD_ULP_MODULES="$LOAD_ULP_MODULES rds_rdma"
+ fi
fi
if [ "${SRP_LOAD}" == "yes" ]; then
@@ -42,6 +48,10 @@ if [ -f $CONFIG ]; then
if [ "${ISER_LOAD}" == "yes" ]; then
LOAD_ULP_MODULES="$LOAD_ULP_MODULES ib_iser"
fi
+
+ if [ "${ISERT_LOAD}" == "yes" ]; then
+ LOAD_ULP_MODULES="$LOAD_ULP_MODULES ib_isert"
+ fi
else
LOAD_ULP_MODULES="ib_ipoib"
fi
@@ -116,14 +126,6 @@ load_hardware_modules()
fi
fi
fi
- if is_module cxgb3 -a ! is_module iw_cxgb3; then
- load_modules iw_cxgb3
- RC+=$?
- fi
- if is_module mlx4_core -a ! is_module mlx4_ib; then
- load_modules mlx4_ib
- RC+=$?
- fi
if is_module be2net -a ! is_module ocrdma; then
load_modules ocrdma
RC+=$?
@@ -205,19 +207,6 @@ RC=$[ $RC + $? ]
load_modules $LOAD_ULP_MODULES
RC=$[ $RC + $? ]
-# Add node description to sysfs
-IBSYSDIR="/sys/class/infiniband"
-if [ -d ${IBSYSDIR} ]; then
- pushd $IBSYSDIR
- for hca in *
- do
- if [ -w ${hca}/node_desc ]; then
- echo -n "$(hostname -s) ${hca}" >> ${hca}/node_desc 2> /dev/null
- fi
- done
- popd
-fi
-
errata_58
errata_56
diff --git a/rdma.modules-setup.sh b/rdma.modules-setup.sh
new file mode 100644
index 0000000..77c1e14
--- /dev/null
+++ b/rdma.modules-setup.sh
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+check() {
+ [ -n "$hostonly" -a -d /sys/class/infiniband_verbs/uverbs0 ] && return 0 || return 255
+ return 255
+}
+
+depends() {
+ return 0
+}
+
+install() {
+ inst /etc/rdma/rdma.conf
+ inst /usr/libexec/rdma-init-kernel
+ inst /usr/libexec/rdma-fixup-mtrr.awk
+ inst_multiple lspci setpci awk
+ inst_rules 98-rdma.rules 70-persistent-ipoib.rules
+}
+
+installkernel() {
+ instmods =drivers/infiniband
+}
diff --git a/rdma.service b/rdma.service
index ef31379..fe5007e 100644
--- a/rdma.service
+++ b/rdma.service
@@ -4,12 +4,12 @@ Documentation=file:/etc/rdma/rdma.conf
RefuseManualStop=true
DefaultDependencies=false
Conflicts=emergency.target emergency.service
-Before=network.target remote-fs-pre.target
+Before=sysinit.target
[Service]
Type=oneshot
RemainAfterExit=yes
-ExecStart=/usr/sbin/rdma-init-kernel
+ExecStart=/usr/libexec/rdma-init-kernel
[Install]
WantedBy=sysinit.target
diff --git a/rdma.spec b/rdma.spec
index 4af946a..121ae47 100644
--- a/rdma.spec
+++ b/rdma.spec
@@ -6,7 +6,7 @@
Summary: Infiniband/iWARP Kernel Module Initializer
Name: rdma
Version: 2.0
-Release: 13%{?dist}
+Release: 14%{?dist}
License: GPLv2+
Group: System Environment/Base
Source0: rdma.conf
@@ -15,15 +15,17 @@ Source2: rdma.fixup-mtrr.awk
Source4: rdma.ifup-ib
Source5: rdma.ifdown-ib
Source6: rdma.service
-Source7: rdma.sbin
+Source7: rdma.kernel-init
Source8: rdma.udev-rules
+Source9: rdma.modules-setup.sh
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
-BuildRequires: systemd
+BuildRequires: systemd-units
Requires: udev >= 095
-Requires(post): systemd
-Requires(preun): systemd
-Requires(postun): systemd
+Requires(post): systemd-units
+Requires(preun): systemd-units
+Requires(postun): systemd-units
+%global dracutlibdir %{_prefix}/lib/dracut
%description
User space initialization scripts for the kernel InfiniBand/iWARP drivers
@@ -37,19 +39,21 @@ rm -rf %{buildroot}
install -d %{buildroot}%{_sysconfdir}/%{name}
install -d %{buildroot}%{_sysconfdir}/udev/rules.d
install -d %{buildroot}%{_sysconfdir}/sysconfig/network-scripts
-install -d %{buildroot}%{_sbindir}
+install -d %{buildroot}%{_libexecdir}
install -d %{buildroot}%{_unitdir}
-install -d %{buildroot}/lib/udev/rules.d
+install -d %{buildroot}%{_udevrulesdir}
+install -d %{buildroot}%{dracutlibdir}/modules.d/05rdma
# Stuff to go into the base package
install -m 0644 %{SOURCE0} %{buildroot}%{_sysconfdir}/%{name}/%{name}.conf
install -m 0644 %{SOURCE1} %{buildroot}%{_sysconfdir}/udev/rules.d/70-persistent-ipoib.rules
install -m 0644 %{SOURCE6} %{buildroot}%{_unitdir}/rdma.service
-install -m 0755 %{SOURCE7} %{buildroot}%{_sbindir}/rdma-init-kernel
-install -m 0644 %{SOURCE2} %{buildroot}%{_sbindir}/rdma-fixup-mtrr.awk
+install -m 0755 %{SOURCE7} %{buildroot}%{_libexecdir}/rdma-init-kernel
+install -m 0644 %{SOURCE2} %{buildroot}%{_libexecdir}/rdma-fixup-mtrr.awk
install -m 0755 %{SOURCE4} %{buildroot}%{_sysconfdir}/sysconfig/network-scripts/ifup-ib
install -m 0755 %{SOURCE5} %{buildroot}%{_sysconfdir}/sysconfig/network-scripts/ifdown-ib
-install -m 0644 %{SOURCE8} %{buildroot}/lib/udev/rules.d/98-rdma.rules
+install -m 0644 %{SOURCE8} %{buildroot}%{_udevrulesdir}/98-rdma.rules
+install -m 0755 %{SOURCE9} %{buildroot}%{dracutlibdir}/modules.d/05rdma/module-setup.sh
%clean
rm -rf %{buildroot}
@@ -69,12 +73,17 @@ rm -rf %{buildroot}
%config(noreplace) %{_sysconfdir}/%{name}/%{name}.conf
%config(noreplace) %{_sysconfdir}/udev/rules.d/*
%{_unitdir}/%{name}.service
-%{_sbindir}/rdma-init-kernel
-%{_sbindir}/rdma-fixup-mtrr.awk
+%{_libexecdir}/rdma-init-kernel
+%{_libexecdir}/rdma-fixup-mtrr.awk
%{_sysconfdir}/sysconfig/network-scripts/*
-/lib/udev/rules.d/*
+%{_udevrulesdir}/*
+%dir %{dracutlibdir}/modules.d/05rdma
+%{dracutlibdir}/modules.d/05rdma/module-setup.sh
%changelog
+* Tue Jul 22 2014 Doug Ledford <dledford at redhat.com> - 2.0-14
+- Fold in improvements made in the rhel7 tree back to Fedora
+
* Tue Nov 26 2013 Doug Ledford <dledford at redhat.com> - 2.0-13
- Fix bug in ifdown-ib script handling of P_Key devs
- Move setting of node_desc to udev rules and make it more reliable
diff --git a/rdma.udev-rules b/rdma.udev-rules
index 01e01de..b988e87 100644
--- a/rdma.udev-rules
+++ b/rdma.udev-rules
@@ -9,7 +9,7 @@ SUBSYSTEM=="module", KERNEL=="ib_*", ACTION=="add", TAG+="systemd", ENV{SYSTEMD_
SUBSYSTEM=="module", KERNEL=="mlx*", ACTION=="add", TAG+="systemd", ENV{SYSTEMD_WANTS}="rdma.service"
SUBSYSTEM=="module", KERNEL=="iw_*", ACTION=="add", TAG+="systemd", ENV{SYSTEMD_WANTS}="rdma.service"
SUBSYSTEM=="module", KERNEL=="be2net", ACTION=="add", TAG+="systemd", ENV{SYSTEMD_WANTS}="rdma.service"
-SUBSYSTEM=="module", KERNEL=="enic", ACTION=="add", TAG+="systemd", ENV{SYSTEMD_WANTS}="rdma.service"
+SUBSYSTEM=="module", KERNEL=="usnic*", ACTION=="add", TAG+="systemd", ENV{SYSTEMD_WANTS}="rdma.service"
# When we detect a new verbs device is added to the system, set the node
# description on that device
More information about the scm-commits
mailing list