|
Harald Hoyer |
3610a1 |
From 8c3e65d1cecc6e3ba634efdabe5f00b38ac606d8 Mon Sep 17 00:00:00 2001
|
|
Harald Hoyer |
3610a1 |
From: Harald Hoyer <harald@hoyer.xyz>
|
|
Harald Hoyer |
3610a1 |
Date: Tue, 19 Dec 2017 15:43:13 +0100
|
|
Harald Hoyer |
3610a1 |
Subject: [PATCH] Merge pull request #318 from danimo/fcoe-fixes
|
|
Harald Hoyer |
3610a1 |
|
|
Harald Hoyer |
3610a1 |
All FCOE-related SUSE patches, rebased on top of master
|
|
Harald Hoyer |
3610a1 |
---
|
|
Harald Hoyer |
3610a1 |
dracut.cmdline.7.asc | 8 ++--
|
|
Harald Hoyer |
3610a1 |
modules.d/95fcoe/fcoe-genrules.sh | 6 ++-
|
|
Harald Hoyer |
3610a1 |
modules.d/95fcoe/fcoe-up.sh | 43 ++++++++++++++--------
|
|
Harald Hoyer |
3610a1 |
modules.d/95fcoe/module-setup.sh | 77 +++++++++++++++++++++++----------------
|
|
Harald Hoyer |
3610a1 |
modules.d/95fcoe/parse-fcoe.sh | 22 +++++++++--
|
|
Harald Hoyer |
3610a1 |
modules.d/95fcoe/stop-fcoe.sh | 6 +++
|
|
Harald Hoyer |
3610a1 |
6 files changed, 105 insertions(+), 57 deletions(-)
|
|
Harald Hoyer |
3610a1 |
|
|
Harald Hoyer |
3610a1 |
diff --git a/dracut.cmdline.7.asc b/dracut.cmdline.7.asc
|
|
Harald Hoyer |
3610a1 |
index 63c6c10f..b5f6f0f6 100644
|
|
Harald Hoyer |
3610a1 |
--- a/dracut.cmdline.7.asc
|
|
Harald Hoyer |
3610a1 |
+++ b/dracut.cmdline.7.asc
|
|
Harald Hoyer |
3610a1 |
@@ -755,10 +755,12 @@ iscsistart -b --param node.session.timeo.replacement_timeout=30
|
|
Harald Hoyer |
3610a1 |
|
|
Harald Hoyer |
3610a1 |
FCoE
|
|
Harald Hoyer |
3610a1 |
~~~~
|
|
Harald Hoyer |
3610a1 |
-**fcoe=**__<edd|interface|MAC>__:__{dcb|nodcb}__::
|
|
Harald Hoyer |
3610a1 |
+**fcoe=**__<edd|interface|MAC>__:__{dcb|nodcb}__:__{fabric|vn2vn}__::
|
|
Harald Hoyer |
3610a1 |
Try to connect to a FCoE SAN through the NIC specified by _<interface>_ or
|
|
Harald Hoyer |
3610a1 |
- _<MAC>_ or EDD settings. For the second argument, currently only nodcb is
|
|
Harald Hoyer |
3610a1 |
- supported. This parameter can be specified multiple times.
|
|
Harald Hoyer |
3610a1 |
+ _<MAC>_ or EDD settings. The second argument specifies if DCB
|
|
Harald Hoyer |
3610a1 |
+ should be used. The optional third argument specifies whether
|
|
Harald Hoyer |
3610a1 |
+ fabric or VN2VN mode should be used.
|
|
Harald Hoyer |
3610a1 |
+ This parameter can be specified multiple times.
|
|
Harald Hoyer |
3610a1 |
+
|
|
Harald Hoyer |
3610a1 |
NOTE: letters in the MAC-address must be lowercase!
|
|
Harald Hoyer |
3610a1 |
|
|
Harald Hoyer |
3610a1 |
diff --git a/modules.d/95fcoe/fcoe-genrules.sh b/modules.d/95fcoe/fcoe-genrules.sh
|
|
Harald Hoyer |
3610a1 |
index eb58601b..445a09c2 100755
|
|
Harald Hoyer |
3610a1 |
--- a/modules.d/95fcoe/fcoe-genrules.sh
|
|
Harald Hoyer |
3610a1 |
+++ b/modules.d/95fcoe/fcoe-genrules.sh
|
|
Harald Hoyer |
3610a1 |
@@ -7,8 +7,10 @@
|
|
Harald Hoyer |
3610a1 |
# Write udev rules
|
|
Harald Hoyer |
3610a1 |
{
|
|
Harald Hoyer |
3610a1 |
if [ -n "$fcoe_mac" ] ; then
|
|
Harald Hoyer |
3610a1 |
- printf 'ACTION=="add", SUBSYSTEM=="net", ATTR{address}=="%s", RUN+="/sbin/initqueue --onetime --unique --name fcoe-up-$env{INTERFACE} /sbin/fcoe-up $env{INTERFACE} %s"\n' "$fcoe_mac" "$fcoe_dcb"
|
|
Harald Hoyer |
3610a1 |
+ printf 'ACTION=="add", SUBSYSTEM=="net", ATTR{address}=="%s", RUN+="/sbin/initqueue --onetime --unique --name fcoe-up-$env{INTERFACE} /sbin/fcoe-up $env{INTERFACE} %s %s"\n' "$fcoe_mac" "$fcoe_dcb" "$fcoe_mode"
|
|
Harald Hoyer |
3610a1 |
+ printf 'ACTION=="add", SUBSYSTEM=="net", ATTR{address}=="%s", RUN+="/sbin/initqueue --onetime --timeout --unique --name fcoe-timeout-$env{INTERFACE} /sbin/fcoe-up $env{INTERFACE} %s %s"\n' "$fcoe_mac" "$fcoe_dcb" "$fcoe_mode"
|
|
Harald Hoyer |
3610a1 |
else
|
|
Harald Hoyer |
3610a1 |
- printf 'ACTION=="add", SUBSYSTEM=="net", NAME=="%s", RUN+="/sbin/initqueue --onetime --unique --name fcoe-up-$env{INTERFACE} /sbin/fcoe-up $env{INTERFACE} %s"\n' "$fcoe_interface" "$fcoe_dcb"
|
|
Harald Hoyer |
3610a1 |
+ printf 'ACTION=="add", SUBSYSTEM=="net", NAME=="%s", RUN+="/sbin/initqueue --onetime --unique --name fcoe-up-$env{INTERFACE} /sbin/fcoe-up $env{INTERFACE} %s %s"\n' "$fcoe_interface" "$fcoe_dcb" "$fcoe_mode"
|
|
Harald Hoyer |
3610a1 |
+ printf 'ACTION=="add", SUBSYSTEM=="net", NAME=="%s", RUN+="/sbin/initqueue --onetime --timeout --unique --name fcoe-timeout-$env{INTERFACE} /sbin/fcoe-up $env{INTERFACE} %s %s"\n' "$fcoe_interface" "$fcoe_dcb" "$fcoe_mode"
|
|
Harald Hoyer |
3610a1 |
fi
|
|
Harald Hoyer |
3610a1 |
} >> /etc/udev/rules.d/92-fcoe.rules
|
|
Harald Hoyer |
3610a1 |
diff --git a/modules.d/95fcoe/fcoe-up.sh b/modules.d/95fcoe/fcoe-up.sh
|
|
Harald Hoyer |
3610a1 |
index ddc87b1c..570cd848 100755
|
|
Harald Hoyer |
3610a1 |
--- a/modules.d/95fcoe/fcoe-up.sh
|
|
Harald Hoyer |
3610a1 |
+++ b/modules.d/95fcoe/fcoe-up.sh
|
|
Harald Hoyer |
3610a1 |
@@ -1,7 +1,7 @@
|
|
Harald Hoyer |
3610a1 |
#!/bin/sh
|
|
Harald Hoyer |
3610a1 |
#
|
|
Harald Hoyer |
3610a1 |
# We get called like this:
|
|
Harald Hoyer |
3610a1 |
-# fcoe-up <network-device> <dcb|nodcb>
|
|
Harald Hoyer |
3610a1 |
+# fcoe-up <network-device> <dcb|nodcb> <fabric|vn2vn>
|
|
Harald Hoyer |
3610a1 |
#
|
|
Harald Hoyer |
3610a1 |
# Note currently only nodcb is supported, the dcb option is reserved for
|
|
Harald Hoyer |
3610a1 |
# future use.
|
|
Harald Hoyer |
3610a1 |
@@ -15,6 +15,7 @@ type ip_to_var >/dev/null 2>&1 || . /lib/net-lib.sh
|
|
Harald Hoyer |
3610a1 |
|
|
Harald Hoyer |
3610a1 |
netif=$1
|
|
Harald Hoyer |
3610a1 |
dcb=$2
|
|
Harald Hoyer |
3610a1 |
+mode=$3
|
|
Harald Hoyer |
3610a1 |
vlan="yes"
|
|
Harald Hoyer |
3610a1 |
|
|
Harald Hoyer |
3610a1 |
iflink=$(cat /sys/class/net/$netif/iflink)
|
|
Harald Hoyer |
3610a1 |
@@ -27,10 +28,18 @@ fi
|
|
Harald Hoyer |
3610a1 |
ip link set dev $netif up
|
|
Harald Hoyer |
3610a1 |
linkup "$netif"
|
|
Harald Hoyer |
3610a1 |
|
|
Harald Hoyer |
3610a1 |
+# Some fcoemon implementations expect --syslog=true
|
|
Harald Hoyer |
3610a1 |
+syslogopt="--syslog"
|
|
Harald Hoyer |
3610a1 |
+if fcoemon -h|grep syslog|grep -q yes; then
|
|
Harald Hoyer |
3610a1 |
+ fcoemonyes="$syslogopt=yes"
|
|
Harald Hoyer |
3610a1 |
+fi
|
|
Harald Hoyer |
3610a1 |
+
|
|
Harald Hoyer |
3610a1 |
+
|
|
Harald Hoyer |
3610a1 |
netdriver=$(readlink -f /sys/class/net/$netif/device/driver)
|
|
Harald Hoyer |
3610a1 |
netdriver=${netdriver##*/}
|
|
Harald Hoyer |
3610a1 |
|
|
Harald Hoyer |
3610a1 |
write_fcoemon_cfg() {
|
|
Harald Hoyer |
3610a1 |
+ [ -f /etc/fcoe/cfg-$netif ] && return
|
|
Harald Hoyer |
3610a1 |
echo FCOE_ENABLE=\"yes\" > /etc/fcoe/cfg-$netif
|
|
Harald Hoyer |
3610a1 |
if [ "$dcb" = "dcb" ]; then
|
|
Harald Hoyer |
3610a1 |
echo DCB_REQUIRED=\"yes\" >> /etc/fcoe/cfg-$netif
|
|
Harald Hoyer |
3610a1 |
@@ -42,9 +51,23 @@ write_fcoemon_cfg() {
|
|
Harald Hoyer |
3610a1 |
else
|
|
Harald Hoyer |
3610a1 |
echo AUTO_VLAN=\"no\" >> /etc/fcoe/cfg-$netif
|
|
Harald Hoyer |
3610a1 |
fi
|
|
Harald Hoyer |
3610a1 |
- echo MODE=\"fabric\" >> /etc/fcoe/cfg-$netif
|
|
Harald Hoyer |
3610a1 |
+ if [ "$mode" = "vn2vn" ] ; then
|
|
Harald Hoyer |
3610a1 |
+ echo MODE=\"vn2vn\" >> /etc/fcoe/cfg-$netif
|
|
Harald Hoyer |
3610a1 |
+ else
|
|
Harald Hoyer |
3610a1 |
+ echo MODE=\"fabric\" >> /etc/fcoe/cfg-$netif
|
|
Harald Hoyer |
3610a1 |
+ fi
|
|
Harald Hoyer |
3610a1 |
}
|
|
Harald Hoyer |
3610a1 |
|
|
Harald Hoyer |
3610a1 |
+if [ "$netdriver" = "bnx2x" ]; then
|
|
Harald Hoyer |
3610a1 |
+ # If driver is bnx2x, do not use /sys/module/fcoe/parameters/create but fipvlan
|
|
Harald Hoyer |
3610a1 |
+ modprobe 8021q
|
|
Harald Hoyer |
3610a1 |
+ udevadm settle --timeout=30
|
|
Harald Hoyer |
3610a1 |
+ # Sleep for 13 s to allow dcb negotiation
|
|
Harald Hoyer |
3610a1 |
+ sleep 13
|
|
Harald Hoyer |
3610a1 |
+ fipvlan "$netif" -c -s
|
|
Harald Hoyer |
3610a1 |
+ need_shutdown
|
|
Harald Hoyer |
3610a1 |
+ exit
|
|
Harald Hoyer |
3610a1 |
+fi
|
|
Harald Hoyer |
3610a1 |
if [ "$dcb" = "dcb" ]; then
|
|
Harald Hoyer |
3610a1 |
# wait for lldpad to be ready
|
|
Harald Hoyer |
3610a1 |
i=0
|
|
Harald Hoyer |
3610a1 |
@@ -77,20 +100,8 @@ if [ "$dcb" = "dcb" ]; then
|
|
Harald Hoyer |
3610a1 |
done
|
|
Harald Hoyer |
3610a1 |
|
|
Harald Hoyer |
3610a1 |
sleep 1
|
|
Harald Hoyer |
3610a1 |
-
|
|
Harald Hoyer |
3610a1 |
- write_fcoemon_cfg
|
|
Harald Hoyer |
3610a1 |
- fcoemon --syslog
|
|
Harald Hoyer |
3610a1 |
-elif [ "$netdriver" = "bnx2x" ]; then
|
|
Harald Hoyer |
3610a1 |
- # If driver is bnx2x, do not use /sys/module/fcoe/parameters/create but fipvlan
|
|
Harald Hoyer |
3610a1 |
- modprobe 8021q
|
|
Harald Hoyer |
3610a1 |
- udevadm settle --timeout=30
|
|
Harald Hoyer |
3610a1 |
- # Sleep for 13 s to allow dcb negotiation
|
|
Harald Hoyer |
3610a1 |
- sleep 13
|
|
Harald Hoyer |
3610a1 |
- fipvlan "$netif" -c -s
|
|
Harald Hoyer |
3610a1 |
-else
|
|
Harald Hoyer |
3610a1 |
- vlan="no"
|
|
Harald Hoyer |
3610a1 |
- write_fcoemon_cfg
|
|
Harald Hoyer |
3610a1 |
- fcoemon --syslog
|
|
Harald Hoyer |
3610a1 |
fi
|
|
Harald Hoyer |
3610a1 |
+write_fcoemon_cfg
|
|
Harald Hoyer |
3610a1 |
+fcoemon $syslogopt
|
|
Harald Hoyer |
3610a1 |
|
|
Harald Hoyer |
3610a1 |
need_shutdown
|
|
Harald Hoyer |
3610a1 |
diff --git a/modules.d/95fcoe/module-setup.sh b/modules.d/95fcoe/module-setup.sh
|
|
Harald Hoyer |
3610a1 |
index eabb21c7..63f45b52 100755
|
|
Harald Hoyer |
3610a1 |
--- a/modules.d/95fcoe/module-setup.sh
|
|
Harald Hoyer |
3610a1 |
+++ b/modules.d/95fcoe/module-setup.sh
|
|
Harald Hoyer |
3610a1 |
@@ -41,42 +41,52 @@ get_vlan_parent() {
|
|
Harald Hoyer |
3610a1 |
|
|
Harald Hoyer |
3610a1 |
# called by dracut
|
|
Harald Hoyer |
3610a1 |
cmdline() {
|
|
Harald Hoyer |
3610a1 |
-
|
|
Harald Hoyer |
3610a1 |
- for c in /sys/bus/fcoe/devices/ctlr_* ; do
|
|
Harald Hoyer |
3610a1 |
- [ -L $c ] || continue
|
|
Harald Hoyer |
3610a1 |
- read enabled < $c/enabled
|
|
Harald Hoyer |
3610a1 |
- [ $enabled -eq 0 ] && continue
|
|
Harald Hoyer |
3610a1 |
- d=$(cd -P $c; echo $PWD)
|
|
Harald Hoyer |
3610a1 |
- i=${d%/*}
|
|
Harald Hoyer |
3610a1 |
- read mac < ${i}/address
|
|
Harald Hoyer |
3610a1 |
- s=$(dcbtool gc ${i##*/} dcb | sed -n 's/^DCB State:\t*\(.*\)/\1/p')
|
|
Harald Hoyer |
3610a1 |
- if [ -z "$s" ] ; then
|
|
Harald Hoyer |
3610a1 |
- p=$(get_vlan_parent ${i})
|
|
Harald Hoyer |
3610a1 |
- if [ "$p" ] ; then
|
|
Harald Hoyer |
3610a1 |
- s=$(dcbtool gc ${p} dcb | sed -n 's/^DCB State:\t*\(.*\)/\1/p')
|
|
Harald Hoyer |
3610a1 |
+ {
|
|
Harald Hoyer |
3610a1 |
+ for c in /sys/bus/fcoe/devices/ctlr_* ; do
|
|
Harald Hoyer |
3610a1 |
+ [ -L $c ] || continue
|
|
Harald Hoyer |
3610a1 |
+ read enabled < $c/enabled
|
|
Harald Hoyer |
3610a1 |
+ read mode < $c/mode
|
|
Harald Hoyer |
3610a1 |
+ [ $enabled -eq 0 ] && continue
|
|
Harald Hoyer |
3610a1 |
+ if [ $mode = "VN2VN" ] ; then
|
|
Harald Hoyer |
3610a1 |
+ mode="vn2vn"
|
|
Harald Hoyer |
3610a1 |
+ else
|
|
Harald Hoyer |
3610a1 |
+ mode="fabric"
|
|
Harald Hoyer |
3610a1 |
+ fi
|
|
Harald Hoyer |
3610a1 |
+ d=$(cd -P $c; echo $PWD)
|
|
Harald Hoyer |
3610a1 |
+ i=${d%/*}
|
|
Harald Hoyer |
3610a1 |
+ ifname=${i##*/}
|
|
Harald Hoyer |
3610a1 |
+ read mac < ${i}/address
|
|
Harald Hoyer |
3610a1 |
+ s=$(dcbtool gc ${i##*/} dcb 2>/dev/null | sed -n 's/^DCB State:\t*\(.*\)/\1/p')
|
|
Harald Hoyer |
3610a1 |
+ if [ -z "$s" ] ; then
|
|
Harald Hoyer |
3610a1 |
+ p=$(get_vlan_parent ${i})
|
|
Harald Hoyer |
3610a1 |
+ if [ "$p" ] ; then
|
|
Harald Hoyer |
3610a1 |
+ s=$(dcbtool gc ${p} dcb 2>/dev/null | sed -n 's/^DCB State:\t*\(.*\)/\1/p')
|
|
Harald Hoyer |
3610a1 |
+ ifname=${p##*/}
|
|
Harald Hoyer |
3610a1 |
+ fi
|
|
Harald Hoyer |
3610a1 |
+ fi
|
|
Harald Hoyer |
3610a1 |
+ if [ "$s" = "on" ] ; then
|
|
Harald Hoyer |
3610a1 |
+ dcb="dcb"
|
|
Harald Hoyer |
3610a1 |
+ else
|
|
Harald Hoyer |
3610a1 |
+ dcb="nodcb"
|
|
Harald Hoyer |
3610a1 |
fi
|
|
Harald Hoyer |
3610a1 |
- fi
|
|
Harald Hoyer |
3610a1 |
- if [ "$s" = "on" ] ; then
|
|
Harald Hoyer |
3610a1 |
- dcb="dcb"
|
|
Harald Hoyer |
3610a1 |
- else
|
|
Harald Hoyer |
3610a1 |
- dcb="nodcb"
|
|
Harald Hoyer |
3610a1 |
- fi
|
|
Harald Hoyer |
3610a1 |
|
|
Harald Hoyer |
3610a1 |
- # Some Combined Network Adapters(CNAs) implement DCB in firmware.
|
|
Harald Hoyer |
3610a1 |
- # Do not run software-based DCB or LLDP on CNAs that implement DCB.
|
|
Harald Hoyer |
3610a1 |
- # If the network interface provides hardware DCB/DCBX capabilities,
|
|
Harald Hoyer |
3610a1 |
- # DCB_REQUIRED in "/etc/fcoe/cfg-xxx" is expected to set to "no".
|
|
Harald Hoyer |
3610a1 |
- #
|
|
Harald Hoyer |
3610a1 |
- # Force "nodcb" if there's any DCB_REQUIRED="no"(child or vlan parent).
|
|
Harald Hoyer |
3610a1 |
- grep -q "^[[:blank:]]*DCB_REQUIRED=\"no\"" /etc/fcoe/cfg-${i##*/} &>/dev/null
|
|
Harald Hoyer |
3610a1 |
- [ $? -eq 0 ] && dcb="nodcb"
|
|
Harald Hoyer |
3610a1 |
- if [ "$p" ] ; then
|
|
Harald Hoyer |
3610a1 |
- grep -q "^[[:blank:]]*DCB_REQUIRED=\"no\"" /etc/fcoe/cfg-${p} &>/dev/null
|
|
Harald Hoyer |
3610a1 |
+ # Some Combined Network Adapters(CNAs) implement DCB in firmware.
|
|
Harald Hoyer |
3610a1 |
+ # Do not run software-based DCB or LLDP on CNAs that implement DCB.
|
|
Harald Hoyer |
3610a1 |
+ # If the network interface provides hardware DCB/DCBX capabilities,
|
|
Harald Hoyer |
3610a1 |
+ # DCB_REQUIRED in "/etc/fcoe/cfg-xxx" is expected to set to "no".
|
|
Harald Hoyer |
3610a1 |
+ #
|
|
Harald Hoyer |
3610a1 |
+ # Force "nodcb" if there's any DCB_REQUIRED="no"(child or vlan parent).
|
|
Harald Hoyer |
3610a1 |
+ grep -q "^[[:blank:]]*DCB_REQUIRED=\"no\"" /etc/fcoe/cfg-${i##*/} &>/dev/null
|
|
Harald Hoyer |
3610a1 |
[ $? -eq 0 ] && dcb="nodcb"
|
|
Harald Hoyer |
3610a1 |
- fi
|
|
Harald Hoyer |
3610a1 |
+ if [ "$p" ] ; then
|
|
Harald Hoyer |
3610a1 |
+ grep -q "^[[:blank:]]*DCB_REQUIRED=\"no\"" /etc/fcoe/cfg-${p} &>/dev/null
|
|
Harald Hoyer |
3610a1 |
+ [ $? -eq 0 ] && dcb="nodcb"
|
|
Harald Hoyer |
3610a1 |
+ fi
|
|
Harald Hoyer |
3610a1 |
|
|
Harald Hoyer |
3610a1 |
- echo "fcoe=${mac}:${dcb}"
|
|
Harald Hoyer |
3610a1 |
- done
|
|
Harald Hoyer |
3610a1 |
+ echo "ifname=${ifname}:${mac}"
|
|
Harald Hoyer |
3610a1 |
+ echo "fcoe=${ifname}:${dcb}:${mode}"
|
|
Harald Hoyer |
3610a1 |
+ done
|
|
Harald Hoyer |
3610a1 |
+ } | sort | uniq
|
|
Harald Hoyer |
3610a1 |
}
|
|
Harald Hoyer |
3610a1 |
|
|
Harald Hoyer |
3610a1 |
# called by dracut
|
|
Harald Hoyer |
3610a1 |
@@ -94,12 +104,15 @@ install() {
|
|
Harald Hoyer |
3610a1 |
local _fcoeconf=$(cmdline)
|
|
Harald Hoyer |
3610a1 |
[[ $_fcoeconf ]] && printf "%s\n" "$_fcoeconf" >> "${initdir}/etc/cmdline.d/95fcoe.conf"
|
|
Harald Hoyer |
3610a1 |
fi
|
|
Harald Hoyer |
3610a1 |
+ inst_multiple /etc/fcoe/cfg-*
|
|
Harald Hoyer |
3610a1 |
+
|
|
Harald Hoyer |
3610a1 |
inst "$moddir/fcoe-up.sh" "/sbin/fcoe-up"
|
|
Harald Hoyer |
3610a1 |
inst "$moddir/fcoe-edd.sh" "/sbin/fcoe-edd"
|
|
Harald Hoyer |
3610a1 |
inst "$moddir/fcoe-genrules.sh" "/sbin/fcoe-genrules.sh"
|
|
Harald Hoyer |
3610a1 |
inst_hook pre-trigger 03 "$moddir/lldpad.sh"
|
|
Harald Hoyer |
3610a1 |
inst_hook cmdline 99 "$moddir/parse-fcoe.sh"
|
|
Harald Hoyer |
3610a1 |
inst_hook cleanup 90 "$moddir/cleanup-fcoe.sh"
|
|
Harald Hoyer |
3610a1 |
+ inst_hook shutdown 40 "$moddir/stop-fcoe.sh"
|
|
Harald Hoyer |
3610a1 |
dracut_need_initqueue
|
|
Harald Hoyer |
3610a1 |
}
|
|
Harald Hoyer |
3610a1 |
|
|
Harald Hoyer |
3610a1 |
diff --git a/modules.d/95fcoe/parse-fcoe.sh b/modules.d/95fcoe/parse-fcoe.sh
|
|
Harald Hoyer |
3610a1 |
index 9f471848..75cca9a5 100755
|
|
Harald Hoyer |
3610a1 |
--- a/modules.d/95fcoe/parse-fcoe.sh
|
|
Harald Hoyer |
3610a1 |
+++ b/modules.d/95fcoe/parse-fcoe.sh
|
|
Harald Hoyer |
3610a1 |
@@ -1,8 +1,8 @@
|
|
Harald Hoyer |
3610a1 |
#!/bin/sh
|
|
Harald Hoyer |
3610a1 |
#
|
|
Harald Hoyer |
3610a1 |
# Supported formats:
|
|
Harald Hoyer |
3610a1 |
-# fcoe=<networkdevice>:<dcb|nodcb>
|
|
Harald Hoyer |
3610a1 |
-# fcoe=<macaddress>:<dcb|nodcb>
|
|
Harald Hoyer |
3610a1 |
+# fcoe=<networkdevice>:<dcb|nodcb>:<fabric|vn2vn>
|
|
Harald Hoyer |
3610a1 |
+# fcoe=<macaddress>:<dcb|nodcb>:<fabric|vn2vn>
|
|
Harald Hoyer |
3610a1 |
#
|
|
Harald Hoyer |
3610a1 |
# Note currently only nodcb is supported, the dcb option is reserved for
|
|
Harald Hoyer |
3610a1 |
# future use.
|
|
Harald Hoyer |
3610a1 |
@@ -10,8 +10,8 @@
|
|
Harald Hoyer |
3610a1 |
# Note letters in the macaddress must be lowercase!
|
|
Harald Hoyer |
3610a1 |
#
|
|
Harald Hoyer |
3610a1 |
# Examples:
|
|
Harald Hoyer |
3610a1 |
-# fcoe=eth0:nodcb
|
|
Harald Hoyer |
3610a1 |
-# fcoe=4a:3f:4c:04:f8:d7:nodcb
|
|
Harald Hoyer |
3610a1 |
+# fcoe=eth0:nodcb:vn2vn
|
|
Harald Hoyer |
3610a1 |
+# fcoe=4a:3f:4c:04:f8:d7:nodcb:fabric
|
|
Harald Hoyer |
3610a1 |
|
|
Harald Hoyer |
3610a1 |
[ -z "$fcoe" ] && fcoe=$(getarg fcoe=)
|
|
Harald Hoyer |
3610a1 |
|
|
Harald Hoyer |
3610a1 |
@@ -32,11 +32,25 @@ parse_fcoe_opts() {
|
|
Harald Hoyer |
3610a1 |
2)
|
|
Harald Hoyer |
3610a1 |
fcoe_interface=$1
|
|
Harald Hoyer |
3610a1 |
fcoe_dcb=$2
|
|
Harald Hoyer |
3610a1 |
+ fcoe_mode="fabric"
|
|
Harald Hoyer |
3610a1 |
+ return 0
|
|
Harald Hoyer |
3610a1 |
+ ;;
|
|
Harald Hoyer |
3610a1 |
+ 3)
|
|
Harald Hoyer |
3610a1 |
+ fcoe_interface=$1
|
|
Harald Hoyer |
3610a1 |
+ fcoe_dcb=$2
|
|
Harald Hoyer |
3610a1 |
+ fcoe_mode=$3
|
|
Harald Hoyer |
3610a1 |
return 0
|
|
Harald Hoyer |
3610a1 |
;;
|
|
Harald Hoyer |
3610a1 |
7)
|
|
Harald Hoyer |
3610a1 |
fcoe_mac=$1:$2:$3:$4:$5:$6
|
|
Harald Hoyer |
3610a1 |
fcoe_dcb=$7
|
|
Harald Hoyer |
3610a1 |
+ fcoe_mode="fabric"
|
|
Harald Hoyer |
3610a1 |
+ return 0
|
|
Harald Hoyer |
3610a1 |
+ ;;
|
|
Harald Hoyer |
3610a1 |
+ 8)
|
|
Harald Hoyer |
3610a1 |
+ fcoe_mac=$1:$2:$3:$4:$5:$6
|
|
Harald Hoyer |
3610a1 |
+ fcoe_dcb=$7
|
|
Harald Hoyer |
3610a1 |
+ fcoe_mode=$8
|
|
Harald Hoyer |
3610a1 |
return 0
|
|
Harald Hoyer |
3610a1 |
;;
|
|
Harald Hoyer |
3610a1 |
*)
|
|
Harald Hoyer |
3610a1 |
diff --git a/modules.d/95fcoe/stop-fcoe.sh b/modules.d/95fcoe/stop-fcoe.sh
|
|
Harald Hoyer |
3610a1 |
new file mode 100755
|
|
Harald Hoyer |
3610a1 |
index 00000000..d2462b34
|
|
Harald Hoyer |
3610a1 |
--- /dev/null
|
|
Harald Hoyer |
3610a1 |
+++ b/modules.d/95fcoe/stop-fcoe.sh
|
|
Harald Hoyer |
3610a1 |
@@ -0,0 +1,6 @@
|
|
Harald Hoyer |
3610a1 |
+#!/bin/bash
|
|
Harald Hoyer |
3610a1 |
+
|
|
Harald Hoyer |
3610a1 |
+for f in /sys/bus/fcoe/devices/ctlr_* ; do
|
|
Harald Hoyer |
3610a1 |
+ [ -e $f ] || continue
|
|
Harald Hoyer |
3610a1 |
+ echo 0 > $f/enabled
|
|
Harald Hoyer |
3610a1 |
+done
|
|
Harald Hoyer |
3610a1 |
|