fcoe: moved edd detection to settled initqueue

At the time of modprobing edd, all pci devices must exist and have to be
initialized for the symlinks to work.
master
Harald Hoyer 2011-05-02 11:25:13 +02:00
parent 979c4a9304
commit 80df37f475
3 changed files with 27 additions and 15 deletions

25
modules.d/95fcoe/fcoe-edd.sh Executable file
View File

@ -0,0 +1,25 @@
#!/bin/sh
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh

dcb=$1

if ! [ -d /sys/firmware/edd ]; then
modprobe edd
while ! [ -d /sys/firmware/edd ]; do sleep 0.1; done
fi

for disk in /sys/firmware/edd/int13_*; do
[ -d $disk ] || continue
for nic in ${disk}/pci_dev/net/*; do
[ -d $nic ] || continue
if [ -e ${nic}/address ]; then
fcoe_interface=${nic##*/}
if ! [ -e "/tmp/.fcoe-$fcoe_interface" ]; then
/sbin/fcoe-up $fcoe_interface $dcb
> "/tmp/.fcoe-$fcoe_interface"
fi
fi
done
done
modprobe -r edd

View File

@ -29,8 +29,8 @@ install() {
mkdir -m 0755 -p "$initdir/var/lib/lldpad" mkdir -m 0755 -p "$initdir/var/lib/lldpad"


inst "$moddir/fcoe-up" "/sbin/fcoe-up" inst "$moddir/fcoe-up" "/sbin/fcoe-up"
inst "$moddir/fcoe-edd.sh" "/sbin/fcoe-edd"
inst "$moddir/fcoe-genrules.sh" "/sbin/fcoe-genrules.sh" inst "$moddir/fcoe-genrules.sh" "/sbin/fcoe-genrules.sh"
inst_hook pre-udev 60 "$moddir/fcoe-genrules.sh"
inst_hook cmdline 99 "$moddir/parse-fcoe.sh" inst_hook cmdline 99 "$moddir/parse-fcoe.sh"
} }



View File

@ -51,20 +51,7 @@ if [ "$fcoe_interface" = "edd" ]; then
if [ "$fcoe_dcb" != "nodcb" -a "$fcoe_dcb" != "dcb" ] ; then if [ "$fcoe_dcb" != "nodcb" -a "$fcoe_dcb" != "dcb" ] ; then
warn "Invalid FCoE DCB option: $fcoe_dcb" warn "Invalid FCoE DCB option: $fcoe_dcb"
fi fi
[ -d /sys/firmware/edd ] || modprobe edd /sbin/initqueue --settled --unique /sbin/fcoe-edd $fcoe_dcb
# parse edd interfaces
for disk in /sys/firmware/edd/int13_*; do
[ -d $disk ] || continue
for nic in ${disk}/pci_dev/net/*; do
[ -d $nic ] || continue
if [ -e ${nic}/address ]; then
unset fcoe_mac
unset fcoe_interface
fcoe_mac=$(cat ${nic}/address)
[ -n "$fcoe_mac" ] && . $(command -v fcoe-genrules.sh)
fi
done
done
else else
for fcoe in $(getargs fcoe=); do for fcoe in $(getargs fcoe=); do
unset fcoe_mac unset fcoe_mac