Blob Blame History Raw
From 17445cb35ff2f626ccde07de61106bbcd6d0b268 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Tue, 25 Mar 2014 15:28:19 +0100
Subject: [PATCH] fcoe: wait for lldpad to be ready

https://bugzilla.redhat.com/show_bug.cgi?id=1080353
---
 modules.d/95fcoe/fcoe-up.sh      | 10 ++++++++--
 modules.d/95fcoe/module-setup.sh |  2 +-
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/modules.d/95fcoe/fcoe-up.sh b/modules.d/95fcoe/fcoe-up.sh
index ecb1593..60642cf 100755
--- a/modules.d/95fcoe/fcoe-up.sh
+++ b/modules.d/95fcoe/fcoe-up.sh
@@ -31,8 +31,14 @@ if [ "$dcb" = "dcb" ]; then
     # are to kill it and start a new lldpad to take over. Data is transfered
     # between the 2 using a shm segment
     lldpad -d
-    # stupid tools, need sleep
-    sleep 1
+    # wait for lldpad to be ready
+    i=0
+    while [ $i -lt 60 ]; do
+        lldptool -p && break
+        info "Waiting for lldpad to be ready"
+        sleep 1
+        i=$(($i+1))
+    done
     dcbtool sc "$netif" dcb on
     sleep 1
     dcbtool sc "$netif" app:fcoe e:1 a:1 w:1
diff --git a/modules.d/95fcoe/module-setup.sh b/modules.d/95fcoe/module-setup.sh
index fe8e40a..3ffaf5a 100755
--- a/modules.d/95fcoe/module-setup.sh
+++ b/modules.d/95fcoe/module-setup.sh
@@ -20,7 +20,7 @@ installkernel() {
 }
 
 install() {
-    inst_multiple ip dcbtool fipvlan lldpad readlink
+    inst_multiple ip dcbtool fipvlan lldpad readlink lldptool
 
     mkdir -m 0755 -p "$initdir/var/lib/lldpad"