]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
95fcoe: Allow to specify the FCoE mode via the fcoe= parameter
authorHannes Reinecke <hare@suse.de>
Wed, 24 Aug 2016 06:32:04 +0000 (08:32 +0200)
committerDaniel Molkentin <dmolkentin@suse.com>
Fri, 15 Dec 2017 17:51:49 +0000 (18:51 +0100)
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>
dracut.cmdline.7.asc
modules.d/95fcoe/fcoe-genrules.sh
modules.d/95fcoe/fcoe-up.sh
modules.d/95fcoe/module-setup.sh
modules.d/95fcoe/parse-fcoe.sh

index 63c6c10fe25e6abb28be26c096637b0e63e2909d..b5f6f0f61c6267bbc98557358a46b32057a82cf7 100644 (file)
@@ -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!
 
index eb58601b3dab21657411c2c727d4b43f475035d8..af15a584d67f071b2f6a3d2585de02e9c433d0e9 100755 (executable)
@@ -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
index b7cc8e6cd284183dbb0bbaeed75b871690901974..55ab235a2ae18030c4f5356f9205b9c029e86792 100755 (executable)
@@ -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
 
 netif=$1
 dcb=$2
+mode=$3
 vlan="yes"
 
 iflink=$(cat /sys/class/net/$netif/iflink)
@@ -50,7 +51,11 @@ write_fcoemon_cfg() {
     else
            echo AUTO_VLAN=\"no\" >> /etc/fcoe/cfg-$netif
     fi
-    echo MODE=\"fabric\" >> /etc/fcoe/cfg-$netif
+    if [ "$mode" = "vn2vn" ] ; then
+        echo MODE=\"vn2vn\" >> /etc/fcoe/cfg-$netif
+    else
+        echo MODE=\"fabric\" >> /etc/fcoe/cfg-$netif
+    fi
 }
 
 if [ "$netdriver" = "bnx2x" ]; then
index 539cd7c168000952e2426d4ff9525f0e6ec6890c..e9a8300ee9e724be3907b7b99a141da5501f88d7 100755 (executable)
@@ -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() {
             [ $? -eq 0 ] && dcb="nodcb"
         fi
 
-        echo "fcoe=${mac}:${dcb}"
+        echo "fcoe=${mac}:${dcb}:${mode}"
     done
 }
 
index 9f471848118e32655385e4a6de880b05d566c113..75cca9a500854fea2d647f8c6d8410e479d43e60 100755 (executable)
@@ -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 @@
 # 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() {
         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
             ;;
         *)