File tree Expand file tree Collapse file tree 3 files changed +42
-1
lines changed
Expand file tree Collapse file tree 3 files changed +42
-1
lines changed Original file line number Diff line number Diff line change @@ -71,7 +71,11 @@ if [ ! -x ${OTHERSCRIPT} ]; then
7171fi
7272
7373if [ ! -x ${OTHERSCRIPT} ]; then
74- OTHERSCRIPT=" /etc/sysconfig/network-scripts/ifdown-eth"
74+ if is_true " ${PKEY} " && [ " ${TYPE} " = " Infiniband" ] ; then
75+ OTHERSCRIPT=" /etc/sysconfig/network-scripts/ifdown-ib"
76+ else
77+ OTHERSCRIPT=" /etc/sysconfig/network-scripts/ifdown-eth"
78+ fi
7579fi
7680
7781exec ${OTHERSCRIPT} ${CONFIG} $2
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ cd /etc/sysconfig/network-scripts
4+ . ./network-functions
5+ CONFIG=${1}
6+ source_config
7+
8+ if is_true " ${PKEY} " && [ " ${TYPE} " = " Infiniband" ] ; then
9+ # IPoIB support
10+ if [ -d /sys/devices/virtual/net/${DEVICE} ]; then
11+ ip link del " ${DEVICE} "
12+ fi
13+ fi
14+ exit 0
Original file line number Diff line number Diff line change @@ -149,6 +149,29 @@ if is_true "${VLAN}" && is_false "$ISALIAS" && [ -n "$DEVICE" ]; then
149149 --prefix " /proc/sys/net/ipv6/conf/${DEVICE} "
150150fi
151151
152+ # IPoIB support
153+ if is_true " ${PKEY} " && [ " ${TYPE} " = " Infiniband" ] ; then
154+ MATCH=' ^.+\.[0-9]{1,4}$'
155+ if [[ " ${DEVICE} " =~ $MATCH ]]; then
156+ PHYSDEV=${DEVICE% .* }
157+ fi
158+ if ! modprobe ib_ipoib > /dev/null 2>&1 ; then
159+ net_log $" No IPoIB support available in kernel for device ${DEVICE} "
160+ exit 1
161+ fi
162+ if [ -d /sys/devices/virtual/net/${DEVICE} ]; then
163+ check_device_down ${DEVICE} && { ip -o link set dev ${DEVICE} up; }
164+ else
165+ ip link add dev ${DEVICE} link ${PHYSDEV} type ipoib pkey ${PKEY_ID} || {
166+ (/usr/bin/logger -p daemon.info -t ifup \$ " ERROR: could not add
167+ pkey ${PKEY_ID} as ${DEVICE} on dev ${PHYSDEV} " & ) &
168+ net_log $" ERROR: could not add pkey ${PKEY_ID} as ${DEVICE} on dev ${PHYSDEV} "
169+ exit 1
170+ }
171+ fi
172+ exit 0
173+ fi
174+
152175if [ " ${BOOTPROTO} " = " bootp" -o " ${BOOTPROTO} " = " dhcp" ]; then
153176 DYNCONFIG=true
154177fi
You can’t perform that action at this time.
0 commit comments