From: Harald Hoyer Date: Wed, 9 Nov 2011 13:40:56 +0000 (+0100) Subject: 95fcoe: support bnx2fc X-Git-Tag: 014~21 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f6783bee07d04f8d80c7c14bc0f1ceb7e9dade41;p=thirdparty%2Fdracut.git 95fcoe: support bnx2fc To start bnx2fc, we need to run fipvlan only and not dcbtool. DCBX is run automatically in the hardware, but VLAN discovery needs to be started by fipvlan. https://bugzilla.redhat.com/show_bug.cgi?id=736094 --- diff --git a/modules.d/95fcoe/fcoe-up b/modules.d/95fcoe/fcoe-up index da69c5208..5c5bdb5d8 100755 --- a/modules.d/95fcoe/fcoe-up +++ b/modules.d/95fcoe/fcoe-up @@ -23,6 +23,9 @@ dcb=$2 ip link set "$netif" up wait_for_if_up "$netif" +netdriver=$(readlink -f /sys/class/net/$netif/device/driver) +netdriver=${netdriver##*/} + if [ "$dcb" = "dcb" ]; then # Note lldpad will stay running after switchroot, the system initscripts # are to kill it and start a new lldpad to take over. Data is transfered @@ -35,6 +38,11 @@ if [ "$dcb" = "dcb" ]; then dcbtool sc "$netif" app:fcoe e:1 a:1 w:1 sleep 1 fipvlan "$netif" -c -s +elif [ "$netdriver" = "bnx2x" ]; then + # If driver is bnx2x, do not use /sys/module/fcoe/parameters/create but fipvlan + modprobe 8021q + udevadm settle --timeout=30 + fipvlan "$netif" -c -s else echo -n "$netif" > /sys/module/fcoe/parameters/create fi diff --git a/modules.d/95fcoe/module-setup.sh b/modules.d/95fcoe/module-setup.sh index 6beb14a38..b4cee97bd 100755 --- a/modules.d/95fcoe/module-setup.sh +++ b/modules.d/95fcoe/module-setup.sh @@ -25,6 +25,7 @@ install() { inst dcbtool inst fipvlan inst lldpad + inst readlink mkdir -m 0755 -p "$initdir/var/lib/lldpad" diff --git a/modules.d/95fcoe/parse-fcoe.sh b/modules.d/95fcoe/parse-fcoe.sh index 08c672256..dc40c825f 100755 --- a/modules.d/95fcoe/parse-fcoe.sh +++ b/modules.d/95fcoe/parse-fcoe.sh @@ -20,6 +20,13 @@ # If it's not set we don't continue [ -z "$fcoe" ] && return + +# BRCM: Later, should check whether bnx2x is loaded first before loading bnx2fc so do not load bnx2fc when there are no Broadcom adapters +[ -e /sys/module/fcoe/parameters/create ] || modprobe -a fcoe || die "FCoE requested but kernel/initrd does not support FCoE" + +modprobe bnx2fc >/dev/null 2>&1 +udevadm settle --timeout=30 + # FCoE actually supported? [ -e /sys/module/fcoe/parameters/create ] || modprobe fcoe || die "FCoE requested but kernel/initrd does not support FCoE"