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

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