From 4c2d48d5c4449789018024c3d9f402f5108e9a68 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Mon, 31 Mar 2014 16:21:49 +0200 Subject: [PATCH] fcoe: workaround fcoe timing issues --- modules.d/95fcoe/fcoe-genrules.sh | 2 +- modules.d/95fcoe/fcoe-up.sh | 23 ++++++++++++++++++++--- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/modules.d/95fcoe/fcoe-genrules.sh b/modules.d/95fcoe/fcoe-genrules.sh index 80894ed2..fa3af6df 100755 --- a/modules.d/95fcoe/fcoe-genrules.sh +++ b/modules.d/95fcoe/fcoe-genrules.sh @@ -13,4 +13,4 @@ else printf 'ACTION=="add", SUBSYSTEM=="net", NAME=="%s", RUN+="/sbin/initqueue --onetime --unique --name fcoe-up-$env{INTERFACE} /sbin/fcoe-up $env{INTERFACE} %s"\n' "$fcoe_interface" "$fcoe_dcb" fi -} > /etc/udev/rules.d/92-fcoe.rules +} >> /etc/udev/rules.d/92-fcoe.rules diff --git a/modules.d/95fcoe/fcoe-up.sh b/modules.d/95fcoe/fcoe-up.sh index 60642cfd..edbfcc84 100755 --- a/modules.d/95fcoe/fcoe-up.sh +++ b/modules.d/95fcoe/fcoe-up.sh @@ -39,10 +39,27 @@ if [ "$dcb" = "dcb" ]; then sleep 1 i=$(($i+1)) done - dcbtool sc "$netif" dcb on - sleep 1 - dcbtool sc "$netif" app:fcoe e:1 a:1 w:1 + + # on some systems lldpad needs some time + # sleep until we find a better solution + sleep 30 + + while [ $i -lt 60 ]; do + dcbtool sc "$netif" dcb on && break + info "Retrying to turn dcb on" + sleep 1 + i=$(($i+1)) + done + + while [ $i -lt 60 ]; do + dcbtool sc "$netif" app:fcoe e:1 a:1 w:1 && break + info "Retrying to turn fcoe on" + sleep 1 + i=$(($i+1)) + done + sleep 1 + fipvlan "$netif" -c -s elif [ "$netdriver" = "bnx2x" ]; then # If driver is bnx2x, do not use /sys/module/fcoe/parameters/create but fipvlan