fcoe: EDD parsing patch for i40e

(cherry picked from commit 4031a2fa64)
master
Chris Leech 2015-07-03 13:44:16 +02:00 committed by Harald Hoyer
parent 4891d9a2ce
commit 9a5bd6804a
1 changed files with 13 additions and 0 deletions

View File

@ -9,8 +9,21 @@ fi

for disk in /sys/firmware/edd/int13_*; do
[ -d $disk ] || continue
if [ -e ${disk}/pci_dev/driver ]; then
driver=`readlink ${disk}/pci_dev/driver`
driver=${driver##*/}
fi
# i40e uses dev_port 1 for a virtual fcoe function
if [ "${driver}" == "i40e" ]; then
dev_port=1
fi
for nic in ${disk}/pci_dev/net/*; do
[ -d $nic ] || continue
if [ -n "${dev_port}" -a -e ${nic}/dev_port ]; then
if [ `cat ${nic}/dev_port` -ne ${dev_port} ]; then
continue
fi
fi
if [ -e ${nic}/address ]; then
fcoe_interface=${nic##*/}
if ! [ -e "/tmp/.fcoe-$fcoe_interface" ]; then