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

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