Blame SOURCES/0151-fcoe-wait-for-lldpad-to-be-ready.patch

18971c
From bdb6683d6feb744c85b416ea4cb48e7c6a49aaa9 Mon Sep 17 00:00:00 2001
18971c
From: Harald Hoyer <harald@redhat.com>
18971c
Date: Tue, 25 Mar 2014 15:28:19 +0100
18971c
Subject: [PATCH] fcoe: wait for lldpad to be ready
18971c
18971c
https://bugzilla.redhat.com/show_bug.cgi?id=1080353
18971c
---
18971c
 modules.d/95fcoe/fcoe-up.sh      | 10 ++++++++--
18971c
 modules.d/95fcoe/module-setup.sh |  2 +-
18971c
 2 files changed, 9 insertions(+), 3 deletions(-)
18971c
18971c
diff --git a/modules.d/95fcoe/fcoe-up.sh b/modules.d/95fcoe/fcoe-up.sh
18971c
index ecb1593d..60642cfd 100755
18971c
--- a/modules.d/95fcoe/fcoe-up.sh
18971c
+++ b/modules.d/95fcoe/fcoe-up.sh
18971c
@@ -31,8 +31,14 @@ if [ "$dcb" = "dcb" ]; then
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
-    # stupid tools, need sleep
18971c
-    sleep 1
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
     dcbtool sc "$netif" dcb on
18971c
     sleep 1
18971c
     dcbtool sc "$netif" app:fcoe e:1 a:1 w:1
18971c
diff --git a/modules.d/95fcoe/module-setup.sh b/modules.d/95fcoe/module-setup.sh
18971c
index fe8e40aa..3ffaf5a5 100755
18971c
--- a/modules.d/95fcoe/module-setup.sh
18971c
+++ b/modules.d/95fcoe/module-setup.sh
18971c
@@ -20,7 +20,7 @@ installkernel() {
18971c
 }
18971c
 
18971c
 install() {
18971c
-    inst_multiple ip dcbtool fipvlan lldpad readlink
18971c
+    inst_multiple ip dcbtool fipvlan lldpad readlink lldptool
18971c
 
18971c
     mkdir -m 0755 -p "$initdir/var/lib/lldpad"
18971c