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 2016-08-24 08:32:04 +02:00 committed by Daniel Molkentin
parent d71c9ee286
commit c75196e11e
5 changed files with 39 additions and 12 deletions

View File

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


FCoE 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 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 _<MAC>_ or EDD settings. The second argument specifies if DCB
supported. This parameter can be specified multiple times. 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! NOTE: letters in the MAC-address must be lowercase!



View File

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

View File

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


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


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


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

View File

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


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



View File

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


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


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