Blame 0003-fcoe-wait-for-lldpad-to-be-ready.patch

Harald Hoyer 240f09
From 3aaf6ccc837d7e16fa8c0c259d107832a578ff89 Mon Sep 17 00:00:00 2001
Harald Hoyer 240f09
From: Harald Hoyer <harald@redhat.com>
Harald Hoyer 240f09
Date: Tue, 25 Mar 2014 15:28:19 +0100
Harald Hoyer 240f09
Subject: [PATCH] fcoe: wait for lldpad to be ready
Harald Hoyer 240f09
Harald Hoyer 240f09
---
Harald Hoyer 240f09
 modules.d/95fcoe/fcoe-up.sh      | 10 ++++++++--
Harald Hoyer 240f09
 modules.d/95fcoe/module-setup.sh |  2 +-
Harald Hoyer 240f09
 2 files changed, 9 insertions(+), 3 deletions(-)
Harald Hoyer 240f09
Harald Hoyer 240f09
diff --git a/modules.d/95fcoe/fcoe-up.sh b/modules.d/95fcoe/fcoe-up.sh
Zbigniew Jędrzejewski-Szmek 7f4a44
index 511c554a96..dd4535889f 100755
Harald Hoyer 240f09
--- a/modules.d/95fcoe/fcoe-up.sh
Harald Hoyer 240f09
+++ b/modules.d/95fcoe/fcoe-up.sh
Harald Hoyer 240f09
@@ -28,8 +28,14 @@ if [ "$dcb" = "dcb" ]; then
Harald Hoyer 240f09
     # are to kill it and start a new lldpad to take over. Data is transfered
Harald Hoyer 240f09
     # between the 2 using a shm segment
Harald Hoyer 240f09
     lldpad -d
Harald Hoyer 240f09
-    # stupid tools, need sleep
Harald Hoyer 240f09
-    sleep 1
Harald Hoyer 240f09
+    # wait for lldpad to be ready
Harald Hoyer 240f09
+    i=0
Harald Hoyer 240f09
+    while [ $i -lt 60 ]; do
Harald Hoyer 240f09
+        lldptool -p && break
Harald Hoyer 240f09
+        info "Waiting for lldpad to be ready"
Harald Hoyer 240f09
+        sleep 1
Harald Hoyer 240f09
+        i=$(($i+1))
Harald Hoyer 240f09
+    done
Harald Hoyer 240f09
     dcbtool sc "$netif" dcb on
Harald Hoyer 240f09
     sleep 1
Harald Hoyer 240f09
     dcbtool sc "$netif" app:fcoe e:1 a:1 w:1
Harald Hoyer 240f09
diff --git a/modules.d/95fcoe/module-setup.sh b/modules.d/95fcoe/module-setup.sh
Zbigniew Jędrzejewski-Szmek 7f4a44
index c502ba003c..9a52c00837 100755
Harald Hoyer 240f09
--- a/modules.d/95fcoe/module-setup.sh
Harald Hoyer 240f09
+++ b/modules.d/95fcoe/module-setup.sh
Harald Hoyer 240f09
@@ -21,7 +21,7 @@ installkernel() {
Harald Hoyer 240f09
 
Harald Hoyer 240f09
 # called by dracut
Harald Hoyer 240f09
 install() {
Harald Hoyer 240f09
-    inst_multiple ip dcbtool fipvlan lldpad readlink
Harald Hoyer 240f09
+    inst_multiple ip dcbtool fipvlan lldpad readlink lldptool
Harald Hoyer 240f09
 
Harald Hoyer 240f09
     mkdir -m 0755 -p "$initdir/var/lib/lldpad"
Harald Hoyer 240f09
 
Zbigniew Jędrzejewski-Szmek 7f4a44
-- 
Zbigniew Jędrzejewski-Szmek 7f4a44
1.9.3
Zbigniew Jędrzejewski-Szmek 7f4a44