]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
95fcoe: Reorder initialisation for bnx2x
authorJohannes Thumshirn <jthumshirn@suse.com>
Tue, 27 Sep 2016 10:41:22 +0000 (12:41 +0200)
committerDaniel Molkentin <dmolkentin@suse.com>
Fri, 15 Dec 2017 17:51:42 +0000 (18:51 +0100)
Check first if we're running off an bnx2x device and start FCoE on it
via fipvlan, then go the normal/Intel way of starting DCB.

Also the SUSE version of fcoemon needs the yes parameter for the
--syslog option

References: bsc#982588

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.com>
modules.d/95fcoe/fcoe-up.sh

index ddc87b1c668a4515ef677a47f8877ba4ff036b03..ecd007d7eed235b60f69f52b06e1707184c59dd5 100755 (executable)
@@ -27,6 +27,13 @@ fi
 ip link set dev $netif up
 linkup "$netif"
 
+# Some fcoemon implementations expect --syslog=true
+syslogopt="--syslog"
+if fcoemon -h|grep syslog|grep -q yes; then
+    fcoemonyes="$syslogopt=yes"
+fi
+
+
 netdriver=$(readlink -f /sys/class/net/$netif/device/driver)
 netdriver=${netdriver##*/}
 
@@ -45,7 +52,16 @@ write_fcoemon_cfg() {
     echo MODE=\"fabric\" >> /etc/fcoe/cfg-$netif
 }
 
-if [ "$dcb" = "dcb" ]; then
+if [ "$netdriver" = "bnx2x" ]; then
+    # If driver is bnx2x, do not use /sys/module/fcoe/parameters/create but fipvlan
+    modprobe 8021q
+    udevadm settle --timeout=30
+    # Sleep for 13 s to allow dcb negotiation
+    sleep 13
+    write_fcoemon_cfg
+    fcoemon $syslogopt
+    fipvlan -c -s "$netif"
+elif [ "$dcb" = "dcb" ]; then
     # wait for lldpad to be ready
     i=0
     while [ $i -lt 60 ]; do
@@ -79,18 +95,11 @@ if [ "$dcb" = "dcb" ]; then
     sleep 1
 
     write_fcoemon_cfg
-    fcoemon --syslog
-elif [ "$netdriver" = "bnx2x" ]; then
-    # If driver is bnx2x, do not use /sys/module/fcoe/parameters/create but fipvlan
-    modprobe 8021q
-    udevadm settle --timeout=30
-    # Sleep for 13 s to allow dcb negotiation
-    sleep 13
-    fipvlan "$netif" -c -s
+    fcoemon $syslogopt
 else
     vlan="no"
     write_fcoemon_cfg
-    fcoemon --syslog
+    fcoemon $syslogopt
 fi
 
 need_shutdown