Blame SOURCES/0402-95fcoe-start-lldpad-separately.patch

712866
From a4cbfd719bde7339ffefd641839fdbfb6305c012 Mon Sep 17 00:00:00 2001
712866
From: Hannes Reinecke <hare@suse.de>
712866
Date: Thu, 11 Dec 2014 15:46:24 +0100
712866
Subject: [PATCH] 95fcoe: start lldpad separately
712866
712866
lldpad is a system-wide process, which must be started only once.
712866
So we should be separate it from fcoe-up, as it might be called
712866
several times.
712866
712866
Signed-off-by: Hannes Reinecke <hare@suse.de>
712866
Signed-off-by: Thomas Renninger <trenn@suse.de>
712866
(cherry picked from commit 22e837b6458d5d17d1cb6a9b09b7515746d4e098)
712866
---
712866
 modules.d/95fcoe/fcoe-up.sh      |  8 --------
712866
 modules.d/95fcoe/lldpad.sh       | 14 ++++++++++++++
712866
 modules.d/95fcoe/module-setup.sh |  1 +
712866
 3 files changed, 15 insertions(+), 8 deletions(-)
712866
 create mode 100644 modules.d/95fcoe/lldpad.sh
712866
712866
diff --git a/modules.d/95fcoe/fcoe-up.sh b/modules.d/95fcoe/fcoe-up.sh
5c6c2a
index 823d7acc..1d62570e 100755
712866
--- a/modules.d/95fcoe/fcoe-up.sh
712866
+++ b/modules.d/95fcoe/fcoe-up.sh
712866
@@ -43,10 +43,6 @@ write_fcoemon_cfg() {
712866
 }
712866
 
712866
 if [ "$dcb" = "dcb" ]; then
712866
-    # Note lldpad will stay running after switchroot, the system initscripts
712866
-    # are to kill it and start a new lldpad to take over. Data is transfered
712866
-    # between the 2 using a shm segment
712866
-    lldpad -d
712866
     # wait for lldpad to be ready
712866
     i=0
712866
     while [ $i -lt 60 ]; do
712866
@@ -56,10 +52,6 @@ if [ "$dcb" = "dcb" ]; then
712866
         i=$(($i+1))
712866
     done
712866
 
712866
-    # on some systems lldpad needs some time
712866
-    # sleep until we find a better solution
712866
-    sleep 30
712866
-
712866
     while [ $i -lt 60 ]; do
712866
         dcbtool sc "$netif" dcb on && break
712866
         info "Retrying to turn dcb on"
712866
diff --git a/modules.d/95fcoe/lldpad.sh b/modules.d/95fcoe/lldpad.sh
712866
new file mode 100644
5c6c2a
index 00000000..d06a3bd8
712866
--- /dev/null
712866
+++ b/modules.d/95fcoe/lldpad.sh
712866
@@ -0,0 +1,14 @@
712866
+#!/bin/bash
712866
+
712866
+# Note lldpad will stay running after switchroot, the system initscripts
712866
+# are to kill it and start a new lldpad to take over. Data is transfered
712866
+# between the 2 using a shm segment
712866
+lldpad -d
712866
+# wait for lldpad to be ready
712866
+i=0
712866
+while [ $i -lt 60 ]; do
712866
+    lldptool -p && break
712866
+    info "Waiting for lldpad to be ready"
712866
+    sleep 1
712866
+    i=$(($i+1))
712866
+done
712866
diff --git a/modules.d/95fcoe/module-setup.sh b/modules.d/95fcoe/module-setup.sh
5c6c2a
index ba10b0ab..c000b3be 100755
712866
--- a/modules.d/95fcoe/module-setup.sh
712866
+++ b/modules.d/95fcoe/module-setup.sh
712866
@@ -36,6 +36,7 @@ install() {
712866
     inst "$moddir/fcoe-up.sh" "/sbin/fcoe-up"
712866
     inst "$moddir/fcoe-edd.sh" "/sbin/fcoe-edd"
712866
     inst "$moddir/fcoe-genrules.sh" "/sbin/fcoe-genrules.sh"
712866
+    inst_hook pre-trigger 03 "$moddir/lldpad.sh"
712866
     inst_hook cmdline 99 "$moddir/parse-fcoe.sh"
712866
     inst_hook cleanup 90 "$moddir/cleanup-fcoe.sh"
712866
     dracut_need_initqueue