Browse Source

95fcoe: Allow to specify the FCoE mode via the fcoe= parameter

FCoE can run in Fabric (ie FCF) or VN2VN mode, so we should allowing
to set this parameter from the commandline, too.

Signed-off-by: Hannes Reinecke <hare@suse.com>
master
Hannes Reinecke 9 years ago committed by Daniel Molkentin
parent
commit
c75196e11e
  1. 8
      dracut.cmdline.7.asc
  2. 4
      modules.d/95fcoe/fcoe-genrules.sh
  3. 7
      modules.d/95fcoe/fcoe-up.sh
  4. 8
      modules.d/95fcoe/module-setup.sh
  5. 22
      modules.d/95fcoe/parse-fcoe.sh

8
dracut.cmdline.7.asc

@ -755,10 +755,12 @@ iscsistart -b --param node.session.timeo.replacement_timeout=30 @@ -755,10 +755,12 @@ iscsistart -b --param node.session.timeo.replacement_timeout=30

FCoE
~~~~
**fcoe=**__<edd|interface|MAC>__:__{dcb|nodcb}__::
**fcoe=**__<edd|interface|MAC>__:__{dcb|nodcb}__:__{fabric|vn2vn}__::
Try to connect to a FCoE SAN through the NIC specified by _<interface>_ or
_<MAC>_ or EDD settings. For the second argument, currently only nodcb is
supported. This parameter can be specified multiple times.
_<MAC>_ or EDD settings. The second argument specifies if DCB
should be used. The optional third argument specifies whether
fabric or VN2VN mode should be used.
This parameter can be specified multiple times.
+
NOTE: letters in the MAC-address must be lowercase!


4
modules.d/95fcoe/fcoe-genrules.sh

@ -7,8 +7,8 @@ @@ -7,8 +7,8 @@
# Write udev rules
{
if [ -n "$fcoe_mac" ] ; then
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"
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" "$fcoe_mode"
else
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"
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" "$fcoe_mode"
fi
} >> /etc/udev/rules.d/92-fcoe.rules

7
modules.d/95fcoe/fcoe-up.sh

@ -1,7 +1,7 @@ @@ -1,7 +1,7 @@
#!/bin/sh
#
# We get called like this:
# fcoe-up <network-device> <dcb|nodcb>
# fcoe-up <network-device> <dcb|nodcb> <fabric|vn2vn>
#
# Note currently only nodcb is supported, the dcb option is reserved for
# future use.
@ -15,6 +15,7 @@ type ip_to_var >/dev/null 2>&1 || . /lib/net-lib.sh @@ -15,6 +15,7 @@ type ip_to_var >/dev/null 2>&1 || . /lib/net-lib.sh

netif=$1
dcb=$2
mode=$3
vlan="yes"

iflink=$(cat /sys/class/net/$netif/iflink)
@ -50,7 +51,11 @@ write_fcoemon_cfg() { @@ -50,7 +51,11 @@ write_fcoemon_cfg() {
else
echo AUTO_VLAN=\"no\" >> /etc/fcoe/cfg-$netif
fi
if [ "$mode" = "vn2vn" ] ; then
echo MODE=\"vn2vn\" >> /etc/fcoe/cfg-$netif
else
echo MODE=\"fabric\" >> /etc/fcoe/cfg-$netif
fi
}

if [ "$netdriver" = "bnx2x" ]; then

8
modules.d/95fcoe/module-setup.sh

@ -45,7 +45,13 @@ cmdline() { @@ -45,7 +45,13 @@ cmdline() {
for c in /sys/bus/fcoe/devices/ctlr_* ; do
[ -L $c ] || continue
read enabled < $c/enabled
read mode < $c/mode
[ $enabled -eq 0 ] && continue
if [ $mode = "VN2VN" ] ; then
mode="vn2vn"
else
mode="fabric"
fi
d=$(cd -P $c; echo $PWD)
i=${d%/*}
read mac < ${i}/address
@ -75,7 +81,7 @@ cmdline() { @@ -75,7 +81,7 @@ cmdline() {
[ $? -eq 0 ] && dcb="nodcb"
fi

echo "fcoe=${mac}:${dcb}"
echo "fcoe=${mac}:${dcb}:${mode}"
done
}


22
modules.d/95fcoe/parse-fcoe.sh

@ -1,8 +1,8 @@ @@ -1,8 +1,8 @@
#!/bin/sh
#
# Supported formats:
# fcoe=<networkdevice>:<dcb|nodcb>
# fcoe=<macaddress>:<dcb|nodcb>
# fcoe=<networkdevice>:<dcb|nodcb>:<fabric|vn2vn>
# fcoe=<macaddress>:<dcb|nodcb>:<fabric|vn2vn>
#
# Note currently only nodcb is supported, the dcb option is reserved for
# future use.
@ -10,8 +10,8 @@ @@ -10,8 +10,8 @@
# Note letters in the macaddress must be lowercase!
#
# Examples:
# fcoe=eth0:nodcb
# fcoe=4a:3f:4c:04:f8:d7:nodcb
# fcoe=eth0:nodcb:vn2vn
# fcoe=4a:3f:4c:04:f8:d7:nodcb:fabric

[ -z "$fcoe" ] && fcoe=$(getarg fcoe=)

@ -32,11 +32,25 @@ parse_fcoe_opts() { @@ -32,11 +32,25 @@ parse_fcoe_opts() {
2)
fcoe_interface=$1
fcoe_dcb=$2
fcoe_mode="fabric"
return 0
;;
3)
fcoe_interface=$1
fcoe_dcb=$2
fcoe_mode=$3
return 0
;;
7)
fcoe_mac=$1:$2:$3:$4:$5:$6
fcoe_dcb=$7
fcoe_mode="fabric"
return 0
;;
8)
fcoe_mac=$1:$2:$3:$4:$5:$6
fcoe_dcb=$7
fcoe_mode=$8
return 0
;;
*)

Loading…
Cancel
Save