[rdma] Make ifdown-ib semantics match ifup-ib
Doug Ledford
dledford at fedoraproject.org
Fri May 24 01:27:01 UTC 2013
commit a0af1b7decee78c44ab235c5710fa339e3dc9a86
Author: Doug Ledford <dledford at redhat.com>
Date: Thu May 23 21:20:22 2013 -0400
Make ifdown-ib semantics match ifup-ib
Signed-off-by: Doug Ledford <dledford at redhat.com>
rdma.ifdown-ib | 46 +++++++++++++++++++++++++++++-----------------
rdma.spec | 5 ++++-
2 files changed, 33 insertions(+), 18 deletions(-)
---
diff --git a/rdma.ifdown-ib b/rdma.ifdown-ib
index f412722..a5fab86 100644
--- a/rdma.ifdown-ib
+++ b/rdma.ifdown-ib
@@ -26,33 +26,45 @@ CONFIG=${1}
source_config
+# Allow the user to override the detection of our physical device by passing
+# it in. No checking is done, if the user gives us a bogus dev, it's
+# their problem.
+[ -n "${PHYSDEV}" ] && REALDEVICE="$PHYSDEV"
+
. /etc/sysconfig/network
# Check to make sure the device is actually up
check_device_down ${DEVICE} && exit 0
-# If we are a PKey device, we need to munge a few things
+# If we are a P_Key device, we need to munge a few things
if [ "${VLAN}" = yes ]; then
- [ -z "${VLAN_ID}" ] && {
- echo "VLAN=yes requires a VLAN_ID"
- exit 1
- }
- # Normalize our VLAN_ID to have the high bit set
- NEW_VLAN_ID=`printf "0x%04x" $(( 0x8000 | ${VLAN_ID} ))`
- NEW_VLAN_NAME=`printf "%04x" ${NEW_VLAN_ID}`
- [ "${DEVICE}" != "${REALDEVICE}.${NEW_VLAN_NAME}" ] && {
- echo "The high bit of the VLAN_ID must be set and the DEVICE="
- echo "entry in the config file must be the same as the PARENTDEVICE.VLAN_ID"
- echo "Configured DEVICE=$DEVICE"
- echo "Configured PARENTDEVICE=$PARENTDEVICE"
- echo "Calculated REALDEVICE=$REALDEVICE"
- echo "Configured VLAN_ID=$VLAN_ID"
- echo "Calculated VLAN_ID=$NEW_VLAN_ID"
+ [ -z "${VLAN_ID}" ] && {
+ net_log $"InfiniBand IPoIB device: VLAN=yes requires a VLAN_ID"
+ exit 1
+ }
+ [ -z "${PHYSDEV}" ] && {
+ net_log $"InfiniBand IPoIB device: VLAN=yes requires a PHYSDEV"
+ exit 1
+ }
+ # Normalize our VLAN_ID to have the high bit set
+ NEW_VLAN_ID=`printf "0x%04x" $(( 0x8000 | ${VLAN_ID} ))`
+ NEW_VLAN_NAME=`printf "%04x" ${NEW_VLAN_ID}`
+ [ "${DEVICE}" != "${PHYSDEV}.${NEW_VLAN_NAME}" ] && {
+ net_log $"Configured DEVICE name does not match what new device name would be. This
+is most likely because once the VLAN_ID was normalized, it no longer
+resulted in the expected device naming, and so the DEVICE entry in the
+config file needs to be updated to match. This can also be caused by
+giving VLAN_ID as a hex number but without using the mandatory 0x prefix.
+ Configured DEVICE=$DEVICE
+ Configured PHYSDEV=$PHYSDEV
+ Configured VLAN_ID=$VLAN_ID
+ Calculated VLAN_ID=$NEW_VLAN_ID
+ Calculated name=${PHYSDEV}.${NEW_VLAN_NAME}"
exit 1
}
[ -d "/sys/class/net/${DEVICE}" ] || exit 0
# When we get to downing the IP address, we need REALDEVICE to
- # point to our PKey VLAN device
+ # point to our P_Key VLAN device
REALDEVICE="${DEVICE}"
fi
diff --git a/rdma.spec b/rdma.spec
index a7e02e9..bdab545 100644
--- a/rdma.spec
+++ b/rdma.spec
@@ -6,7 +6,7 @@
Summary: Infiniband/iWARP Kernel Module Initializer
Name: rdma
Version: 2.0
-Release: 10%{?dist}
+Release: 11%{?dist}
License: GPLv2+
Group: System Environment/Base
Source0: rdma.conf
@@ -75,6 +75,9 @@ rm -rf %{buildroot}
/lib/udev/rules.d/*
%changelog
+* Thu May 23 2013 Doug Ledford <dledford at redhat.com> - 2.0-11
+- Oops, didn't update ifdown-ib to match latest ifup-ib
+
* Thu May 23 2013 Doug Ledford <dledford at redhat.com> - 2.0-10
- More fixups for ifup-ib and P_Key support
- Move persistent-ipoib.rules to 70 instead of 60 to match prior
More information about the scm-commits
mailing list